updatepanel用户控件弹出+按钮单击事件未触发 [英] updatepanel usercontrol in popup+button click event not firing

查看:81
本文介绍了updatepanel用户控件弹出+按钮单击事件未触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个名为petusercontrol的usercontrol。我将更新面板内的用户控件调用到弹出窗口。但是当我点击用户控件中的提交按钮时,事件不会被触发...





I am having a usercontrol named "petusercontrol" . and i called the user control inside a updatepanel to a popup window. but when i click on submit button which is in the user control, event not firing...


<asp:UpdatePanel ID="upnlMain" runat="server" UpdateMode="Conditional">


        <asp:Label ID="lblMsg" runat="server">
        <br />

        <asp:HiddenField ID="hdnID" runat="server" />
        <table class="valignmiddle">
            <tbody>
                <tr>
                    <td class="label-cell">
                        <label>Pet Name*</label></td>
                    <td>
                        <asp:TextBox ID="txtPetName" runat="server">

                    </td>
                    <td class="label-cell"></td>
                    <td class="label-cell">
                        <label>Owner</label></td>
                    <td>
                        <asp:DropDownList ID="ddlOwner" runat="server">
                    </td>
                </tr>

                <tr>
                    <td class="label-cell">
                        <label>Type of Pet</label>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlPetType" runat="server">
                    </td>
                    <td class="label-cell"></td>
                    <td class="label-cell">
                        <label>Breed</label>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlBreed" runat="server">
                    </td>
                </tr>
                <tr>
                    <td class="label-cell">
                        <label>Weight*</label></td>
                    <td>
                        <asp:TextBox ID="txtWeight" runat="server">


                    </td>
                    <td class="label-cell"></td>
                    <td class="label-cell">
                        <label>Age*</label></td>
                    <td>
                        <asp:TextBox ID="txtdob" runat="server">

                    </td>
                </tr>
                <tr>
                    <td class="label-cell">
                        <label>Gender</label></td>
                    <td>
                        <asp:DropDownList ID="ddlGender" runat="server">

                    </td>
                    <td class="label-cell">
                    <td class="label-cell">
                        <label>Active</label></td>
                    <td>
                        <asp:CheckBox ID="chkActive" runat="server">
                    </td>
                </tr>
            </tbody>

        </table>
        <br />

        <table class="valignmiddle">
            <tbody>
                <tr>
                    <td class="label-cell">
                        <label>Is your pet allergic to any medications?</label></td>
                    <td>

                        <asp:RadioButtonList ID="rdIsYourPetAllergic" runat="server" AutoPostBack="true" OnSelectedIndexChanged="rdIsYourPetAllergic_SelectedIndexChanged">
                            <asp:ListItem>No
                            <asp:ListItem>Yes

                    </td>
                </tr>

            </tbody>
        </table>
        <br />

        <table class="valignmiddle" id="PetAllergic"  runat="server">
            <tbody>
                <tr>
                    <td class="label-cell">
                        <label>Please Select All

推荐答案







设置按钮的validationgroup属性。在用户控件中,如果页面中的任何其他控件都有验证,则按钮不会触发。尝试设置按钮validationgroup属性。
Hi,


Set a validationgroup property for the button. As its in user control, if any of the other control in the page have validation the button doesnt fire. Try setting the button validationgroup property.


这篇关于updatepanel用户控件弹出+按钮单击事件未触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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