Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > WebControls in Runtime

Reply
Thread Tools

WebControls in Runtime

 
 
PauloFor
Guest
Posts: n/a
 
      07-10-2003
Please,

In my webform I use this for include control : ( design time )

<%@ Register TagPrefix="inc" TagName="public" Src="public.ascx" %>

But Can I define control in runtime ? How ?

Thanks.


 
Reply With Quote
 
 
 
 
Victor Garcia Aprea [MVP]
Guest
Posts: n/a
 
      07-12-2003
Hi Paulo,

Take a look at the LoadControl method.

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
http://obies.com/vga/blog.aspx
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
and not by private mail.

"PauloFor" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Please,
>
> In my webform I use this for include control : ( design time )
>
> <%@ Register TagPrefix="inc" TagName="public" Src="public.ascx" %>
>
> But Can I define control in runtime ? How ?
>
> Thanks.
>
>



 
Reply With Quote
 
 
 
 
Jenny
Guest
Posts: n/a
 
      07-31-2003
Hi, Victor:

In test.aspx page, I have:
<%@ Reference Control="./user_control/e_multi_choice.ascx" %>

In test.aspx.vb page, I have:

Dim mcFab As e_multi_choice =
CType(LoadControl("./user_control/e_multi_choice.ascx"), e_multi_choice)

CType(mcFab, e_multi_choice).Table = "Table1"

CType(mcFab, e_multi_choice).Caption = "Table 1 Title"

If I put this piece of code in Page_load event, it works fine. However,
if I put it under a Button_Click event, the property value doesn't get
passed.

Please advise. Thank you very much.

Jenny









*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Runtime.exec(String[]) Doesn't Always Work, bBut Runtime.exec(String) Does Hal Vaughan Java 11 05-22-2006 04:49 PM
Object reference not set to an instance of an object. System.Web.UI.WebControls.ListItemCollection.SaveViewState() System.Web.UI.WebControls.ListControl.SaveViewState() Brano ASP .Net 3 11-08-2005 12:29 PM
Generating webcontrols in runtime Annick Van Hoof ASP .Net Web Controls 2 02-17-2004 12:26 AM
Re: WebControls Button Rhys Gravell ASP .Net 0 06-25-2003 02:38 PM
WebControls Button Leif ASP .Net 0 06-25-2003 01:10 PM



Advertisments