We've expanded our news coverage and improved our search! Visit
news.oreilly.com for the latest or search for all things across O'Reilly!
Article:
 |
|
Enhancing ASP.NET Pages with JavaScript
|
| Subject: |
|
How to use C# string variable in JavaScript |
| Date: |
|
2006-10-22 01:54:53 |
| From: |
|
ashraf_gawdat
|
Response to: How to use C# string variable in JavaScript
|
|
This must be working
private void PopUpMessege(string msg)
{
string popupScript = "<script language='javascript'>" +
"window.alert("+msg+");</script>";
Page.RegisterStartupScript("PopupScript", popupScript);
}
So you must add the variable (msg) as a variable not as a part of the string
|