Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
XML
<div id="popupdiv" runat="server" style="display: none" >

                          <table>
                              <tr>
                                  <td><span class="txt">Username: </span><span class="redstar">*</span></td>
                                  <td>
                                      <asp:TextBox ID="txtUserName" runat="server" placeholder=" UserName"
                                          Width="186px"></asp:TextBox>
                                      <asp:RequiredFieldValidator ID="rfvUserName" runat="server"
                                          ErrorMessage="Please enter  User Name" ControlToValidate="txtUserName" ValidationGroup="Login"
                                          Display="Dynamic" ForeColor="Red"></asp:RequiredFieldValidator>
                                  </td>
                              </tr>
                              <tr>
                                  <td><span class="txt">Password: <span class="redstar">*</span> &nbsp;&nbsp;</span></td>
                                  <td>
                                      <asp:TextBox ID="txtPwd" runat="server" TextMode="Password" placeholder=" Password" Width="186px"></asp:TextBox>
                                      <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                                          ControlToValidate="txtPwd" Display="Dynamic" ValidationGroup="Login"
                                          ErrorMessage="Please enter Password" ForeColor="Red" SetFocusOnError="True"></asp:RequiredFieldValidator>
                                  </td>
                              </tr>
                              <tr>
                                  <td></td>
                                  <td>
                                      <asp:Button ID="btnSubmit" ValidationGroup="Login" runat="server" Text="Login" OnClick="btnSubmit_Click"/>
                                      <asp:Button ID="btnclose"  runat="server" Text="Cancel" CausesValidation="false" style="height: 26px" /></td>
                              </tr>

                              <tr>
                                  <td>&nbsp;</td>
                                  <td>&nbsp;</td>
                              </tr>

                          </table>
                    </div>
Posted
Comments
Naveen.Sanagasetti 29-Sep-15 10:02am    
Have you tried to keep the popup in outside the div.?

As of my knowledge there is no relation using div and button click event.

May be because of some other issue, it might be fail..
shanmugaprabu198512 30-Sep-15 0:25am    
yes, but my issue is popup window having login and cancel button. both are not working.if i click button or link popoup is opening but if i click any button in popup like login or cancel which is not working
[no name] 29-Sep-15 14:10pm    
Firstly make sure that you are providing value to textboxes because you are using ASP validation controls.

Secondly you are also using ValidationGroup as "Login", make sure other validation controls not refer except the popup div form.
shanmugaprabu198512 30-Sep-15 0:22am    
i have two buttons in popup. such as login and close. i have commented the validation controls. now close button is also not working.and if i give value to the textbox like this( document.getElementById('popupdiv').Value;) it is showing error. kindly help.
[no name] 30-Sep-15 0:52am    
Question: How you are closing the popup window by clicking Cancel button. If you are using javascript, just cross check code or provide it.

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