Javascript to Allow only numbers in TextBox
======================================
<script language=”javascript” type=”text/javascript”>
function CheckKeyCode(e)
{
if (navigator.appName == “Microsoft Internet Explorer”)
{
if((e.keyCode >= 48 && e.keyCode <= 57) || (e.keyCode == 8))
{
return true;
}
else
{
return false;
}
}
else
{
if ((e.charCode >= 48 && e.charCode <= 57) || (e.charCode == 0))
{
return true;
}
else
{
return false;
}
}
}
</script>
// Add this code in your GridView control’s RowDataBound Event.
((TextBox)e.Row.FindControl(“txtDispOrder”)).Attributes.Add(“onkeypress”, “javascript:return CheckKeyCode(event);”);
Archive for September, 2007
Javascript to Allow only numbers in TextBox
Posted in Javascript on September 25, 2007 | 5 Comments »
Data Access Application Block Gets Batch Update Functionality in Enterprise Library 3.0
Posted in Asp.Net, C#, Dataset on September 22, 2007 | 1 Comment »
In Enterprise Library 3.0, the Data Access Application Block now supports batch updates functionality. This helps us to eliminate number of roundtrips with the Database.
The syntax for the update dataset is as follows
Database.UpdateDataSet(DataSet dataSet, string tableName,
DbCommand insertCommand, DbCommand updateCommand,
DbCommand deleteCommand, UpdateBehavior updateBehavior,
int? updateBatchSize);
Consider one table named Student as follows
Studentid , Name, Address, [...]
Convert a string to Proper Case
Posted in Asp.Net on September 1, 2007 | Leave a Comment »
Convert a string to Proper Case
===========================
// Use this Namespace
using System.Globalization;
// Code
string myString = “thIS is tHE sAmple tExt to shoW tHIs examPle !!”;
TextInfo TI = new CultureInfo(“en-US”,false).TextInfo;
Response.Write (TI.ToTitleCase( myString ));