How can I update the page Friend.aspx partially by clicking on button deleteFriend of usercontrol Profile.ascx?
-
To update the page Friend.aspx partially by clicking on button deleteFriend of usercontrol Profile.ascx I use following code Friend.aspx
<%@ Register Src="~/UserControls/ProfileDisplaySmall.ascx" TagPrefix="Kooras" TagName="ProfileDisplaySmall" %>
<asp:UpdatePanel ID="UpdatePanel2" runat="server"> <ContentTemplate> <Kooras:ProfileDisplaySmall ShowConnectionRequestButton="false" ShowDeleteButton="false" ID="pdProfileDisplay" runat="server" /> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> <asp:Label ID="Label4" runat="server" Text="Label"></asp:Label> </ContentTemplate> <Triggers> </Triggers> </asp:UpdatePanel>
But nothing to do I also add
<Triggers>
<asp:AsyncPostBackTrigger ControlID="deleteFriend" EventName="click"/>
</Triggers>Profile.ascx
<asp:ImageButton ImageAlign="AbsMiddle" ID="deleteFriend" CssClass="cross" runat="server" OnClick="ibDelete_Click" ImageUrl="~/images/cross_icon_normal.png" />
Now compiler says deleteFriend does not exist in the current context(at Friend.aspx ). What can I do? Plz ...
shahdat
-
To update the page Friend.aspx partially by clicking on button deleteFriend of usercontrol Profile.ascx I use following code Friend.aspx
<%@ Register Src="~/UserControls/ProfileDisplaySmall.ascx" TagPrefix="Kooras" TagName="ProfileDisplaySmall" %>
<asp:UpdatePanel ID="UpdatePanel2" runat="server"> <ContentTemplate> <Kooras:ProfileDisplaySmall ShowConnectionRequestButton="false" ShowDeleteButton="false" ID="pdProfileDisplay" runat="server" /> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> <asp:Label ID="Label4" runat="server" Text="Label"></asp:Label> </ContentTemplate> <Triggers> </Triggers> </asp:UpdatePanel>
But nothing to do I also add
<Triggers>
<asp:AsyncPostBackTrigger ControlID="deleteFriend" EventName="click"/>
</Triggers>Profile.ascx
<asp:ImageButton ImageAlign="AbsMiddle" ID="deleteFriend" CssClass="cross" runat="server" OnClick="ibDelete_Click" ImageUrl="~/images/cross_icon_normal.png" />
Now compiler says deleteFriend does not exist in the current context(at Friend.aspx ). What can I do? Plz ...
shahdat
I just suppose that u don't need to add triggers section
it will remove the error of "DeleteFriend does not exist in the current context". Then just put a breakpoint on profile.ascx.cs file at function ibDelete_Click so that you can identify that there is no error in actual code. and if you are displaying some message in some control or refreshing content of any control after delete then make sure that that particular control is the child of same UpdatePanel in which u have placed the Profile User Control's instance. I hope it gonna help u.