我如何创建从内容页面到母版页面加载的 javascript
mycontentpage.aspx 代码后面;
protected void haritasifirla()
{
string api = "AIzaSyDZd5O6jx8C4YdrUfMeMywlR5BDCMl4GV0";
ClientScript.RegisterClientScriptBlock(GetType(), "Script1", "<script src='http://maps.google.com/maps?file=api&v=2&key=" + api + "' type='text/javascript'></script>");
StringBuilder sb = new StringBuilder();
sb.Append("<script type='text/javascript'>");
sb.Append("function MapLoad() ");
sb.Append("{");
sb.Append("if (GBrowserIsCompatible()) ");
sb.Append("{");
sb.Append("}");
sb.Append("}");
sb.Append("</script>");
ClientScript.RegisterClientScriptBlock(GetType(), "Script2", sb.ToString());
}
现在
<form id="form1" runat="server">
但是我要
<form id="form1" runat="server" onload="MapLoad">