2
我想以後後面的一些行動顯示從代碼DIV HTML警報自舉消息, 我使用的Response.Write顯示信息:如何從後面的代碼顯示警報消息?
<html>
<head>
<link href="bootstrap.min.css"/>
</head>
<body>
<div id="containerMsg"></div>
Login design
<script src="jquery.min.js"></script>
<script src="bootstrap.min.js"></script>
</body>
</html>
//
串警報CONCAT C#:
public static string msgError(string msg)
{
string strHtml = "";
strHtml += "<div class='alert alert-warning'>";
strHtml += " <strong>error login:</strong>"+msg;
strHtml += "</div>";
return strHtml;
}
//Code behind button click
if(loginBussines.isValid(user))
{
Response.Write("<script> $('#containerMsg').html("+UtilsMessage.msgError("invalid credentials")+"</script>") }
可能重複的[調用JavaScript函數從代碼隱藏](http://stackoverflow.com/questions/5731224/calling-javascript-function-from-codebehind) –