Ask a Question related to ASP.NET Building Controls, Design and Development.
-
William #1
Changing UserControls Dynamically
I have 2 user controls and I would like to display 1 of them depending on a
session variable. I have trie a place holder, but it doesnt seem to work.
ie..
Select Case Session("Variable")
Case "1"
PlaceHolder1.Controls.Add(New MyControl1)
Case "2"
PlaceHolder1.Controls.Add(New MyControl2)
End Select
this code does not seem to do anything. How can I acheive this behavior?
William Guest
-
Dynamically changing chart labels
HI I'm after an how too really, point me in the right direction is possible. I have a new dashboard app, monitoring a server, last part is load... -
Dynamically loading and adding usercontrols after CreateChildControls
Hi, I'm having a problem with loading and adding usercontrols dynamically after CreateChildControls. To be more specific, I have a number of... -
Changing Text Dynamically
Hello, I would like to know if the text displayed on a webpage changes dynamically.I have 2 drop down menus and based on the options chosen I... -
Events not firing on dynamically added UserControls
I am trying to dynamically add a user control to a Custom Control that inherits a Panel. The control renders fine on the web form. The problem is... -
Changing module dynamically
Thomas M. Widmann sikyal: I'm not sure how much control you have over the architecture of the whole thing, but this is how I would implement... -
Victor Garcia Aprea [MVP] #2
Re: Changing UserControls Dynamically
Hi William,
You need to call the LoadControl method to get an instance of an UserControl
and not the new operator.
--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
[url]http://obies.com/vga/blog.aspx[/url]
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
"William" <wreyes@optonline.net> wrote in message
news:OLBd4lu5DHA.2404@TK2MSFTNGP12.phx.gbl...a> I have 2 user controls and I would like to display 1 of them depending on> session variable. I have trie a place holder, but it doesnt seem to work.
>
> ie..
> Select Case Session("Variable")
> Case "1"
> PlaceHolder1.Controls.Add(New MyControl1)
> Case "2"
> PlaceHolder1.Controls.Add(New MyControl2)
> End Select
>
> this code does not seem to do anything. How can I acheive this behavior?
>
>
Victor Garcia Aprea [MVP] Guest



Reply With Quote

