user441521
user441521

Reputation: 6998

asp.net user control deployment

I'm using VS 2010. Is there a way to "deploy" a user control and it's code behind in a sort of binary (.ocx like) way so that I can just reference it from other projects and the html/code behind can't be edited?

Upvotes: 4

Views: 240

Answers (3)

suff trek
suff trek

Reputation: 39777

It should be possible (though not recommended) if you place .NET code into ASCX markup itself inside of <script runat="server"></script> tags.

Upvotes: 0

Sethcran
Sethcran

Reputation: 788

As ps2goat said, what you want are custom server controls. That being said, there is a way to create them from standard ascx controls with only some extra effort.

http://msdn.microsoft.com/en-us/library/aa479318.aspx

Upvotes: 1

ps2goat
ps2goat

Reputation: 8475

No, you either cut and paste or look into using custom Server Controls. The custom server controls are basically a way of building the same .ascx style controls but doing it all in code without a UI portion. If done correctly, you can still have a UI drag and drop interface for your controls.

http://msdn.microsoft.com/en-us/library/zt27tfhy(v=vs.100).aspx

Upvotes: 1

Related Questions