Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Loading a User Control on an ASPX

Reply
Thread Tools

Loading a User Control on an ASPX

 
 
=?Utf-8?B?Qw==?=
Guest
Posts: n/a
 
      11-08-2006
Hi,

I have an ASP.NET Page.

My page has a user control which is added to a panel programmatically.

My user control has a series of dropdowns.

When the user selects some values and clicks on submit when the postback
happens I need to reload the ascx each time. This is fine.

However as I reload it the dropdowns on the ascx are repopulated as I call
some methods in the Page_Load of my ascx in order to fill the dropdowns.

As a result the selected values are lost.

Anyne know how I can overcome this problem?

Thanks in Advance.
 
Reply With Quote
 
 
 
 
David Longnecker
Guest
Posts: n/a
 
      11-08-2006
Try encompassing your logic in Page_Load with

if(! IsPostBack)
{
<code>
}

-dl

---
David Longnecker
Web Developer
http://blog.tiredstudent.com

> Hi,
>
> I have an ASP.NET Page.
>
> My page has a user control which is added to a panel programmatically.
>
> My user control has a series of dropdowns.
>
> When the user selects some values and clicks on submit when the
> postback happens I need to reload the ascx each time. This is fine.
>
> However as I reload it the dropdowns on the ascx are repopulated as I
> call some methods in the Page_Load of my ascx in order to fill the
> dropdowns.
>
> As a result the selected values are lost.
>
> Anyne know how I can overcome this problem?
>
> Thanks in Advance.
>



 
Reply With Quote
 
 
 
 
bruce barker \(sqlwork.com\)
Guest
Posts: n/a
 
      11-08-2006
move the init logic to oninit.

-- bruce (sqlwork.com)

"C" <> wrote in message
news:6D037EA6-ED80-423E-B562-...
> Hi,
>
> I have an ASP.NET Page.
>
> My page has a user control which is added to a panel programmatically.
>
> My user control has a series of dropdowns.
>
> When the user selects some values and clicks on submit when the postback
> happens I need to reload the ascx each time. This is fine.
>
> However as I reload it the dropdowns on the ascx are repopulated as I call
> some methods in the Page_Load of my ascx in order to fill the dropdowns.
>
> As a result the selected values are lost.
>
> Anyne know how I can overcome this problem?
>
> Thanks in Advance.



 
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
User Control to Control Other User Control Jonathan Wood ASP .Net 4 02-02-2010 03:41 PM
persisting changes to a control outside a user control from the user control? Mad Scientist Jr ASP .Net 0 03-22-2006 08:02 AM
Loading user control when a link is clicked on another user contro =?Utf-8?B?U3JpZGhhcg==?= ASP .Net 1 11-18-2005 03:00 AM
Loading an aspx page in a fram from another aspx page =?Utf-8?B?Uk1M?= ASP .Net 1 09-16-2005 01:21 PM
adding main.aspx.vb & main.aspx.resx under aspx John M ASP .Net 1 05-29-2005 09:27 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57