Click here to Skip to main content
14,926,224 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Please help me ModalpopupExtender on Button click event is not Trigger?
Posted
Comments
Sumit_Kumar_Sinha 14-Mar-13 7:11am
   
can u post ur script....................
Lakshmimsridhar 14-Mar-13 7:19am
   
<asp:Panel ID="PnlDomain" runat="server" CssClass="modalpopuppanel">
<table font-family: 'Times New Roman'; font-size: medium;">
<tr>
<td style="padding:10px;" "spacing:10px;" class="style33" align="left" >
Category</td>
<td class="style5">
<asp:TextBox ID="TxtCategory" runat="server">
</td>
<td>
 </td>
</tr>
<tr>
<td class="style33">
 </td>
<td class="style5">
<asp:Button ID="BtnSaveCategory" runat="server" Text="Save"
onclick="BtnSaveCategory_Click" Width="66px" />
<%-- <asp:Button ID="BtnSaveCategory" runat="server" Text="Save"
onclick="BtnSaveCategory_Click" />--%>
        
<asp:Button ID="BtnCloseCategory" runat="server" Text="Close" />
</td>
<td>
 </td>
</tr>
<tr>
<td class="style33">
 </td>
<td class="style5">
 </td>
<td>
 </td>
</tr>
<tr>
<td class="style25" colspan="3">
<asp:GridView ID="GrdCategory" runat="server" AutoGenerateColumns="False"
CellPadding="4" ForeColor="#333333" GridLines="None" Width="100%"
AllowPaging="True" PageSize="5">
<alternatingrowstyle backcolor="White">
<columns>
<asp:BoundField DataField="Cid" HeaderText="Id" Visible="False" />
<asp:BoundField DataField="Category" HeaderText="Category" />
<asp:TemplateField HeaderText="Edit">
<itemtemplate>
<asp:LinkButton ID="LnkCategoryEdit" runat="server"
CommandArgument='<%# Eval("Cid") %>' onclick="LnkCategoryEdit_Click" >Edit


<asp:TemplateField HeaderText="Delete">
<itemtemplate>
<asp:LinkButton ID="LnkCategoryDelete" runat="server"
CommandArgument='<%# Eval("Cid") %>'>Delete



<editrowstyle backcolor="#2461BF">
<footerstyle backcolor="#507CD1" font-bold="True" forecolor="White">
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<rowstyle backcolor="#EFF3FB">
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<sortedascendingcellstyle backcolor="#F5F7FB">
<sortedascendingheaderstyle backcolor="#6D95E1">
<sorteddescendingcellstyle backcolor="#E9EBEF">
<sorteddescendingheaderstyle backcolor="#4870BE">

</td>
</tr>
</table>



</form>
Lakshmimsridhar 14-Mar-13 7:14am
   
<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/AdminMaster.master" AutoEventWireup="true" CodeFile="adminAddProduct.aspx.cs" Inherits="Admin_adminAddProduct" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<form id="form1" runat="server">
<style type="text/css">
.modalpop
{
background-color:Gray;
border:2px solid green;
opacity:1.0;
}
.modalpopuppanel
{
background-color:Silver;
border:2px dotted red;
}
.modalBackground {
background-color:Gray;
filter:alpha(opacity=70);
opacity:0.3;
}
.style5
{
width: 276px;
}
.style25
{
}
.style33
{
width: 86px;
}
</style>
<cc1:ToolkitScriptManager ID="ToolkitScriptManager2" runat="server">




<asp:UpdatePanel ID="UpdatePanel1" runat="server">

<contenttemplate>

Add Product Details



<table style="width: 100%">
<tr>
<td>
Category :</td>

<td>
<asp:DropDownList ID="ddlcategory" runat="server" Height="16px" Width="159px">

<asp:Button ID="Button1" runat="server" Text="Manage" />
<cc1:ModalPopupExtender ID="ModalPopupCategory" TargetControlID="Button1" PopupControlID="PnlDomain" BackgroundCssClass="modalBackground" runat="server">


</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="ddlcategory" ErrorMessage="Please select Category"
ValidationGroup="vg">

</td>
</tr>
<tr>
<td>
Subcategory :</td>
<td>
<asp:DropDownList ID="ddlsubcategory" runat="server" Height="16px"
Width="159px">

<asp:Button ID="Button2" runat="server" Text="Manage" />
<cc1:ModalPopupExtender ID="ModalPopupSubCategory" runat="server" TargetControlID="Button2" PopupControlID="PnlDomain" BackgroundCssClass="modalBackground">

</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="ddlsubcategory" ErrorMessage="Please Select Subcategory"
ValidationGroup="vg">
</td>
</tr>
<tr>
<td>
Image :</td>
<td>
<asp:FileUpload ID="FileUpload1" runat="server" />
</td>
<td>
 </td>
</tr>
<tr>
<td>
Product Name :</td>
<td>
<asp:TextBox ID="txtproductname" runat="server">
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
ControlToValidate="txtproductname" ErrorMessage="Please Enter Product Name">
</td>
</tr>
<tr>
<td>
Description :</td>
<td>
<asp:TextBox ID="txtdescription" runat="server" Height="58px" TextMode="MultiLine"
Width="212px">
</td>
<td>

1 solution

   
Comments
AbidHussain128 14-Mar-13 7:39am
   
Add Button's javascript method. OnClientclick='javascript:return false'

Your page is Postback and opened modal pop will again hide.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month



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