Link to home
Start Free TrialLog in
Avatar of GlobaLevel
GlobaLevelFlag for United States of America

asked on

asp.net - javascript - pass a value from a textbox on client into sessionvaraible...

on click of a link I need to pass a value from a textbox into a session varaible that can be used on the server...
Avatar of GlobaLevel
GlobaLevel
Flag of United States of America image

ASKER

something like this...

------

<a href="http://localhost:1757/test/wait_new_1.aspx" target="_blank" onclick="return popCC(this);">send values</a>

<script language="JavaScript">
         
function popCC(url) {
  sessionvaraible = textbox1.text

}
</script>

ASKER CERTIFIED SOLUTION
Avatar of devlab2012
devlab2012
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
devlab...

with this...
    <WebMethod()> _
    Public Shared Sub SetVariable(ByVal textVal As String)
        Session("SessionUserFirstName") = textVal
    End Sub

I get this...
Cannot refer to an instance member of a class from within a shared method or shared member intializer without an explicit instance of the class
Change the following line:
Session("SessionUserFirstName") = textVal

To:
HttpContext.Current.Session("SessionUserFirstName") = textVal
DevLab...Thank you!