[thelist] vb.net: using subroutines within user controls - .ascx

Gary McPherson lists at ingenyus.net
Tue Oct 12 01:54:28 CDT 2004


----Original Message----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org] On Behalf Of Casey Crookston
Sent: 12 October 2004 04:04
To: thelist at lists.evolt.org
Subject: Re: [thelist] vb.net: using subroutines within user
controls - .ascx

> What, exactly, is in the user control?  Nothing but plain
> HTML?  Or do there need to be some server side tags as well?
> And, how do I "run the code in the page_load sub"?  If you
> could, actual code examples would be wonderful!!!!
> 
> Thank you!
> 
> Casey

A user control can been looked at as a "mini-page" - the primary difference
between one and a full page is that it cannot be viewed alone, you cannot
request mycontrol.ascx, it has to be included in an aspx page. Whether there
is only HTML or server-side processing is entirely up to you and your
requirements. You don't explicitly run the page_load sub, it is executed
whenever that control is loaded in a page, automatically.

As far as code examples go, Peter provided a breakdown in his earlier reply
and once again, I'd direct you to the GotDotNet site. In this case, have a
look at
http://samples.gotdotnet.com/quickstart/aspplus/doc/webctrlauthoring.aspx
which provides an introduction to working with user controls, complete with
working examples and source code. The Quickstarts series also contains
articles for various other ASP.NET concepts which I think would be highly
beneficial to you.

Hope that helps,

Gary	




More information about the thelist mailing list