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. General Programming
  3. C#
  4. to get the values in javascript to C#(plz help some one plz........)

to get the values in javascript to C#(plz help some one plz........)

Scheduled Pinned Locked Moved C#
helpcsharpjavascripthtmlsysadmin
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.
  • P Offline
    P Offline
    P_Elza
    wrote on last edited by
    #1

    hi please help me..... am doing a mantanence project. i have writen some code to copy a file from server to harddisk. but there is some problem. i have developed this as windows application. now they want as web. tyhe problem is, i was reading the file path and copying in dos.in windos the path is already is there in html page in javascript. can i move the value to a the code behind string(C#). if we can convert how is it possible? in code behind there is string Customer, book on html page there is values of customer1 and journal as var customer1 ='<%=Session["customer"]%>'; var journal = '<%=Session["journal"]%>'; how can we get the values of customer1 and journal to Customer, book please help me.... please

    A 1 Reply Last reply
    0
    • P P_Elza

      hi please help me..... am doing a mantanence project. i have writen some code to copy a file from server to harddisk. but there is some problem. i have developed this as windows application. now they want as web. tyhe problem is, i was reading the file path and copying in dos.in windos the path is already is there in html page in javascript. can i move the value to a the code behind string(C#). if we can convert how is it possible? in code behind there is string Customer, book on html page there is values of customer1 and journal as var customer1 ='<%=Session["customer"]%>'; var journal = '<%=Session["journal"]%>'; how can we get the values of customer1 and journal to Customer, book please help me.... please

      A Offline
      A Offline
      Andrei Ungureanu
      wrote on last edited by
      #2

      If you read the values in javascript from the Session object...why don't you read on the server (code behind) from the Session object also?

      There are 10 kinds of people: those who understand binary and those who don't

      P 1 Reply Last reply
      0
      • A Andrei Ungureanu

        If you read the values in javascript from the Session object...why don't you read on the server (code behind) from the Session object also?

        There are 10 kinds of people: those who understand binary and those who don't

        P Offline
        P Offline
        P_Elza
        wrote on last edited by
        #3

        This is a mainanance project. am biginer to .net so dont know much. i dont know how to do that. thats y am asking. i just want to know how we can get the value of javascript variable in c# This is the function in javascript function display() { var localpath1 = document.getElementById('lblerr'); lblerr.innerText = localpath; }

        A 1 Reply Last reply
        0
        • P P_Elza

          This is a mainanance project. am biginer to .net so dont know much. i dont know how to do that. thats y am asking. i just want to know how we can get the value of javascript variable in c# This is the function in javascript function display() { var localpath1 = document.getElementById('lblerr'); lblerr.innerText = localpath; }

          A Offline
          A Offline
          Andrei Ungureanu
          wrote on last edited by
          #4

          from the javascript function i understand that you have an asp:Label control on your page. In this case in the code behind just use:

          string Value = lblerr.Text;

          My first reply referd at this code you wrote: var customer1 ='<%=Session["customer"]%>'; var journal = '<%=Session["journal"]%>'; Using <%=Session["customer"]%> means that you insert a C# call to retrieve data from the Session object, which is also available in the code behind.

          string customerValue = (string)Session["customer"];

          Hope it helps.

          There are 10 kinds of people: those who understand binary and those who don't

          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