Thursday, April 10, 2008

JavaScript function for resticated first character as a blank space

function hasWhiteSpaceE()
{
var s = document.getElementById('txtEmail').value;
reWhiteSpace = new RegExp(/^\s+$/);

// Check for white space
if (reWhiteSpace.test(s)) {
alert("Please Check Your Fields For Spaces");
document.getElementById('txtEmail').value="";
document.getElementById('txtEmail').focus();
return false;
}


}
unction for

Wednesday, April 9, 2008

call protected string on javascript

function logedin() {
var logedin = '[%=LoginCheck %]' ;
if (logedin == "NotLogedin")
{
alert('hi');
showMsgDetails2();
}
}
on aspx.cs page
protected string LoginCheck = string.Empty;

if (Session["clientId"] == null)///For client side checking whetever user in loged in or not. {
lblInivitationMsg.Text = "You must be logged in to use this feature.";
LoginCheck = "NotLogedin";
}