Button Click event not working inside AJAX popupcontrol and UpdatePanel
-
Hi I caught in problem since 3 days. Try lot of stuff not able to solve the problem. I developed a form for inventory project - Product.aspx. It has option to add category, subcategory, company on the fly just clicking the add new button. When user press add new, pop appears to ask information and theres save button. Save button has code to save all data in database tables. But click event do not fire for all these buttons. Look at the form: http://www.artinarts.in/ecomm/admin/product.aspx. Dont know where's the problem. I read some-where remove all validators and remove un-neccessary updatepanels. I did same but no use. I also read somewhere use aync="true" in page directive. still it not work. I also read that use <triggers> in update panel still not successfull. Please guide me what to do. My Product.aspx file is as: <%@ Page Title="" Language="VB" MasterPageFile="MasterPage.master" AutoEventWireup="false" CodeFile="Product.aspx.vb" Inherits="admin_Product" Async="true" %> <%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"> <style type="text/css"> .style1 { width: 105%; } .style7 { width: 89px; } .style8 { width: 279px;height: 30px; } .style9 { width: 304px;height: 30px; } .style11 { width: 123px; } .style12 { height: 30px; } .style14 { width: 304px; } .style15 { width: 279px; } </style> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <br /> <h3 style="font-family:Verdana" id="lblNoProducts"> Add new Product</h3> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <table class="style1"> <tr> <td valign="top" class="style15"> Category</td> <td valign="top" class="style14"> <asp:DropDownList ID="lstCategory" runat="server" AutoPostBack="True"> asp:ListItemPrimary</asp:ListItem> </asp:DropDownList> </td> <td valign="top"> <asp:Button ID="Button1" runat="server" Text="New Category" Height="23px" Width="121px" UseSubmitBehavior="False" /> <cc1:PopupControlExtender ID="Button1_PopupControlExtender" runat="server" TargetControlID="Button1" PopupControlID="pnlCategory" Position ="Right" >
-
Hi I caught in problem since 3 days. Try lot of stuff not able to solve the problem. I developed a form for inventory project - Product.aspx. It has option to add category, subcategory, company on the fly just clicking the add new button. When user press add new, pop appears to ask information and theres save button. Save button has code to save all data in database tables. But click event do not fire for all these buttons. Look at the form: http://www.artinarts.in/ecomm/admin/product.aspx. Dont know where's the problem. I read some-where remove all validators and remove un-neccessary updatepanels. I did same but no use. I also read somewhere use aync="true" in page directive. still it not work. I also read that use <triggers> in update panel still not successfull. Please guide me what to do. My Product.aspx file is as: <%@ Page Title="" Language="VB" MasterPageFile="MasterPage.master" AutoEventWireup="false" CodeFile="Product.aspx.vb" Inherits="admin_Product" Async="true" %> <%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"> <style type="text/css"> .style1 { width: 105%; } .style7 { width: 89px; } .style8 { width: 279px;height: 30px; } .style9 { width: 304px;height: 30px; } .style11 { width: 123px; } .style12 { height: 30px; } .style14 { width: 304px; } .style15 { width: 279px; } </style> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <br /> <h3 style="font-family:Verdana" id="lblNoProducts"> Add new Product</h3> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <table class="style1"> <tr> <td valign="top" class="style15"> Category</td> <td valign="top" class="style14"> <asp:DropDownList ID="lstCategory" runat="server" AutoPostBack="True"> asp:ListItemPrimary</asp:ListItem> </asp:DropDownList> </td> <td valign="top"> <asp:Button ID="Button1" runat="server" Text="New Category" Height="23px" Width="121px" UseSubmitBehavior="False" /> <cc1:PopupControlExtender ID="Button1_PopupControlExtender" runat="server" TargetControlID="Button1" PopupControlID="pnlCategory" Position ="Right" >
Where you have hooked the event handlers? I can't see it on buttons markup. Also, don't dump your whole code. It makes the post unreadable. Please post only relevant part. :)
Navaneeth How to use google | Ask smart questions
-
Where you have hooked the event handlers? I can't see it on buttons markup. Also, don't dump your whole code. It makes the post unreadable. Please post only relevant part. :)
Navaneeth How to use google | Ask smart questions
Thanks for reply I have written onclick="function" but still of no use. You can view output the same at: http://www.artinarts.in/ecomm/admin/product.aspx[^] I used : asp:Button ID="Button2" runat="server" Text="Save" OnClick="Button2_Click" for all buttons but cant help. You can dowlnoad to view my code from: http://www.artinarts.in/ecomm/artinarts_ecomm.zip [^]
-
Thanks for reply I have written onclick="function" but still of no use. You can view output the same at: http://www.artinarts.in/ecomm/admin/product.aspx[^] I used : asp:Button ID="Button2" runat="server" Text="Save" OnClick="Button2_Click" for all buttons but cant help. You can dowlnoad to view my code from: http://www.artinarts.in/ecomm/artinarts_ecomm.zip [^]
Hi, this is from the tutorial site, look through the code, and adapt yours like this,
<div class="demoarea"> <div class="demoheading"> PopupControl Demonstration</div> Enter date for new reminder: <asp:TextBox ID="DateTextBox" runat="server" Width="80" autocomplete="off" /><br /> <br /> <asp:Panel ID="Panel1" runat="server" CssClass="popupControl"> <asp:UpdatePanel runat="server" ID="up1"> <ContentTemplate> <center> <asp:Calendar ID="Calendar1" runat="server" Width="160px" DayNameFormat="Shortest" BackColor="White" BorderColor="#999999" CellPadding="1" Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" OnSelectionChanged="Calendar1_SelectionChanged"> <SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" /> <TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" /> <SelectorStyle BackColor="#CCCCCC" /> <WeekendDayStyle BackColor="#FFFFCC" /> <OtherMonthDayStyle ForeColor="#808080" /> <NextPrevStyle VerticalAlign="Bottom" /> <DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" /> <TitleStyle BackColor="#999999" Font-Size="7pt" BorderColor="Black" Font-Bold="True" /> </asp:Calendar> </center> </ContentTemplate> </asp:UpdatePanel> </asp:Panel> <ajaxToolkit:PopupControlExtender ID="PopupControlExtender1" runat="server" TargetControlID="DateTextBox" PopupControlID="Panel1" Position="Bottom" /> Reminder message: <asp:TextBox ID="MessageTextBox" runat="server" Width="200" autocomplete="off" /><br /> <br /> <asp:Panel ID="Panel2" runat="server" CssClass="popupControl"> <div style="border: 1px outset white; width: 100px"> <asp:UpdatePanel runat="server" ID="up2"> <ContentTemplate> <asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostB