Showing posts with label updated. Show all posts
Showing posts with label updated. Show all posts

Monday, March 26, 2012

ListBox not raising event or makes full postBack

I have a ListBox that needs to be updated depending on selections made on another ListBox. The problem I have is that theSelectedIndexChanged event is not raised. If I put AutoPostback="True" (which worked in my little test app that I created first), it performs a full PostBack.

Has anybody experienced something like this? Any ideas a more than welcome.

Hi,

Have you add the eventhandler to your listbox?
<asp:ListBoxID="ListBox1"runat="server"OnSelectedIndexChanged="ListBox1_SelectedIndexChanged">


Sure I did. And have something in the handler just to make sure the second ListBox is updated.


Does a single update panel contains both the listbox. If the parent listbox is outside the update panel then create a AsyncPostbackTrigger and assign that listbox as control.


Of course I added Triggers. These are basic things I need to do to get the AJAX part working.

Still can't figure out what is wrong.

Wednesday, March 21, 2012

Loading scripts with ScriptMangerProxy not finding page controls since update to RC1

I have recently updated my AJAX to RC1 and some pages that load js in the scriptmanagerproxy have stopped working...
The problem is that when i try to get a text box it doesnt exist...

$get("txtFirstLine").value

...this is not in a function its just in the file but the object is not found.
It will work i wrap it in a function and call that function at the end of my aspx markup

<scriptlanguage="javascript"type="text/javascript">firstfunction();</script>

...its like the js is now all executed before the aspx page and controls on it are created.

Is this is the case?
Is there an event in the AJAX library that i can use to run this script once the page has been created?

Thx
Steve

You can take a look at theSys.Application.init andSys.Application.load events in the doc.