Search code examples
c#asp.netasp.net-ajaxupdatepanel

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.


Solution

  • 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