C# variable to javascript?

Sep 1 2004 9:57 AM
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)