Javascript window.onload=函数()未显示完整消息

Javascript window.onload=函数()未显示完整消息,javascript,Javascript,windows.onload()popup没有在chrome中显示整个消息。浏览器中的弹出窗口显示完整消息。如何在Chrome中解决这个问题 在浏览器弹出窗口中尝试显示完整消息。如何在chrome中解决这个问题 string script = "window.onload = function() { alert('" + message + "'); };"; ClientScript.RegisterStartupScript(this.GetType(), "alert", script,

windows.onload()
popup没有在chrome中显示整个消息。浏览器中的弹出窗口显示完整消息。如何在Chrome中解决这个问题

在浏览器弹出窗口中尝试显示完整消息。如何在chrome中解决这个问题

string script = "window.onload = function() { alert('" + message + "'); };";
ClientScript.RegisterStartupScript(this.GetType(), "alert", script, true);
受保护的无效页面加载(对象发送方,事件参数e)
{
字符串消息=“hii”;
响应。写入(“警报(“+”消息+“);”;
}

试试这个…

你的项目的目标框架是什么?您在哪里使用了
ClientScript.RegisterStartupScript
?此方法用于注册启动脚本。如果使用asp.net core,则只需使用$(function(){//startup code goes here});。NET Framework 4.6.1Hi@nega,您的标记是
asp.NET core
。您是否在.NET core项目中使用它?如果是,您是如何在.NET core项目中使用它的?您能分享一个更详细的演示吗?嗨,Rena,我被错误地称为标记的core。我正在发布我是如何使用--MenuNameList+=dtval.Rows[0][“Comments”].ToString()的;AlertData(菜单列表)-----私有void AlertData(字符串消息){string Message=Message;string script=“window.onload=function(){alert(“+Message+”);};;“ClientScript.RegisterStartupScript(this.GetType(),“alert”,script,true);}
protected void Page_load(object sender,EventArgs e)
{
    string message="hii";
    Response.Write("<script type='text/javascript'>alert('"+message+"');</script>");
}