function showMsg0() {
$.message({
title: '信息',
content: 'new或NEW是保护字,不可以选为名字简称!',
buttons: {
OK: {
text: 'OK',
btnClass: 'btn-green',
keys: ['enter'],
action: function () {
//$.alert('You clicked OK!');
}
},
}
});
return false;
};
...
protected void userabbr_post_change(object sender, EventArgs e)
{
if (tb_userabbr.Text.ToUpper() == "NEW")
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "showMsg0()", true);
tb_userabbr.Text = "";
return;
}
}
ASKER
SyntaxError: missing ) after argument list
[Learn More]
Default.aspx:352:27
ASKER
javascript:alert('登入者名称 - ''NEW'' 错误。');(function() {var fn = function() {$get("ctl08_HiddenField").value = '';Sys.Application.remove_init(fn);};Sys.Application.add_init(fn);})();
ASKER
How do you get such error message? I can see no problem, within the project (in Visual studio).try check that in your web browser's Inspect feature.
ASKER
Uncaught SyntaxError: missing ) after argument listin the following
function showMsg0() {
$.message({
title: '信息',
content: 'new或NEW是保护字,不可以选为名字简称!',
buttons: {
OK: {
text: 'OK',
btnClass: 'btn-green',
keys: ['enter'],
action: function () {
//$.alert('You clicked OK!');
}
}
}
});
return false;
};
Uncaught SyntaxError: missing ) after argument list
javascript:alert('登入者名称 - ''NEW'' 错误。');(function() {var fn = function() {$get("ctl08_HiddenField").value = '';Sys.Application.remove_ init(fn);} ;Sys.Appli cation.add _init(fn); })();
ASKER
function showMsg0() {
$.message({
title: '信息',
content: 'new或NEW是保护字,不可以选为名字简称!',
buttons: {
OK: {
text: 'OK',
btnClass: 'btn-green',
keys: ['enter'],
action: function () {
//$.alert('You clicked OK!');
}
}
}
});
return false;
};
Sorry, is there any problem to this?as tested earlier, i get this error:
TypeError: $.message is not a function
ASKER
are you forgot to include the message notification library into your page?
ASKER
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" />
<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script type="text/javascript" src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script type="text/javascript" src="//code.jquery.com/jquery-2.1.3.min.js"></script>
<script type="text/javascript" src="//code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.2.3/jquery-confirm.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.2/jquery-confirm.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.2/jquery-confirm.min.css" />
<link rel="stylesheet" type="text/css" href="//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.2.3/jquery-confirm.min.css" />
to the page.JavaScript1.js:281 Uncaught TypeError: $.message is not a function
at showMsg0 (JavaScript1.js:281)
at Default.aspx?userid=new&readonly=n:352
If I click error in above, it does point to this<script type="text/javascript">
//<![CDATA[
(function() {var fn = function() {$get("ctl08_HiddenField").value = '';Sys.Application.remove_init(fn);};Sys.Application.add_init(fn);})();showMsg0()//]]>
</script>
javascript:alert('登入者名称 - ''NEW'' 错误。');(function() {var fn = function() {$get("ctl08_HiddenField").value = '';Sys.Application.remove_init(fn);};Sys.Application.add_init(fn);})();
ASKER
Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "showMsg0()", true);
...
function showMsg0() {
$.message({
title: '信息',
content: 'new或NEW是保护字,不可以选为名字简称!',
buttons: {
OK: {
text: 'OK',
btnClass: 'btn-green',
keys: ['enter'],
action: function () {
//$.alert('You clicked OK!');
}
}
}
});
return false;
};
ASKER
function showMsg0() {
$.message({
title: '信息',
content: 'new或NEW是保护字,不可以选为名字简称!',
buttons: {
OK: {
text: 'OK',
btnClass: 'btn-green',
keys: ['enter'],
action: function () {
//$.alert('You clicked OK!');
}
}
}
});
return false;
};
ASKER
function showMsg0() {
$.dialog({
title: '信息',
content: 'new或NEW是保护字,不可以选为名字简称!',
buttons: {
OK: {
text: 'OK',
btnClass: 'btn-green',
keys: ['enter'],
action: function () {
//$.alert('You clicked OK!');
}
}
}
});
return false;
};
I cannot show OK button below. What to adjust?The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.
TRUSTED BY
you probably hitting an error:
Open in new window