C# 向框中添加换行符
我弹出了一个javascript框,其中包含一些消息,但我还没有找到如何从代码后面添加换行符,我被要求这样做,下面是它目前的工作方式:C# 向框中添加换行符,c#,javascript,asp.net,C#,Javascript,Asp.net,我弹出了一个javascript框,其中包含一些消息,但我还没有找到如何从代码后面添加换行符,我被要求这样做,下面是它目前的工作方式: Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "key", "function SendBox() {location.href = 'movetopage.aspx';} if(confirm('Move the items:" + myListOfItems + ". Do yo
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "key",
"function SendBox() {location.href = 'movetopage.aspx';}
if(confirm('Move the items:" + myListOfItems + ". Do you want to continue? ') == true)
{SendBox();};", true);
页面上显示ok,但现在我需要添加以下行
"Clicking OK: Moves the items and continues"
所以最后的bos应该是这样显示的
Move the items: Books, Magazines, Newspapers. Do you want to continue?
Cliking OK: Moves the items and continues.
注意第一行和第二行之间的分隔符?,我不知道如何添加到框中,因为我为页面提供了代码。ClientScript。。。等等
我怎样才能在弹出框中添加分隔线
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "key",
"function SendBox() {location.href = 'movetopage.aspx';}
if(confirm('Move the items:" + myListOfItems + ". Do you want to continue?
<BR>
Clicking OK: Moves the items and continues') == true)
{SendBox();};", true);
Page.ClientScript.RegisterClientScriptBlock(this.GetType(),“key”,
“函数SendBox(){location.href='movetopage.aspx';}
如果(确认('移动项目:“+MyListFitEMS+”),是否继续?
单击“确定”:移动项目并继续(')==真)
{SendBox();};“,true);
我尝试添加一个中断
但不起作用(有意义),但我已经用尽了选择。使用
\n
代替
,因为它不是htmt,对于您的情况,您应该使用\\n
,因为在c#\
中应该是escape您是否尝试过“\n”这是通用换行符指示器?谢谢您的管理,我现在有问题,当我添加此项时,页面将继续执行它的操作,从不停止并显示弹出窗口,就像js调用现在被忽略一样。奇怪的:(