Problems with dynamic LoadControl
- From: "Andreas" <an-baumgaertel@xxxxxxxxxxx>
- Date: 4 Mar 2006 15:31:11 -0800
Hello,
I have the following problem:
I want to add to my site (test.aspx) one (1) UserControl
(customer.ascx) several times - dynamically with a placeholder. As well
I want to hand off different variables (i.e. Session variable) to the
UserControl.
Example:
Test.aspx:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Session("CustomerLetter") = "A"
plcHldTest.Controls.Add(LoadControl("customer.ascx"))
Session("CustomerLetter") = "B"
plcHldTest.Controls.Add(LoadControl("customer.ascx"))
Session("CustomerLetter") = "F"
plcHldTest.Controls.Add(LoadControl("customer.ascx"))
End Sub
customer.ascx:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
przGetCustomer(Session("CustomerLetter"))
get the customer in a Datalist
End Sub
Now the problem:
If I call test.aspx I get in the UserControl (customer.ascx) 3 times
the customer with the letter "F", and not one with "A", one with "B"
and one with "F".
What do I wrong and what can I do?
Thank you for your help.
Andreas
P.S. I try to hand of the variable with Property (Get, Set), but it
doesn't work also.
.
- Prev by Date: Re: how can i deploy a single aspx page globally for all sites in IIS?
- Next by Date: Re: Mail sent through IIS virtual SMTP server not arriving
- Previous by thread: RadioButtonListControl
- Next by thread: Re: Problems with dynamic LoadControl
- Index(es):