HEY, LIL’ Wayne – what was in the bag you were carrying Friday night? The rapper – whose album “Tha Carter III” was one of the biggest hits of 2008 – was supposed to perform at “Fashion Rocks” but left when he found out he’d have to go through security.

“When Lil’ Wayne showed up to perform in the show – and he showed up on time – he was carrying a bag and refused, point blank, to go through security,” one senior production person told us. “Everyone else – including Rihanna, Chris Brown, Beyoncé, Justin Timberlake and Kid Rock – went through security, and we couldn’t make an exception. He’s obviously not a Boy Scout and has a history with drugs and guns.

“But he wouldn’t budge and refused to have his bag searched or have a security wand passed over him. Then he started getting abusive: ‘I don’t need your [bleeping] show – I’m leaving if you make me do this.’ So he had to leave, I mean, who knows what was in that bag?

“He got back in the car we’d paid for and drove off. Minutes later, we got frantic calls from his management and record label begging us to have him back. We said, ‘OK, we have an opening at 7 p.m.’ The next thing you know, Wayne’s people are saying, ‘Can we do a bit later. He’s not going to be ready.’

“We had a crew of 250 people waiting for him . . . Then he calls at, like, 9:30 and says, ‘I’m five blocks away,’ which is like 500 blocks away in New York traffic, so we just pulled the plug. It was just so disrespectful to the crew and to the 5,000 audience members. Unbelievable.”

Lil’ Wayne’s manager didn’t return calls.

Meanwhile, the rapper attended a Manhattan court hearing yesterday on whether cops violated his rights after a concert with Ja Rule at the Beacon last November. That’s when they stopped and boarded his tour bus and found him sitting on a bed in his boxers, allegedly tossing a Louis Vuitton bag containing a 9mm gun to the floor, The Post’s Laura Italiano reports.

Click here for complete FASHION WEEK coverage