1
Answer

C# variable to javascript?

gayamantra

gayamantra

20y
4.1k
1
Is it possible to pass a C# variable to a javascript function? For eg. I have a string called 'page' such that page=txtLinkFoundOn.Text; Now i have a page_load event as below which calls a function openPg(page) private void Page_Load(object sender, System.EventArgs e) { addLink.Attributes.Add("onclick","openPg(page);"); } openPg is a javascript function which is coded as below: but then as expected it doesn't work! PLS HELP!!:(

Answers (1)