LinkBut​​ton的不触发生产服务器上 [英] LinkButton not firing on production server

查看:124
本文介绍了LinkBut​​ton的不触发生产服务器上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个很好的候选人,作品在我的机器认证计划

This is a good candidate for the "Works on My Machine Certification Program".

我有以下的code为一个LinkBut​​ton ...

I have the following code for a LinkButton...

<cc1:PopupDialog ID="pdFamilyPrompt" runat="server" CloseLink="false" Display="true">
  <p>Do you wish to upgrade?</p>
  <asp:HyperLink ID="hlYes" runat="server" Text="Yes" CssClass="button"></asp:HyperLink>
  <asp:LinkButton ID="lnkbtnNo" runat="server" Text="No" CssClass="button"></asp:LinkButton>
</cc1:PopupDialog>

它使用一个自定义的控件,只是增加了code前后内容格式化为一个弹出式对话框后。在按钮是超链接,因为它执行JavaScript来隐藏对话框并显示一个不同的。在按钮是一个LinkBut​​ton,因为它需要回发来处理这个值。

It uses a custom control that simply adds code before and after the content to format it as a popup dialog. The Yes button is a HyperLink because it executes javascript to hide the dialog and show a different one. The No button is a LinkButton because it needs to PostBack to process this value.

我没有与LinkBut​​ton的注册onClick事件,因为我只是检查的IsPostBack是真实的。当本地执行,回发工作正常,一切顺利。当发布到我们的开发服务器上,当点击了按钮什么都不做。我对发展本地服务器上测试时使用相同的浏览器。

I do not have an onClick event registered with the LinkButton because I simply check if IsPostBack is true. When executed locally, the PostBack works fine and all goes well. When published to our Development server, the No button does nothing when clicked on. I am using the same browser when testing locally versus on the development server.

我最初的想法是,也许是一个Validator是$ P $烧制而成pventing回发。我使用了几个校验器对页面的另一部分,但它们都分配给了 LinkBut​​ton的未分配到一个特定的验证组。但问题是,为什么会在本地没有工作的开发服务器上。

My initial thought is that perhaps a Validator is preventing the PostBack from firing. I do use a couple of Validators on another section of the page, but they are all assigned to a specific Validation Group which the No LinkButton is not assigned to. However the problem is why it would work locally on not on the development server.

任何想法?

推荐答案

检查是否在生产中排放的HTML,并确保它具有__doPostBack()和不存在全局方法看点击取消该事件。除此之外,如果你认为它可能以验证您可以尝试添加的CausesValidation或任何为false,并看看是否有帮助有关。否则,一个我的机器上的作品错误是一种难以调试而不present,知道DEV的配置VS PROD。

Check the html that is emitted on production and make sure that it has the __doPostback() and that there are no global methods watching click and canceling the event. Other than that if you think it could be related to validation you could try adding CausesValidation or whatever to false and see if that helps. Otherwise a "works on my machine" error is kind of hard to debug without being present and knowing the configurations of DEV vs PROD.

这篇关于LinkBut​​ton的不触发生产服务器上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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