<script language=javascript>
function NumberOnly()
{
var keyCode = event.keyCode;
if(keyCode > 47 && keyCode < 58)
{
return true;
}
else
{
return false;
}
}
</script>
<asp:TextBox ID="txt" runat="server" onkeypress="return NumberOnly()"></asp:TextBox>
Place the Script in the keyPress Event of the textbox to see the result.
Script to Make TextBox to Enter Only NUMBER
Monday, September 17, 2007 | 0 Comments
To write a Script in server side in Asp.net
Syntax :
ScriptManager.RegisterStartupScript(Control control,type type,string Key,string Script,bool addScriptTags)
Example:
string s = "alert('Hello')";
ScriptManager.RegisterStartupScript(this, this.GetType(), "Hello", s, true);
If you give the script tag in the string s then give addScriptTags to false.
ScriptManager is a class inside System.Web.UI
As a result a alert box with 'hello' pops up, where you place this line.
Wednesday, September 12, 2007 | 0 Comments
Authorization
Authorization is to determine whether an identity should be granted the requested type of access to a given resource.
users: Assign a list of users to be granted or denied access
Roles: Assign a list of roles to be granted or denied access
<allow users="Don , Jim" roles="Admins" /> //Allow only two user Don,Jim
<deny users="*" /> //Restrict all other user
</authorization>
//Allow All the user to access
<allow users="*" />
</authorization>
* Refers to all identities
? Refers to the anonymous identity
Tuesday, September 11, 2007 | 0 Comments