Last post Jul 10, 2009 02:56 PM by e-turhan
Jul 10, 2009 11:34 AM|e-turhan|LINK
I am creating ascx and ascx.cs files dynamicly and putting into the project folder, then i am writing what it needs to work via streamwriter inside them.When i load the control via Page.LoadControl method, it gives MynameSpace.Myaclass did not found error.
When i build the project in VS, the control works fine. Is there any way to run the ascx control without build in VS ?
ascx build dynamic
Jul 10, 2009 01:28 PM|Scott927|LINK
I think your approach here is incorrect. There really should be no need to actually WRITE the physical code files at run-time. Can you give us an idea of what you're trying to do?
Jul 10, 2009 02:56 PM|e-turhan|LINK
I am not sure if I am on the right way or not but i found this solution.
I am developing a form generator module for dotnetnuke, i am getting the html codes including asp.net controls such as textbox radiobutton etc. by a way to a string. Then i am writing them to the ascx file that i have created.I am creating separate files
for each module instance by getting unique tabmodule IDs, i am giving the tabmoduleIDs to ascx files as filename(for example 58.ascx). Then when i create a module instance in the page, i am loading the control via Page.LoadControl(tabmoduleID) method.And it
is calling Page.LoadControl(58.ascx).But it is not working.When i build the project in VS. It is working nice.