how to detect session in javascript?
-
hello every one... i can use label and textbox in javascript, and now, i am using session, but can not detect in javascript. my javascript: function DisplayConfirmation(cost,textboxid) { var s=document.getElementById(textboxid).value; if(s>cost) { if(confirm('Are u sure')) { document.getElementById('<%=HiddenField1.ClientID%>').value = "true" } else { document.getElementById("<%=HiddenField1.ClientID%>").value = 'false' } } else { } } my code in vb: Protected Sub FormView2_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles FormView2.DataBound If Page.IsPostBack = True Then Dim t2 As TextBox = TryCast(FormView2.FindControl("tes"), TextBox) Dim l1 As Label = TryCast(FormView2.FindControl("costLabel"), Label) Dim b As Button = TryCast(Me.FormView2.FindControl("button1"), Button) b.Attributes.Add("onclick", "return DisplayConfirmation(" & l1.Text & ",'" & t2.ClientID & "')") End If End Sub the label and textbox can detect in javascript... but if i use session, it can not detect in javascript. i don't know about the true code... my code use session like this: Protected Sub FormView2_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles FormView2.DataBound If Page.IsPostBack = True Then Dim t2 As TextBox = TryCast(FormView2.FindControl("tes"), TextBox) Dim l1 As Label = TryCast(FormView2.FindControl("costLabel"), Label) Dim b As Button = TryCast(Me.FormView2.FindControl("button1"), Button) Session("l") = l1 b.Attributes.Add("onclick", "return DisplayConfirmation(" & Session("l").tostring & ",'" & t2.ClientID & "')") End If End Sub it can not detect... what should i change it? thx..
-
hello every one... i can use label and textbox in javascript, and now, i am using session, but can not detect in javascript. my javascript: function DisplayConfirmation(cost,textboxid) { var s=document.getElementById(textboxid).value; if(s>cost) { if(confirm('Are u sure')) { document.getElementById('<%=HiddenField1.ClientID%>').value = "true" } else { document.getElementById("<%=HiddenField1.ClientID%>").value = 'false' } } else { } } my code in vb: Protected Sub FormView2_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles FormView2.DataBound If Page.IsPostBack = True Then Dim t2 As TextBox = TryCast(FormView2.FindControl("tes"), TextBox) Dim l1 As Label = TryCast(FormView2.FindControl("costLabel"), Label) Dim b As Button = TryCast(Me.FormView2.FindControl("button1"), Button) b.Attributes.Add("onclick", "return DisplayConfirmation(" & l1.Text & ",'" & t2.ClientID & "')") End If End Sub the label and textbox can detect in javascript... but if i use session, it can not detect in javascript. i don't know about the true code... my code use session like this: Protected Sub FormView2_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles FormView2.DataBound If Page.IsPostBack = True Then Dim t2 As TextBox = TryCast(FormView2.FindControl("tes"), TextBox) Dim l1 As Label = TryCast(FormView2.FindControl("costLabel"), Label) Dim b As Button = TryCast(Me.FormView2.FindControl("button1"), Button) Session("l") = l1 b.Attributes.Add("onclick", "return DisplayConfirmation(" & Session("l").tostring & ",'" & t2.ClientID & "')") End If End Sub it can not detect... what should i change it? thx..
-
WTF?
Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush
Keep watching. I wouldn't get surprised if his next query would be how to create a web server in Internet Explorer and run a JavaScript webpage in IIS?
Vasudevan Deepak Kumar Personal Homepage
Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson -
hello every one... i can use label and textbox in javascript, and now, i am using session, but can not detect in javascript. my javascript: function DisplayConfirmation(cost,textboxid) { var s=document.getElementById(textboxid).value; if(s>cost) { if(confirm('Are u sure')) { document.getElementById('<%=HiddenField1.ClientID%>').value = "true" } else { document.getElementById("<%=HiddenField1.ClientID%>").value = 'false' } } else { } } my code in vb: Protected Sub FormView2_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles FormView2.DataBound If Page.IsPostBack = True Then Dim t2 As TextBox = TryCast(FormView2.FindControl("tes"), TextBox) Dim l1 As Label = TryCast(FormView2.FindControl("costLabel"), Label) Dim b As Button = TryCast(Me.FormView2.FindControl("button1"), Button) b.Attributes.Add("onclick", "return DisplayConfirmation(" & l1.Text & ",'" & t2.ClientID & "')") End If End Sub the label and textbox can detect in javascript... but if i use session, it can not detect in javascript. i don't know about the true code... my code use session like this: Protected Sub FormView2_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles FormView2.DataBound If Page.IsPostBack = True Then Dim t2 As TextBox = TryCast(FormView2.FindControl("tes"), TextBox) Dim l1 As Label = TryCast(FormView2.FindControl("costLabel"), Label) Dim b As Button = TryCast(Me.FormView2.FindControl("button1"), Button) Session("l") = l1 b.Attributes.Add("onclick", "return DisplayConfirmation(" & Session("l").tostring & ",'" & t2.ClientID & "')") End If End Sub it can not detect... what should i change it? thx..