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. Anthem.Net - Multiple Requests at the same time... [modified]

Anthem.Net - Multiple Requests at the same time... [modified]

Scheduled Pinned Locked Moved ASP.NET
tutorialannouncementcsharphtmlvisual-studio
2 Posts 1 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.
  • D Offline
    D Offline
    Drofnas
    wrote on last edited by
    #1

    So I have a very simple webpage (see below). When I click on the first button it posts back and updates the value with in the text box just fine, and same with the second one. But if I click on the first button then immediately click on the second one, so that they are both posting back at the same time, it will come back and fill in the data for the firs textbox, after the Thread.Sleep() has completed, then it will blow out the value in the first textbox, and set the value for the second value. So it looks like it grabs the currect viewstate of all of the controls that have "AutoUpdateAfterCallBack" turned on, and there for when the callback is complete it will reset all of the fields, then update the value(s) that you wanted set. Does anyone know how to get this example to work properly with the latest version of Anthem.Net? I only want it to update the fields that I actually modified with in the server side code. [HTML Code]

    <form id="form1" runat="server">
    <div>
    <anthem:TextBox ID="txt1" runat="server" EnableCallBack="true" AutoUpdateAfterCallBack="True">
    <anthem:Button ID="btn1" runat="server" Text="Ajax w/Sleep" EnableCallBack="true" TextDuringCallBack="Processing..." EnabledDuringCallBack="false" />
    </div>
    <div>
    <anthem:TextBox ID="txt2" runat="server" EnableCallBack="true" AutoUpdateAfterCallBack="True">
    <anthem:Button ID="btn2" runat="server" Text="Ajax w/Sleep" EnableCallBack="true" TextDuringCallBack="Processing..." EnabledDuringCallBack="false" />
    </div>
    </form>

    [Code Behind]

    Partial Class Default
    Inherits System.Web.UI.Page

    Protected Sub btn1\_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn1.Click
        txt1.Text = "Hello World"
        Threading.Thread.Sleep(1000)
    End Sub
    
    Protected Sub btn2\_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn2.Click
        txt2.Text = "Hello World"
        Threading.Thread.Sleep(1000)
    End Sub
    

    End Class

    -- modified at 18:43 Thursday 14th September, 2006 I'm using Anthem.Net v1.3.2 with VS.Net 2005 Pro.

    D 1 Reply Last reply
    0
    • D Drofnas

      So I have a very simple webpage (see below). When I click on the first button it posts back and updates the value with in the text box just fine, and same with the second one. But if I click on the first button then immediately click on the second one, so that they are both posting back at the same time, it will come back and fill in the data for the firs textbox, after the Thread.Sleep() has completed, then it will blow out the value in the first textbox, and set the value for the second value. So it looks like it grabs the currect viewstate of all of the controls that have "AutoUpdateAfterCallBack" turned on, and there for when the callback is complete it will reset all of the fields, then update the value(s) that you wanted set. Does anyone know how to get this example to work properly with the latest version of Anthem.Net? I only want it to update the fields that I actually modified with in the server side code. [HTML Code]

      <form id="form1" runat="server">
      <div>
      <anthem:TextBox ID="txt1" runat="server" EnableCallBack="true" AutoUpdateAfterCallBack="True">
      <anthem:Button ID="btn1" runat="server" Text="Ajax w/Sleep" EnableCallBack="true" TextDuringCallBack="Processing..." EnabledDuringCallBack="false" />
      </div>
      <div>
      <anthem:TextBox ID="txt2" runat="server" EnableCallBack="true" AutoUpdateAfterCallBack="True">
      <anthem:Button ID="btn2" runat="server" Text="Ajax w/Sleep" EnableCallBack="true" TextDuringCallBack="Processing..." EnabledDuringCallBack="false" />
      </div>
      </form>

      [Code Behind]

      Partial Class Default
      Inherits System.Web.UI.Page

      Protected Sub btn1\_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn1.Click
          txt1.Text = "Hello World"
          Threading.Thread.Sleep(1000)
      End Sub
      
      Protected Sub btn2\_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn2.Click
          txt2.Text = "Hello World"
          Threading.Thread.Sleep(1000)
      End Sub
      

      End Class

      -- modified at 18:43 Thursday 14th September, 2006 I'm using Anthem.Net v1.3.2 with VS.Net 2005 Pro.

      D Offline
      D Offline
      Drofnas
      wrote on last edited by
      #2

      For anyone that is interested, I found the solution to my problem. Instead of setting the "AutoUpdateAfterCallBack" property in the HTML code, you would instead set it after you've updated the value for the text field, for example:

      Partial Class Default
      Inherits System.Web.UI.Page

      Protected Sub btn1\_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn1.Click
          txt1.Text = "Hello World"
          txt1.UpdateAfterCallBack = True
          Threading.Thread.Sleep(1000)
      End Sub
      
      Protected Sub btn2\_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn2.Click
          txt2.Text = "Hello World"
          txt2.UpdateAfterCallBack = True
          Threading.Thread.Sleep(1000)
      End Sub
      

      End Class

      That way the auto updating functionality of Anthem.Net will only update the specific field(s) that you set to update after the callback has occured.

      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