Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I've Got a Programming Problem That's Driving Me Nuts
I've Got a Programming Problem That's Driving Me Nuts
#1
ASP.NET web page, C# codebehind, Jquery and Javascript in use.
I've added an ASP dropdownlist to a div that Jquery turns into a pop-up dialog.  I want to read the selectedvalue for the drop down, but regardless of what I select and where I try to read it, it's always "0".
Autowireup is on, the drop down's EnableViewState is true (and the page's settings are compatible with it).  Its contents are set with a mix of explicit listitem adds plus a databind, which happens on pageload, and only if not a postback.
Although the ASP.NET documentation says that its OnSelectedIndexChanged event should fire regardless of whether AutoPostback is true or not; if it's false, the event fires when something else returns control to the server side.  Which is good, because I can't have it autopostback without breaking something else on the page.  But I've never gotten it to fire at all, even when I let the stuff that would get broken break. 
Everything I try -- Jquery, plain Javascript, codebehind -- all I ever see is "0".  Even if I try to capture it on the client side in an OnClientClick event.
Does this sound familiar to anyone?  If so, got a solution?
Thanks.
-- Bob
---------
Then the horns kicked in...
...and my shoes began to squeak.
Reply
 
#2
Never mind, I think I figured it out. At least, I have it working. I think that once JQuery turns the div into a dialog, the state of the dropdown isn't persistent, so if I try to read it after the dialog closes, I just get its initial settings. The answer was to read it before the dialog closed and shove the value into a hidden field to retrieve later in the codebehind.

Anyone wracking their brains over this for me, thank you for your effort, even if it didn't help me. Yet.
-- Bob
---------
Then the horns kicked in...
...and my shoes began to squeak.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)