Sorry for the wordy title, but it seemed the best way to describe the issue.
Basically, we have a WebDropDown inside an update panel, whose current value we want to change depending on what WebTab is loaded. We've tried handling the WebTab SelectedIndexChanged event to modify this value, but the update panel doesn't get an Async postback triggered. This is after adding the WebTab as an async postback trigger inside the UpdatePanel too.
I finally got it to work by calling __doPostBack via clicking a button on the ClientEvents-SelectedIndexChanged event, but now I'm presented with this error everytime I change a tab:
Error: Sys.ArgumentUndefinedException: Value cannot be undefined.Parameter name: type
Any ideas as to what is causing this issue?
Just in case anyone else is struggling with a similar issue, it appears to be a problem with WHEN you call the javascript function. Moving it from the client side SelectedIndexLoaded to client side AJAXResponse runs it properly (albeit slowly). Just testing now to see what the best client side event is to trigger the function
To help further, we have the following update panel:
<asp:UpdatePanel ID="updatepanel1" runat="server"> <ContentTemplate> <div id="AsAtCtlContainer"> <jims:AsAt runat="server" ID="AsAtCtl" ExportClientClick = "exportClick();"/><br /><br /> </div> <button onclick="BLOCKED SCRIPT__doPostBack('masterContentBody_updatepanel1', '');" runat="server" id="button1"></button> </ContentTemplate> </asp:UpdatePanel>
The 'AsAtCtl' contains a webdropdown that we access through a property to change it. By manually clicking the button, everything works as we want, only the updatepanel is updated, and the date is changed correctly.
However, if we have ClientEvents-SelectedIndexChanged="doPostBack" in the WebTab, and the following BLOCKED SCRIPT
<script type="text/javascript"> function doPostBack() { document.getElementById("<%:button1.ClientID%>").click(); } </script>
We get the error. This seems to only happen when EnableLoadOnDemand is set to true as well.
Hope that helps!
Hi again,
Thanks for the example file. However, the WebTab has AutoPostBackFlags set to on, as opposed to Async. Setting it to Async stops it from working. I suspect this is because the updatepanel requires a proper post back to be triggered?
This is why we used JS in our scenario, to trigger an Async postback on the client event SelectedIndexChanged, but this is the point where we run into errors. Looking online suggests we might have incorrexy AJAX assemblies, but all looks in place from what I can see
Hello Alex,
Thank you for posting in our community.
I followed the described scenario but I was unable to reproduce the behavior that you are describing. I am attaching the sample project I used to test this. Could you please try running it on your side; whether or not it works correctly may help indicate the nature of this issue.
If this sample is not an accurate demonstration of what you are trying to achieve please feel free to modify it and send it back to me in order to reproduce the issue.
Please let me know if you have any additional questions regarding this matter.