26.10.08

Validators and someuseful data

REGULAR EXPRESSION

Name:Regular Expression validator: user not to enter numeric values in textbox and special character.
([A-Za-z]+[ ])*([A-Za-z]+)*
---------------------------------
Postcode:Regular Expression Validator :user not to enter only special characters.

([A-Za-z]+[0-9])*([A-Za-z]+)*

([A-Za-z]+[0-9])*([A-Za-z]+[0-9])*
-----------------------------------------
Regular Expression for Postcode:
([A-Za-z0-9])*
---------------------------------
mobile number:regular expression for
([0-90-9]+[-])*([0-90-9]+)*
-----------------------------------
mobile number:regular expression for
([0-90-9]+[-])*([0-90-9]+)*
--------------------------------------------------------

mobile number:regular expression with space and hyphen
([0-9]+[- ])*([0-9]+)*
--------------------------------------------------------
Card Number Regular Expression:

([0-9])*
==========================================================
Password field: enter less than 5 character

----------------------------------
COLLATE SQL_LATIN1_General_CP1_CS_AS
-----------------------------------------

17.7.08

Access CSS in a code behind then use the following code

HtmlLink cssLink = new HtmlLink();
cssLink.Href = "%CSS FILE URL HERE%";
cssLink.Attributes.Add( "rel", "stylesheet" );
cssLink.Attributes.Add("type", "text/css");
Master.Page.Header.Controls.Add(cssLink);

12.7.08

How do I access an iFrame's source's variable from javascript??

document.getElementById('FrameName').contentDocument.getElementById('VarName').innerHTML

so simple, yet so hard to discover lol...

30.6.08

Setting meta tags for content pages in ASP.NET 2.0

If you set the meta tags in the master page, all your pages will have the same meta tags.

Dim metaTag As New HtmlMeta
Dim HeadTag As HtmlHead = CType(Page.Header, HtmlHead)
metaTag.Attributes.Add("name", "description")
metaTag.Attributes.Add("content", "your description goes here")
HeadTag.Controls.Add(metaTag)
metaTag = New HtmlMeta
metaTag.Attributes.Add("name", "keywords")
metaTag.Attributes.Add("content", "your keyword go here")
HeadTag.Controls.Add(metaTag)

Insert and Update Query

IF EXISTS(
SELECT 1
FROM MY_TABLE
WHERE ITEM='somevalue' AND ENTERDATE='12/31/1999')
--Update Statement
UPDATE MY_TABLE
SET ITEM='anothervalue'
WHERE ITEM='somevalue' AND ENTERDATE='12/31/1999'
ELSE
--Insert Statement
INSERT INTO MY_TABLE
(ITEM, ENTERDATE)
VALUES
('somevalue', '12/31/1999')

Print button with javascript - fast and simple solution

The simplest way to print a web form is to use client side javascript. To print a web page, you can use code like this:

<input type="button" value="Print" onclick="window.print();">

This HTML code will return a Print button like bellow. You can click it to print this page.


for more information see this link :