http://www.aspsnippets.com/Articles/Building-Modal-Popup-using-ASPNet-AJAX-ModalPopupExtender-Control.aspx
Friday, 10 October 2014
Wednesday, 9 April 2014
Disable browser back button using javascript
Disable back button in Browser Using Javascript
Thursday, 30 January 2014
allow user to enter only "Numbers" and if required, only one dot "."
Try this:
<asp:TextBox ID="TextBox1" onkeypress="return numericOnly(this);" runat="server"></asp:TextBox>
<script type="text/JavaScript">
<!--
function numericOnly(elementRef)
{
var keyCodeEntered = (event.which) ? event.which : (window.event.keyCode) ? window.event.keyCode : -1;
<!--
function numericOnly(elementRef)
{
var keyCodeEntered = (event.which) ? event.which : (window.event.keyCode) ? window.event.keyCode : -1;
// Un-comment to discover a key that I have forgotten to take into account...
//alert(keyCodeEntered);
//alert(keyCodeEntered);
if ( (keyCodeEntered >= 48) && (keyCodeEntered <= 57) )
{
return true;
}
// '+' sign...
else if ( keyCodeEntered == 43 )
{
// Allow only 1 plus sign ('+')...
if ( (elementRef.value) && (elementRef.value.indexOf('+') >= 0) )
return false;
else
return true;
}
// '-' sign...
else if ( keyCodeEntered == 45 )
{
// Allow only 1 minus sign ('-')...
if ( (elementRef.value) && (elementRef.value.indexOf('-') >= 0) )
return false;
else
return true;
}
// '.' decimal point...
else if ( keyCodeEntered == 46 )
{
// Allow only 1 decimal point ('.')...
if ( (elementRef.value) && (elementRef.value.indexOf('.') >= 0) )
return false;
else
return true;
}
{
return true;
}
// '+' sign...
else if ( keyCodeEntered == 43 )
{
// Allow only 1 plus sign ('+')...
if ( (elementRef.value) && (elementRef.value.indexOf('+') >= 0) )
return false;
else
return true;
}
// '-' sign...
else if ( keyCodeEntered == 45 )
{
// Allow only 1 minus sign ('-')...
if ( (elementRef.value) && (elementRef.value.indexOf('-') >= 0) )
return false;
else
return true;
}
// '.' decimal point...
else if ( keyCodeEntered == 46 )
{
// Allow only 1 decimal point ('.')...
if ( (elementRef.value) && (elementRef.value.indexOf('.') >= 0) )
return false;
else
return true;
}
return false;
}
// -->
</script>
Note that I attached the event handler to the element in the HTML declaration. This will work, but will produce a compiler warning. The proper way to do this for a server control is in the Page_Load handler of the server-side code like this:
TextBox1.Attributes.Add("onkeypress", "return numericOnly(this);");
}
// -->
</script>
Note that I attached the event handler to the element in the HTML declaration. This will work, but will produce a compiler warning. The proper way to do this for a server control is in the Page_Load handler of the server-side code like this:
TextBox1.Attributes.Add("onkeypress", "return numericOnly(this);");
Tuesday, 21 January 2014
Export grid data to excel and other format
http://www.developerhelpdesk.com/export-to-excel-pdf-word-without-third-party-dll/#comment-12559
Subscribe to:
Comments (Atom)

