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. ASP.NET, AJAX, and JavaScript

ASP.NET, AJAX, and JavaScript

Scheduled Pinned Locked Moved ASP.NET
jsonhelpcsharpjavascriptasp-net
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.
  • L Offline
    L Offline
    Lea Hayes
    wrote on last edited by
    #1

    Hi guys! I have had to use quite a lot of AJAX for the website that I am working on, but I am often faced with synchronizing control properties between the client and server. I started thinking about ways in which I could interact with the view state, but there are complexities involved with this (i.e. encryption and compression). I then realised, what if a second view state were to be constructed for client side use. I could create a JavaScript class which manages this view state, and a base class for all client-side controls which eases interaction with this client-side view state. I figure that the best way to serialize this information is with JSON (I use the JavaScript Prototype Framework for this). I haven't actually created this yet because there is a major problem that I wanted to address. Somehow I need to intercept the default ASP.NET "__DoPostBack" function so that I can add some serialization functionality for my client view state class. Any help would be greatly appreciated! Lea Hayes

    L 1 Reply Last reply
    0
    • L Lea Hayes

      Hi guys! I have had to use quite a lot of AJAX for the website that I am working on, but I am often faced with synchronizing control properties between the client and server. I started thinking about ways in which I could interact with the view state, but there are complexities involved with this (i.e. encryption and compression). I then realised, what if a second view state were to be constructed for client side use. I could create a JavaScript class which manages this view state, and a base class for all client-side controls which eases interaction with this client-side view state. I figure that the best way to serialize this information is with JSON (I use the JavaScript Prototype Framework for this). I haven't actually created this yet because there is a major problem that I wanted to address. Somehow I need to intercept the default ASP.NET "__DoPostBack" function so that I can add some serialization functionality for my client view state class. Any help would be greatly appreciated! Lea Hayes

      L Offline
      L Offline
      Lea Hayes
      wrote on last edited by
      #2

      I've been digging around and have just discovered the Page.ClientScript.RegisterOnSubmitStatement method. This method allows client-script code to be injected into the default ASP.NET __DoPostBack method by means of an ASP.NET specific custom event theForm.onsubmit. If the custom client-script code returns false, the post back is aborted. So, for my particular problem, I can use this functionality of ASP.NET to create a client-side equivalent of the server-side view state. Best regards, Lea Hayes

      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