Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I would like the c# code placed in a .dll file so that when we deploy the to .ascx pages on a different server, the code is in a dll, not in the .ascx file
Posted
Comments
deepakaitr12345 2-Jun-12 6:05am    
whatever you are asking that is not clear.
Do you want to place the dll and ascx files on the diffrent server?
or
the code replacing from one server to another server it does't change the context of the code(code in the aspx remains as it is).
or
there is no change when we deploy the code on diffrent server(when you deploy the code make sure you are relesing the Binaries+Pages+controlfiles+Webconfig+log4Net)

Please clear what you want to know.

Thanks

when you build your project, VS build a dll of your codes in bin, just add refrence to your new project and then use them!

C#
Ariaquote.controls.AuthorBio taha = new AuthorBio();
Panel1.Controls.Add(taha);

I add Ariaquote dll to my current project, and controls is my user control folder and i just build an instance of one of my user controls!
 
Share this answer
 
This might not seem like a solution but more of a suggestion but what you are trying to do seems like better be done by a Server Control rather than a Web User control. I suggest you make this user control a server control instead. I know that is not what you asked for but believe me once you do that you will agree that that is the right thing to do.

Note: All this assuming you want the DLL because you need to reuse the control on many servers and possibily on multiple sites.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900