WebForm_DoPostBackWithOptions不使用铬定义 [英] WebForm_DoPostBackWithOptions is not defined using chrome

查看:224
本文介绍了WebForm_DoPostBackWithOptions不使用铬定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的网页我的动态链接做工精细的IE10,但在这两种浏览器或浏览器通过我的Windows电话上不工作之一。在Chrome中我得到了WebForm_DoPostBackWithOptions没有定义当我尝试点击任何动态链接。我已经做了很多的研究,并试图修改在处理程序映射在IIS 8 ISAPI筛选器的设置,但没有奏效。请帮忙。我难倒。

更新:这也不会工作在Firefox。这似乎只在IE10此页工作动态链接。该链接是从我的codebehind产生。奇怪这是在其他页面的链接与的href是不同的JavaScript生成的​​方式不同,但我创建了codebehind锚完全相同的方式。

这里的code为坏主播:

 昏暗anchName作为新的HtmlAnchor
anchName.ID =bcrasodiuhf与&富
AddHandler的anchName.ServerClick,AddressOf HandleNameClick
anchName.Attributes.Add(风格,字体重量:大胆; FONT-SIZE:14px的;)
anchName.Attributes.Add(为富)
anchName.InnerText = foo的

与坏的结果是:

 <一个ID =MainContent_bcrasodiuhf1** HREF =JavaScript的:WebForm_DoPostBackWithOptions(新WebForm_PostBac ... 0 $日程地址搜索Maincontent $ bcrasodiuhf1,,真实,,,假的,真正的))**为=1的风格=字体重量:大胆的;字体大小:14px的;>< / A>

这是一个工作主播:

 昏暗ancJoe作为新的HtmlAnchor
    ancJoe.ID =pjancJoe与&富
    AddHandler的ancJoe.ServerClick,AddressOf HandleJoeClick
    ancJoe.InnerText = joe.Title
    ancJoe.Attributes.Add(风格,FONT-SIZE:150%;)
    ancJoe.Attributes.Add(JN富)
    ancJoe.Attributes.Add(为富)
    ancJoe.Attributes.Add(行动,actionA)

与工作的结果:

 <一个ID =MainContent_pcancJoe19416** HREF =JavaScript的:__ doPostBack('ctl00 $日程地址搜索Maincontent $ pcancJoe19416','')**行动=actionA为= 194JN =富富FORC =16的风格=FONT-SIZE:150%;>< / A>


解决方案

各自的JS code(即WebForm_DoPostBackWithOptions(选项))是一个内置的一部分,并动态链接。是由页面的ScriptManager产生适当的URL。

考虑你提到你使用URL重写,请检查是否喜欢WebResource.axd的网址吗?D = XXX未被忽略/重新写了。

此外,可能值得看的IIS处理程序映射配置以确保个.axd资源被映射到标准ISAPI模块处理程序。

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>

解决方案

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.

这篇关于WebForm_DoPostBackWithOptions不使用铬定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆