Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
User Controls
Message
General information
Forum:
ASP.NET
Category:
Web forms
Title:
Miscellaneous
Thread ID:
00759524
Message ID:
00759720
Views:
20
>Thanks, Dave. I discovered the LoadControl() method after I posted my original question. Is there *any* other way of doing this? I don't really like having to have the path and file name hardcoded like this.

Data drive your page so the paths to your user controls will be stored in a table. In the IBuySpy sample the layout of the web site is stored in a SQL table. There is just one main aspx page that renders the whole site.

>
>I've wondered if maybe I should be using Custom WebControls instead of UserControls, but from what I understand, there's no design surface for those. Is that correct? (I just started looking at that now).
>

I haven't created my own custom controls in asp.net, so I don't know. With custom controls you have to create all your own HTML code that will render at runtime and do a lot of extra work to represent the control at design time.

The bottom line with user controls versus custom controls is that user controls use containership and custom controls use inheritance. user controls are like include files in classic asp to group together several asp.net controls and reuse them on different webforms. You would use a custom control if you wanted to subclass the textbox control and make it behave differently like make it accept numbers only, for example.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform