仅当URL中的IP而非计算机名称时,才会触发按钮单击

时间:2017-04-20 17:34:41

标签: c# asp.net webforms

我有一个asp.net webform。当我使用计算机名称浏览到URL时:http://somecomputer/mypage.aspx按钮单击事件不会触发。其他事件确实选择了索引更改或文本更改但按钮单击没有。

如果我按IP导航到该页面,即:http://192.168.100.1/mypage.aspx,则按钮点击会触发,一切都按预期工作。为什么这样,我该如何解决?

这里是按钮点击html:

<div class="li_div">
<asp:Button ID="btnInventoryRpt" runat="server" 
Text="Load Report" OnClick="btnInventoryRpt_Click" CausesValidation="false" UseSubmitBehavior="False"  />
 </div>

这是背后的代码:

protected void btnInventoryRpt_Click(object sender, EventArgs e)
    {
        load_inventory_report();
    }

0 个答案:

没有答案