AJAX: How to make relation between a linkbutton in a Accordion Menu and a GridView
-
I take a mistake like belleow message with runtime ; "A control with ID 'lnk1' could not be found for the trigger in UpdatePanel 'UpdatePanel2'.." lnk1 is my LinkButton's ID thats in the Ajax Accordion Menu content .. and the part of code : ----------- <Triggers> <asp:AsyncPostBackTrigger ControlID="lnk1" EventName="Click" /> </Triggers> </asp:UpdatePanel> ----------- And Please Help me .. Thank u so much for each answers..!
-
I take a mistake like belleow message with runtime ; "A control with ID 'lnk1' could not be found for the trigger in UpdatePanel 'UpdatePanel2'.." lnk1 is my LinkButton's ID thats in the Ajax Accordion Menu content .. and the part of code : ----------- <Triggers> <asp:AsyncPostBackTrigger ControlID="lnk1" EventName="Click" /> </Triggers> </asp:UpdatePanel> ----------- And Please Help me .. Thank u so much for each answers..!
-
Can u post complete ajax update panel code. Also check for the ID for Case sensitive.
Regards, Smart Boy Mumbai, (INDIA)
There isn't problem ID's about case sensitive.. and the code below : <asp:UpdatePanel ID="UpdatePanel2" UpdateMode="Conditional" runat="server"> <ContentTemplate> <asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None" HorizontalAlign="Center" AllowPaging="True" AllowSorting="True"> <FooterStyle BackColor="LightGray" Font-Bold="True" ForeColor="White" BorderStyle="Solid" BorderWidth="2px" Font-Size="Small" /> <RowStyle BackColor="#F7F6F3" ForeColor="#333333" Font-Size="Small" /> <PagerStyle BackColor="LightGray" ForeColor="MediumBlue" HorizontalAlign="Justify" BorderStyle="Solid" BorderWidth="2px" Font-Size="X-Small" /> <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" /> <HeaderStyle BackColor="LightGray" Font-Bold="True" ForeColor="MediumBlue" BorderColor="Black" BorderStyle="Solid" BorderWidth="2px" Font-Names="Verdana" Font-Size="X-Small" Font-Strikeout="False" Font-Underline="True" /> <EditRowStyle BackColor="#999999" /> <AlternatingRowStyle BackColor="White" ForeColor="#284775" /> <Columns> <asp:ImageField DataImageUrlField="MARKA_ADI" DataImageUrlFormatString="images/{0}.jpg" HeaderText="GÖRÜNÜM"> </asp:ImageField> </Columns> </asp:GridView> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="lnk2" EventName="Click" /> </Triggers> </asp:UpdatePanel>
-
There isn't problem ID's about case sensitive.. and the code below : <asp:UpdatePanel ID="UpdatePanel2" UpdateMode="Conditional" runat="server"> <ContentTemplate> <asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None" HorizontalAlign="Center" AllowPaging="True" AllowSorting="True"> <FooterStyle BackColor="LightGray" Font-Bold="True" ForeColor="White" BorderStyle="Solid" BorderWidth="2px" Font-Size="Small" /> <RowStyle BackColor="#F7F6F3" ForeColor="#333333" Font-Size="Small" /> <PagerStyle BackColor="LightGray" ForeColor="MediumBlue" HorizontalAlign="Justify" BorderStyle="Solid" BorderWidth="2px" Font-Size="X-Small" /> <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" /> <HeaderStyle BackColor="LightGray" Font-Bold="True" ForeColor="MediumBlue" BorderColor="Black" BorderStyle="Solid" BorderWidth="2px" Font-Names="Verdana" Font-Size="X-Small" Font-Strikeout="False" Font-Underline="True" /> <EditRowStyle BackColor="#999999" /> <AlternatingRowStyle BackColor="White" ForeColor="#284775" /> <Columns> <asp:ImageField DataImageUrlField="MARKA_ADI" DataImageUrlFormatString="images/{0}.jpg" HeaderText="GÖRÜNÜM"> </asp:ImageField> </Columns> </asp:GridView> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="lnk2" EventName="Click" /> </Triggers> </asp:UpdatePanel>
-
In first post u have said that ur button name was "lnk1" and now in ur this reply with the code ur button name is "lnk2"
Regards, Smart Boy Mumbai, (INDIA)
The name lnk1 or lnk2 is not important, I have already a few LinkButton instance, in the Content of Accordion Menu.. Thats the important point, the update panel can not find whatever linkbutton, that i write in the trigger.. Thanks..
-
The name lnk1 or lnk2 is not important, I have already a few LinkButton instance, in the Content of Accordion Menu.. Thats the important point, the update panel can not find whatever linkbutton, that i write in the trigger.. Thanks..
-
yep ! like this : <Content> <table style="border-color:Black" border="0" cellpadding="0" cellspacing="0" width="129" > <tr> <td class="accordionPaneContent"> <p style="text-align:center"> <asp:LinkButton Font-Underline="false" CssClass="accordionPaneLink" ID="lnk1" onclick="lnk1_Click" Text="1" runat="server">HewlettPackard</asp:LinkButton> </p> </td> </tr>
-
yep ! like this : <Content> <table style="border-color:Black" border="0" cellpadding="0" cellspacing="0" width="129" > <tr> <td class="accordionPaneContent"> <p style="text-align:center"> <asp:LinkButton Font-Underline="false" CssClass="accordionPaneLink" ID="lnk1" onclick="lnk1_Click" Text="1" runat="server">HewlettPackard</asp:LinkButton> </p> </td> </tr>
In event name of ur update panel u have written "Click" as event but in ur linkbutton control onclick event value is "lnk1_Click". If u r writing ur code in ASP.Net then Handler in the event like Protected Sub lnk1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnk1.Click And remove the event name in the Code onclick="lnk1_Click" from ur html and try then. Best of Luck.
Regards, Smart Boy Mumbai, (INDIA)