Posted on September 25, 2007 by abhimjoshi
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);”);
Abhishek Joshi
Filed under: Javascript | Leave a Comment »
Posted on September 22, 2007 by abhimjoshi
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 [...]
Filed under: Asp.Net, C#, Dataset | Leave a Comment »
Posted on September 1, 2007 by abhimjoshi
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 ));
Abhishek Joshi
Filed under: Asp.Net | Leave a Comment »