Link to home
Start Free TrialLog in
Avatar of sandya_116
sandya_116

asked on

Change client-side javascript variable value from server side

On page load, I have the below code to set the totalcount variable value to 25. On a button click, I would like to change this value to row count of a grid. How do I change this?

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Dim sb As StringBuilder = New StringBuilder()
 sb.Append("<script type=""text/javascript"">")
sb.AppendFormat("var Label1 = '{0}';", "Less")
sb.AppendFormat("var Label2 = '{0}';", "More")
b.AppendFormat("var {0} = '{1}';", "TotalCount", 25)
sb.Append("initPages();")
sb.Append("</script>")
Me.Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "searchscript", sb.ToString())
End Sub

Protected Sub Continue_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Continue.Click

End Sub
ASKER CERTIFIED SOLUTION
Avatar of Member_6283346
Member_6283346

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
SOLUTION
Avatar of Deja Anbu
Deja Anbu
Flag of Oman 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
Avatar of sandya_116
sandya_116

ASKER

.