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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Ajax (Javascript) with ASP.NET communication Problem

Ajax (Javascript) with ASP.NET communication Problem

Scheduled Pinned Locked Moved ASP.NET
csharphelpjavascriptasp-netdatabase
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.
  • D Offline
    D Offline
    dipak dipak
    wrote on last edited by
    #1

    I just need to get data, "POST" from the client side (by javascript with send method) in the page asp.net page with C# code. i have used: var xmlHttp = GetXmlHttpObject(); xmlHttp.open("POST","SaveInfo.aspx",true); var args = "id=" + ID + "&name=" + Name + "&sex=" + Sex + "&age=" + Age; xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlHttp.setRequestHeader("Content-length", args.length); xmlHttp.setRequestHeader("Connection", "close"); xmlHttp.onreadystatechange = function theStateChanged() { alert(xmlHttp.status); if (xmlHttp.readyState==4 && xmlHttp.status==200) { alert("Successfully Saved"); } } xmlHttp.Send(args); So, this is the code. I want to access the args from the page SaveInfo.aspx . how can access that to save those on the database using C# code on this page. Please help me.

    Dipak

    J 1 Reply Last reply
    0
    • D dipak dipak

      I just need to get data, "POST" from the client side (by javascript with send method) in the page asp.net page with C# code. i have used: var xmlHttp = GetXmlHttpObject(); xmlHttp.open("POST","SaveInfo.aspx",true); var args = "id=" + ID + "&name=" + Name + "&sex=" + Sex + "&age=" + Age; xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlHttp.setRequestHeader("Content-length", args.length); xmlHttp.setRequestHeader("Connection", "close"); xmlHttp.onreadystatechange = function theStateChanged() { alert(xmlHttp.status); if (xmlHttp.readyState==4 && xmlHttp.status==200) { alert("Successfully Saved"); } } xmlHttp.Send(args); So, this is the code. I want to access the args from the page SaveInfo.aspx . how can access that to save those on the database using C# code on this page. Please help me.

      Dipak

      J Offline
      J Offline
      J a a n s
      wrote on last edited by
      #2

      Please don't post same questions in multiple forums. You can get your answer from here[^] or google[^].

      *jaans

      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