dropdownlist delimma

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that has several dropdownlists on it, and they have to be
placed in 'If Not IsPostBack Then' becasue in some cases the choice of one
effects the choices in another. The issue is that if IU allow a user to add
(via a pop-up modal form) a new item for that particular dropdwonlist, once
they save there new value and return to the form, it isn't shown. At first I
thought I could refresh the page then realized that it wouldn't refresh those
dropdownlists inside the 'If Not IsPostBack Then' area.

what can I do? Thanx.
 
If one dropdown affects another, you need to have it postback (either that or
set up a JavaScript routine to update choices from arrays based on
selections).

Move most of your code out of Page_Load() (Yeah, I know the books show you
that, but it is bad design - no time to explain this, just remember Page_Load
is for loading pages). Instead, double click on the dropdowns in Visual
Studio and add the code that changes the other dropdowns in the event created
(If you are not using Visual Studio, you will have to wire the events using
Handles in CodeBehind or declaratively in the control properties for the
dropdown).


---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
I'm not sure if this solution is for my question. I had to place the controls
inside the 'If NotIS Postback' because if you change a selection on one it
reset them all upon the return if there outside of it. I'm using VS but hand
code the onclick events. That is used to populate the other dropdownlist
based on users selection. I'm using on page load because a few of the lists
need prepopulated values, some wait for those choices to be made so I put in
'(please select)'.

The issue is that i would want to refresh that particular control based on
which modal form was opened. If I come back, and the code was outside on
'IfNOt Post Back' then they all reset????

Maybe I'm missing something?

I was thinking, hard today though, butthis might be a path. I current load
the modal form in this manner:
btnaddconcord.Attributes.Add("onclick",
"window.showModalDialog('../mgmt/contact.aspx', 'Dialog Arguments
Value','dialogWidth: 490px; help:0; resizable:no; center:yes; edge:sunken;
status:no')")

Is is possible to open it the same way from within a Sub? If that was the
case then I could at least clear the list back to '(please select)' so when
they came back they
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top