Click here to Skip to main content
15,885,914 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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...


C#
<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
Posted
Updated 4-Dec-13 3:36am
v2
Comments
agent_kruger 27-Nov-13 6:17am    
please explain a little bit more about what you want to achieve?
prthghosh999 27-Nov-13 7:25am    
actually i have to open a pop up window inside an update panel. and my popup content will come from user control. when i click on 'show popup' button, my pop is open but when i fill all contents and submit the form , the click event doesn't fired. my submit button is in the same user control...
Nooa 27-Nov-13 8:10am    
could you show the updatepanel-code? maybe there we can find the reason
prthghosh999 27-Nov-13 9:24am    
i put my updatepanel-code which is in my PetUserControl....

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

<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
BulletVictim 28-Nov-13 1:50am    
Could you also post your c# code when you want update?

1 solution

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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900