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. update panel

update panel

Scheduled Pinned Locked Moved Web Development
announcementhtmldesignsysadminhelp
4 Posts 2 Posters 1 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
    solarthur01
    wrote on last edited by
    #1

    im trying to use the update panel but it updates the entire page as supposed to the update panel. i cant find what i have done wrong. can anyone help??? Many thanks in advance ==================================================================================== <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> <%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI" TagPrefix="asp" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:ScriptManager id="ScriptManager1" runat="server"> </asp:ScriptManager> </div> <asp:UpdatePanel id="UpdatePanel1" runat="server"> <contenttemplate> <asp:Label id="Label1" runat="server" Text="panel Created"></asp:Label> </contenttemplate> <triggers> <asp:AsyncPostBackTrigger ControlID="Button1"></asp:AsyncPostBackTrigger> </triggers> </asp:UpdatePanel> <asp:Button ID="Button1" runat="server" Text="Button" /> </form> </body> </html> ===========================code behind================ Protected Sub Button1_Click1(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Label1.Text = "Refreshed at " & _ DateTime.Now.ToString() End Sub

    N 1 Reply Last reply
    0
    • S solarthur01

      im trying to use the update panel but it updates the entire page as supposed to the update panel. i cant find what i have done wrong. can anyone help??? Many thanks in advance ==================================================================================== <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> <%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI" TagPrefix="asp" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:ScriptManager id="ScriptManager1" runat="server"> </asp:ScriptManager> </div> <asp:UpdatePanel id="UpdatePanel1" runat="server"> <contenttemplate> <asp:Label id="Label1" runat="server" Text="panel Created"></asp:Label> </contenttemplate> <triggers> <asp:AsyncPostBackTrigger ControlID="Button1"></asp:AsyncPostBackTrigger> </triggers> </asp:UpdatePanel> <asp:Button ID="Button1" runat="server" Text="Button" /> </form> </body> </html> ===========================code behind================ Protected Sub Button1_Click1(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Label1.Text = "Refreshed at " & _ DateTime.Now.ToString() End Sub

      N Offline
      N Offline
      newc1
      wrote on last edited by
      #2

      Hi, This is some rather twisted MS logic. The whole idea of the UpdatePanel is to allow only parts of the web form to be posted back in order to provide AJAX functionality. However, the default behaviour of the UpdatePanel is to post the whole page back, rather than just the controls contained within it! To correct this you will need to set the following property against the UpdatePanel: UpdateMode="Conditional" Hope this helps...

      Clean code is the key to happiness.

      S 1 Reply Last reply
      0
      • N newc1

        Hi, This is some rather twisted MS logic. The whole idea of the UpdatePanel is to allow only parts of the web form to be posted back in order to provide AJAX functionality. However, the default behaviour of the UpdatePanel is to post the whole page back, rather than just the controls contained within it! To correct this you will need to set the following property against the UpdatePanel: UpdateMode="Conditional" Hope this helps...

        Clean code is the key to happiness.

        S Offline
        S Offline
        solarthur01
        wrote on last edited by
        #3

        :( I have set it to conditional however it stll updates the whole page.

        N 1 Reply Last reply
        0
        • S solarthur01

          :( I have set it to conditional however it stll updates the whole page.

          N Offline
          N Offline
          newc1
          wrote on last edited by
          #4

          Having spent a fair bit of time playing around and implementing AJAX solutions, I would recommend that you do not use the UpdatePanel. Even when the UpdatePanel is working as it should, the whole of the page is still posted back, which basically defeats the object of a partial postback. Tell tell signs of this can be seen with drop down lists, that even if outside of the UpdatePanel, will flicker on partial postback. My preferred route for handling AJAX type functionality is through the use of the ScriptManager control's service references. Registreing a local web service through the ScriptManager control creates a JS web service proxy object that is very simple to use. It uses JSON encoding which means the web service response object can be easily accessed to extract the required data, and web service methods can be called as easily as Service.Method(params). You can also set up default success and failure functiojns to handle all web method responses. Check out the following which gives somke examples of how to implement the above: http://www.asp.net/AJAX/Documentation/Live/tutorials/ASPNETAJAXWebServicesTutorials.aspx http://www.semenoff.dk/en/Code-Corner/ASP.Net.AJAX/WebService-From-JavaScript.aspx

          Clean code is the key to happiness.

          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