Community discussion forum

How to access a javascript variable from Csharp code?

  • 1 year ago

    Hi everyone:

    Im trying to solve this problem.

    I created a cute javascript component. One of the funtions there generates or returns a string.

    I need to access that string in the .cs file, in order to load the value to the database...

    Does anyone knows how to solve this?

     
    Thank so you much

     


     

  • 1 year ago

    I have very poor English 

    Using Hidden Field

    <asp:HiddenField id="hiddenID".............. value="xxx"/>

    javascript code change to hiddenfield 

    getElementByID("hiddenID").value=xxx;

     .cs ;

    hiddenID.Value;

Post a reply

Enter your message below

Sign in or Join us (it's free).

We'd love to hear what you think! Submit ideas or give us feedback