Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/290.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用c#…net在消息文本中应用前景色和粗体_C#_Asp.net - Fatal编程技术网

如何使用c#…net在消息文本中应用前景色和粗体

如何使用c#…net在消息文本中应用前景色和粗体,c#,asp.net,C#,Asp.net,保存值后,我将显示一个确认框,如下所示 showalert("Quote has been saved successfully. Your Submission Number is:" + SaveValue ); <div id="popup" class="window"> <p id="popupmessage"></p> </div> 现在我已经显示了savevalue粗体和下划线以及一些前景色,如何应用(也可以使用任何格

保存值后,我将显示一个确认框,如下所示

showalert("Quote has been saved successfully. Your Submission Number is:" + SaveValue );
    <div id="popup" class="window">
  <p id="popupmessage"></p>
</div>

现在我已经显示了savevalue粗体和下划线以及一些前景色,如何应用(也可以使用任何格式和html样式)

我不知道如何按照您的方式更改样式,但这里是(它是用中文编写的,但代码不是):

您可以创建自己的javascript弹出警报

    function ShowAlert(message) {
      $('#popup').fadeIn(500);
      $('#popupmessage').html(message);
    };
你的html可以是这样的

showalert("Quote has been saved successfully. Your Submission Number is:" + SaveValue );
    <div id="popup" class="window">
  <p id="popupmessage"></p>
</div>

你的代码可能会被隐藏

    ScriptManager.RegisterStartupScript(this, this.GetType(),"AlertScript","ShowAlert('Quote has been saved successfully. Your Submission Number is:<span style='text-decoration:underline;'>" + SaveValue + "</span>);"), true);
ScriptManager.RegisterStartupScript(this,this.GetType(),“AlertScript”,“ShowAlert('引号已成功保存。您的提交编号为:“+SaveValue+”;”),true);
通过这种方式,您可以显示弹出消息并根据需要设置其样式。

函数ShowAlert(message){
function ShowAlert(message) {    
   $('#popup').fadeIn(500);
var newmessage = "<span style='color:red;font-weight:bold;text-decoration:underline'>" + message + "</span>";
$('#popupmessage').html(newmessage); 
    }; 
$('popup').fadeIn(500); var newmessage=“”+消息+”; $('popupmessage').html(newmessage); };
它不起作用,我的项目中添加了任何支持文件,请给我一些建议OK,确保您的页面上有一个指向Jquery的链接,其次确保在代码隐藏中(设置断点),它会命中ScriptManager.RegisterStartupScript