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. AJAX updatepanel not preventing entire page postback?

AJAX updatepanel not preventing entire page postback?

Scheduled Pinned Locked Moved ASP.NET
visual-studiosysadmintoolshelpquestion
4 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.
  • I Offline
    I Offline
    InvalidTypecast
    wrote on last edited by
    #1

    Months ago in VS 2005 I did some demo projects with AJAX and everything worked. I'm now using VS 2008 with the built in AJAX tools and I am running into some difficulty where the entire page is refreshing even though I have my event inside an update panel. Here is my aspx page: <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> <br /> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label> <br /> <asp:Button ID="Button1" runat="server" Text="Button" /> </ContentTemplate> </asp:UpdatePanel> </div> </form> Here is the page load code behind set to refresh the time in both labels. protected void Page_Load(object sender, EventArgs e) { Label1.Text = System.DateTime.Now.ToString(); Label2.Text = System.DateTime.Now.ToString(); } The problem I am having is that even though the button click event occurs inside the update panel the entire web page is posting back. Both labels refresh with the current datetime. Any ideas?

    I 1 Reply Last reply
    0
    • I InvalidTypecast

      Months ago in VS 2005 I did some demo projects with AJAX and everything worked. I'm now using VS 2008 with the built in AJAX tools and I am running into some difficulty where the entire page is refreshing even though I have my event inside an update panel. Here is my aspx page: <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> <br /> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label> <br /> <asp:Button ID="Button1" runat="server" Text="Button" /> </ContentTemplate> </asp:UpdatePanel> </div> </form> Here is the page load code behind set to refresh the time in both labels. protected void Page_Load(object sender, EventArgs e) { Label1.Text = System.DateTime.Now.ToString(); Label2.Text = System.DateTime.Now.ToString(); } The problem I am having is that even though the button click event occurs inside the update panel the entire web page is posting back. Both labels refresh with the current datetime. Any ideas?

      I Offline
      I Offline
      InvalidTypecast
      wrote on last edited by
      #2

      I've read threads regarding the xhtmlconformance, but my webhost says the machine.config has it set to Transitional already and I've even added the Transitional line to the project's web.config so I'm still baffled. The same code works locally on the machine, but not on the production site.

      S 1 Reply Last reply
      0
      • I InvalidTypecast

        I've read threads regarding the xhtmlconformance, but my webhost says the machine.config has it set to Transitional already and I've even added the Transitional line to the project's web.config so I'm still baffled. The same code works locally on the machine, but not on the production site.

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

        Just Remove the tag from web.config file I think It will Work For You Ragards, Sukku Reddy.

        S 1 Reply Last reply
        0
        • S sukkureddy

          Just Remove the tag from web.config file I think It will Work For You Ragards, Sukku Reddy.

          S Offline
          S Offline
          sukkureddy
          wrote on last edited by
          #4

          remove xhtml tag from web.config file

          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