在对话框不HANDELING click事件ASP按钮 [英] asp button in dialog not handeling click event
问题描述
VB:
Protected Sub edit_content_Click(sender As Object, e As System.EventArgs) Handles edit_content.Click
MsgBox("dasfaf")
End Sub
ASP:
<asp:TemplateField HeaderText="Edit">
<ItemTemplate>
<asp:LinkButton ID="LinkButton3" runat="server">LinkButton</asp:LinkButton>
<a href="#" class="table-actions-button ic-table-edit" id="create-user"></a>
</ItemTemplate>
</asp:TemplateField>
<div id="dialog-form" title="Edit Content" style="width:1001px;">
<div>
<asp:Button ID="edit_content" runat="server" Text="Edit Content" class="buttons" />
</div>
</div>
jQuery的:
jquery:
$("#create-user").button().click(function () {
$("#dialog-form").dialog("open");
});
我的问题是,我把一个asp按钮jQuery的形式单击按钮时要阿贝尔做一些code在VB ......但问题是,当我点击按钮,它不会去点击事件......如果我把按钮外的对话框一切正常...但我需要它的对话框中...
my problem is that i'm putting an asp button in the jquery form to be abel to do some code in vb when the button is clicked... but the problem is that when i click on the button it does not go to the click event... if i put the button outside the dialog everything works... but i need it in the dialog ...
所以,我怎么能够管理呢?
so how can i manage that?
有什么建议?
推荐答案
看起来是一个问题。
有是这个虽然解决方法。
There is a workaround for this though.
添加以下Javscript code到页面/控制。
Add the following Javscript code to the page/control.
function Test2() {
<%=Page.ClientScript.GetPostBackEventReference(edit_content, "")%>
}
和在HTML中添加JavaScript调用: -
And in your html add the javascript call:-
<asp:Button ID="edit_content" runat="server" OnClientClick="return Test2();" Text="Edit Content" class="buttons" />
它应该工作。
这篇关于在对话框不HANDELING click事件ASP按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!