How to display a 1056 character message in message box in asp.NET C#.
Response.Write("<script>alert(' " + a + " ')</script>");
The above code just accepts 54 characters only.I need some other way to display the error messages for a whole page.
How to display a 1056 character message in message box in asp.NET C#.
Response.Write("<script>alert(' " + a + " ')</script>");
The above code just accepts 54 characters only.I need some other way to display the error messages for a whole page.
I would use jQuery instead. It's a lot more friendly to the user than an alert and more flexible. There's a modal version if you need that as well.
you can try this in your codebehind.
String csname1 = "PopupScript";
String cstext1 = "<script type=\"text/javascript\">" +
"alert('ssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssdssssd');</" + "script>";
RegisterStartupScript(csname1, cstext1);
You need to use the jQuery UI dialog (http://jqueryui.com/demos/dialog/). It allows you to write things like:
<script type="text/javascript">
$(function () {
$("#dialog").dialog({
bgiframe: true,
draggable: true,
resizable: true,
height: 460,
width: 800,
modal: true,
buttons: {
Ok: function () {
$(this).dialog('close');
}
}
});
});
</script>
Where dialog is the id of a div tag that holds the content you want to display as a dialog.