Archive

Archive for March, 2014

Show jQuery UI Dialog Popup Window from Server Side

March 16, 2014 1 comment

Hi all,

try this example to Show jQuery UI Dialog Popup Window from Server Side

In Previous post i posted an example

Display JQuery Popup Window from Server Side

HTML Markup :


<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/jquery-ui.js" type="text/javascript"></script>
<link href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/themes/start/jquery-ui.css" rel="stylesheet"
type="text/css" />
<script type="text/javascript">
 function ShowPopup(message,title) {
 $(function () {
 $("#dialog").html(message);
 $("#dialog").dialog({
 title: title,
 buttons: {
 Close: function () {
 $(this).dialog('close');
 }
 },
 modal: true
 });
 });
 };
</script>
<div id="dialog" style="display: none">
</div>
<asp:Button ID="btnShowPopup" runat="server" Text="Show Popup" OnClick="btnShowPopup_Click" />

In Code behind :


protected void btnShowPopup_Click(object sender, EventArgs e)
{
 string message = "Changes Updated Successfully";
 string title = " Update Current Tariff Details";
 ClientScript.RegisterStartupScript(this.GetType(), "Popup", "ShowPopup('" + message + "','" + title +
"');", true);
}

Hope this helps

Good Luck.

 

 

Categories: ASP.Net, Jquery

Allow Only English Characters for Username in CreateUserWizard Control

March 16, 2014 Leave a comment

Hi all,

try this example to Allow Only English Characters for Username in CreateUserWizard Control

In ASPX Page :

<asp:CreateUserWizard runat="server" CreatingUser="wizard_CreatingUser" />

In Code behind :


protected void wizard_CreatingUser(object sender, LoginCancelEventArgs e)
{
 e.Cancel = Regex.IsMatch(((CreateUserWizard)sender).UserName, "^[a-zA-Z0-9]*$");
}

Hope this helps

Good Luck

Categories: ASP.Net

Disable Drag and Drop in Textbox or Textarea Controls

March 2, 2014 Leave a comment

Hi all,

try this example to Disable Drag and Drop in Textbox or Textarea Controls

To stop drag and drop option in textbox or textarea we need to set some of properties in body tag for that check below


<html>
<head>
</head>
<body ondragstart="return false" draggable="false">
<b>Try to Drag and Drop Text Here :</b> <input type="text" name="txt" id="txtname" />
</body>
</html>

Hope this helps

Good Luck.

Categories: ASP.Net