User Control in Asp.net?
How can we create user control in run time in web application?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh TrivediPosted Mar 27, 2012, 11:41 PM
user control is contain one or more control and in form of ascx.
i think you can not create user control run time.
But...
Do one thing.
create blank user control.
fill control run time as per the requirement
load user control run time using Page.LoadControl("myusercontrol.ascx")
add it to page.
hope this help.
SenthilkumarPosted Mar 27, 2012, 11:38 PM
Please look into these urls:
http://www.etechplanet.com/blog/adding-aspnet-user-controls-at-run-time-using-c-code.aspx
http://msdn.microsoft.com/en-us/library/c0az2h86(v=vs.85).aspx
http://stackoverflow.com/questions/9069347/how-to-add-user-control-on-run-time-in-asp-net-solved