Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebForm_DoPostBackWithOptions is not defined using chrome

Tags:

On one of my pages, my dynamic links work fine in IE10 but do not work in either Chrome or via Explorer on my Windows phone. In Chrome I get the "WebForm_DoPostBackWithOptions is not defined" when I try to click on any of the dynamic links. I've done a lot of research, and have tried to modify the settings for the ISAPI filters in the Handler Mappings in IIS 8, but that didn't work. Please help. I'm stumped.

Update: This also does not work in Firefox. It seems the dynamic links on this page work only in IE10. The links are being generated from my codebehind. The strange this is that on the other pages the links are generated differently with the javascript on the href being different, yet I'm creating the anchors in the codebehind exactly the same way.

Here's code for a "bad" anchor:

    Dim anchName As New HtmlAnchor anchName.ID = "bcrasodiuhf" & foo AddHandler anchName.ServerClick, AddressOf HandleNameClick anchName.Attributes.Add("style", "font-weight: bold; font-size: 14px;") anchName.Attributes.Add("for", foo) anchName.InnerText = foo 

And the "bad" result:

<a id="MainContent_bcrasodiuhf1" **href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBac…0$MainContent$bcrasodiuhf1", "", true, "", "", false, true))**" for="1" style="font-weight: bold; font-size: 14px;"></a> 

Here is a "working" anchor:

    Dim ancJoe As New HtmlAnchor     ancJoe.ID = "pjancJoe" & foo     AddHandler ancJoe.ServerClick, AddressOf HandleJoeClick     ancJoe.InnerText = joe.Title     ancJoe.Attributes.Add("style", "font-size: 150%;")     ancJoe.Attributes.Add("jn", foo)     ancJoe.Attributes.Add("for", foo)     ancJoe.Attributes.Add("action", "actionA")   

And the "working" result:

<a id="MainContent_pcancJoe19416" **href="javascript:__doPostBack('ctl00$MainContent$pcancJoe19416','')"** action="actionA" for="194" jn="foo foo" forc="16" style="font-size: 150%;"></a> 
like image 886
brad Avatar asked Apr 20 '14 16:04

brad


1 Answers

The respective JS code (i.e. WebForm_DoPostBackWithOptions(options)) is a built-in part and is linked dynamically. A proper URL is being generated by ScriptManager of the page.

Considering you've mentioned you're using URL Rewrite, try checking whether URLs like WebResource.axd?d=XXX are not being ignored/re-wrote.

Also, it might worth to look at IIS Handlers Mapping configuration to ensure .axd resources are mapped to the standard ISAPI module handler.

like image 156
user2772146 Avatar answered Sep 19 '22 06:09

user2772146