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));
}


posted @ 2010-07-02 15:45  空紫竹  阅读(249)  评论(0编辑  收藏  举报