asp.net中的string.Format()
代码
string message = "Alert!";
string toURL = "home.aspx";
string js = @"<script>alert('{0}'); window.location.href = '{1}'; </script>";
if(!Page.ClientScript.IsStartupScriptRegistered("alert"))
{
Page.ClientScript.RegisterStartupScript(Page.GetType(), "alert", string.Format(js, message, toURL));
}
string toURL = "home.aspx";
string js = @"<script>alert('{0}'); window.location.href = '{1}'; </script>";
if(!Page.ClientScript.IsStartupScriptRegistered("alert"))
{
Page.ClientScript.RegisterStartupScript(Page.GetType(), "alert", string.Format(js, message, toURL));
}
继续追寻。。。。。。