Geeks With Blogs

News


Google RankGoogle PRâ„¢ - Post your Page Rank with MyGooglePageRank.com



The content on this site represents my own personal opinions and thoughts at the time of posting, and does not reflect those of my employer's in any way.

Disclaimer:- All postings in this blog is provided "AS IS" with no warranties, and confers no rights.
Gaurav Taneja Great dreams... never even get out of the box. It takes an uncommon amount of guts to put your dreams on the line, to hold them up and say, "How good or how bad am I?" That's where courage comes in. March 2008 Entries
Converting Datetime to dd/mm/yyyy hh:mm AM/PM format
Displays date time in 26/03/2008 09:30AM CONVERT(VARCHAR,PostedDate,... '+SUBSTRING(CONVERT(VARCHAR... ' +SUBSTRING(CONVERT( VARCHAR,getdate(),100),LEN(... change the getdate() according to your field name Below one displays the date as 26/03/2008 09:30 AM CONVERT(VARCHAR,getdate(),1... '+ left(right('0'+LTRIM(RIGHT(... ' ' + right(RIGHT('0'+LTRIM(RIGHT... ......

Posted On Monday, March 24, 2008 11:04 PM

Fetching Data Key in Row Command
protected void gvArtist_RowCommand(object sender, GridViewCommandEventArgs e) { int intUserGridID=0; if (e.CommandName == AdminConstantKeys.ViewGigsC... { int intHeaderMasterID = -1; GridViewRow grArtist = ((Control) (e.CommandSource)).NamingCo... as GridViewRow; //Check if command raised by DataRow or not if (grArtist.RowIndex != -1) { intUserGridID = int.Parse(gvArtist.DataKeys... [AdminConstantKeys.UserID].... Session[AdminConstantKeys.G... ......

Posted On Friday, March 14, 2008 12:02 AM

General Validation Hint in CS File
public bool CheckError() { //check error for all records strError.Append("<Result... bool blnReturnVal = true; for (int i = 0; i < dtbValidate.Rows.Count; i++) { DataRow drValidation = dtbValidate.Rows[i]; string command = drValidation["command"].ToS... # region validation check switch (command) { case "required": { if (drValidation["value"].ToSt... <= 0) { strError.Append("<Error code='" + drValidation["errCode"].ToS... ......

Posted On Thursday, March 13, 2008 11:56 PM

Server Validation for Time HH:MM M/PM format
case "time": { //Regex regExpression = new Regex(@"^(\d{2}):(\d{2})\s{... //new Regex(@"^(\d{2}):(\d{2})\s{... // ^(([1-9]{1})|([0-1][1-2])|(... Regex regExpression = new Regex(@"^(([1-9]{1})|([0-1]... if (drValidation["value"].ToSt... > 0) if (!regExpression.IsMatch(drV... { strError.Append("<Error ......

Posted On Thursday, March 13, 2008 11:52 PM

Time Validation HH:MM AM/PM format
case "Time": { var re=/^(([1-9]{1})|([0-1][1-2... var charpos = objValue.value.search(re); if(objValue.value.length >= 0 && charpos < 0) { //alert(charpos); if(!strError || strError.length ==0) { strError = objValue.name; }//if //alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); objErrorLbl.innerHTML = strError; return false; }//if break; } Add this Case in the article published before for the Javascript ......

Posted On Thursday, March 13, 2008 11:49 PM

Javascript validation in CS file
/// <summary> /// Apply Java Script Validation on Form /// </summary> private void ApplyValidation() { StringBuilder strClientScript = new StringBuilder(); string strErrorMsg = string.Empty; strClientScript.Append(@" var frmvalidator = new Validator ('aspnetForm','" + btnSave.ClientID + "','','','" + lblErrorMessage.ClientID + "');"); //Apply Validation on Content Title strErrorMsg = CommonFunction.GetErrorMess... .Replace(AdminConstantKeys.... "User Name"); strClientScript.Append("frm... ......

Posted On Thursday, March 6, 2008 4:52 AM

How to Use the javascript file in the aspx file.?
<script type="text/javascript"> var hdnPopUp=document.getElemen... %>'); if(hdnPopUp.value!='') { var PopupUrl='../Common/SelectD... window.open(PopupUrl,null,'... } var frmvalidator = new Validator('aspnetForm','<... frmvalidator.addValidation(... ......

Posted On Thursday, March 6, 2008 4:43 AM

Javascript Validation
Javascript file // JScript File //Rollover images code function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.l... x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_prel... for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.01 var ......

Posted On Thursday, March 6, 2008 4:31 AM

Server Side Validation
public bool CheckError() { //check error for all records strError.Append("<Result... bool blnReturnVal = true; for (int i = 0; i < dtbValidate.Rows.Count; i++) { DataRow drValidation = dtbValidate.Rows[i]; string command = drValidation["command"].ToS... # region validation check switch (command) { case "required": { if (drValidation["value"].ToSt... <= 0) { strError.Append("<Error code='" + drValidation["errCode"].ToS... ......

Posted On Thursday, March 6, 2008 3:30 AM

Copyright © Gaurav Taneja | Powered by: GeeksWithBlogs.net