Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How can I update the page Friend.aspx partially by clicking on button deleteFriend of usercontrol Profile.ascx?

How can I update the page Friend.aspx partially by clicking on button deleteFriend of usercontrol Profile.ascx?

Scheduled Pinned Locked Moved ASP.NET
questionsysadminannouncement
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Shahdat Hosain
    wrote on last edited by
    #1

    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

    N 1 Reply Last reply
    0
    • S Shahdat Hosain

      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

      N Offline
      N Offline
      Nisha Agrawal
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups