Posted on: 4/27/2011 6:07:32 AM | Views : 236

I created a usercontrol call ThumbItem, using the code for loadcontrol:
ThumbItem newItem = (ThumbItem)this.LoadControl("~/Activities/ThumbItem.ascx");
but VS prompt me "The class was not found". And I put this .ascx file in to App_Code folder will able the load the class. but, VS shown the error in error list say this is not allow store the .ascx file in App_Code folder......
However, I used the code of VB as :
Dim newItem As ThumbItem=Me.LoadControl("~/Activities/ThumbItem.ascx")
have no any problem.
 
How I write the code to load .ascx control in C# language?
 
Many Thanks
...

Go to the complete details ...