为什么我的Buttonevent在点击后无法启动?

时间:2013-10-25 13:27:20

标签: c# asp.net events dialog modal-dialog

我的asp.net应用程序中存在一个大问题:

我的ASPX:

<asp:ToolkitScriptManager ID="manager" runat="server"></asp:ToolkitScriptManager>

...

<div id="GuestListViewAddDialog">
                    <asp:HiddenField ID="hidden_GuestListViewAddModernDialog" runat="server" />

                    <asp:ModalPopupExtender ID="pop_GuestListViewAddModernDialog" 
                                        runat="server"
                                        CancelControlID="btn_GuestListViewAddDialog_NO" 
                                        TargetControlID="hidden_GuestListViewAddModernDialog" 
                                        PopupControlID="panel_GuestListViewAddModernDialog" 
                                        PopupDragHandleControlID="popheader_GuestListViewAddDialog" 
                                        Drag="true" 
                                        BackgroundCssClass="modalBackground"></asp:ModalPopupExtender>

                    <div id="panel_GuestListViewAddModernDialog" class="popupConfirmation" runat="server" style="width:350px; height:290px;">
                        <asp:Panel runat="server" ID="popheader_GuestListViewAddDialog" CssClass="modalPopup"><br /><b id="B1" runat="server" style="color:White;">
                        <asp:Image ID="img_GuestListViewAddDialog" ImageAlign="Left" ImageUrl="~/App_Themes/Design/Images/Form/user.png" runat="server" Width="50" Height="50" />
                        <br /><asp:Label ID="lbl_GuestListViewAddDialog" runat="server" Text="Gast Hinzufügen"></asp:Label></b><br /></asp:Panel>
                        <div class="Body">
                          <hr />
                          <div class="bodycontrol">
                            <table>
                                ...
                            </table>
                           <br />
                            <table>
                        <tr>
                            <td><asp:LinkButton ID="btn_GuestListViewAddDialog_YES" runat="server" class="GuestButtons" ValidationGroup="valid" Text="Hinzufügen" onclick="btn_GuestListViewAddDialog_YES_Click" ></asp:LinkButton></td>
                            <td><asp:LinkButton ID="btn_GuestListViewAddDialog_NO" runat="server" class="GuestButtons" Text="Abbrechen" ValidationGroup="never"></asp:LinkButton></td>
                        </tr>
                    </table>
                           <br />
                            <table>
                               ....
                           </table>
                          </div>
                          <hr />
                        </div>
                    </div>          
                </div>

我想使用带有Ajax的现代Dialog。问题是,如果我点击btn_GuestListViewAddDialog_YES,事件就不会启动。 :(

这里是我的c#:

   protected void btn_GuestListViewAddDialog_YES_Click(object sender, EventArgs e)
            { //i set my breakpoint here but it don't start
if (Page.IsValid)
            {
    ...my code
}
    }

我为这个事件的开始做了一个断点,但它没有开始-.- ...我检查并将我的代码与其他现代对话框相提并论,但我不明白为什么这不起作用 - 。 -

my modern dialog

1 个答案:

答案 0 :(得分:2)

检查这个家伙的“youtube”教程“kudvenkat”。这只是我在youtube上找到的asp.net上的好教程。