Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update Panel throws javascript error: "Microsoft JScript runtime error: Member not found"

I'm using a dropdown with autopostback enabled. When I change the value on the updatepanel it throws and javascript error Microsoft JScript runtime error: Member not found. I'm using a master page.

Error Location:

Error is occuring at "theForm.submit();"

<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['ctl01'];
if (!theForm) {
    theForm = document.ctl01;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>
</script>

Asp.Net/HTML:

    <asp:ScriptManager ID="manager" runat="server" ></asp:ScriptManager>
    <asp:UpdatePanel ID="platformOutputTypes" runat="server" UpdateMode="Always" >
        <ContentTemplate >
            <p>
                <label>Platform</label>
                <asp:DropDownList ID="platform" AutoPostBack="true" runat="server" onselectedindexchanged="PlatformSelectedIndexChanged" ></asp:DropDownList>
            </p>

            <asp:CheckBoxList TextAlign="Left" ID="reportOutputTypes" runat="server" />
        </ContentTemplate>
   </asp:UpdatePanel>

I'm also using jQuery on the page.

like image 813
Chuck Conway Avatar asked Jun 06 '26 21:06

Chuck Conway


2 Answers

Found this link which worked for me...

http://www.velocityreviews.com/forums/t110670-__dopostback-fails-on-web-form-submit-net-2-0-a.html

kind of simple solution. Basically, in my case, checked the content page and master page for "name" attribute of "submit", found one with a simple html button, changed the name and voila...worked

HTH

Dave

like image 123
Dave Avatar answered Jun 08 '26 12:06

Dave


When I used input type="submit" ...> where the ID was set to "submit" I would normally never give a submit button the ID of "submit", but must have done so in haste. When I gave the submit button an ID of "Search" the problem went away.

like image 32
Gues Avatar answered Jun 08 '26 12:06

Gues



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!