Google+

Monday, May 30, 2011

CSS Quick Reference





Saturday, May 28, 2011

Regular Expression For Mobile validation



         Hi , regular expression is a text matching mechanism . suppose you want to validate whether given input to textbox is mobile number or not? , then regular expression is good way.


         To validate mobile like(+9548508412 or 9548508412 or  95485084121 ) , means if you want that mobile number should be at least 10 digit long and  '+' is optional ,  you can use these regular expression :


\+?\d{10,}





Note:-Please comment and reply me.

Sunday, May 15, 2011

Check Special Characters in String using JavaScript


Check Special Characters in String using JavaScript


Sometimes situation arises when you want to check for special characters in a string. But in JavaScript there is no direct methods that can check for Special Characters. To achieve this will have to use the JavaScript programming to develop an code that will perform the job of checking for special characters. The main part that perform this operation are the for loop construct and the indexOf method in JavaScript.
Here data is collection of character that contain special characters like:-
  var data =" 123,abc@aw$opjk";


Saturday, May 14, 2011

Textbox Character Count using javascript





Textbox Character Count





Thursday, May 5, 2011

Add Icon to webpage url





To add an icon to your URL:

  1. You need an icon. There are plenty of icons on your pc to pick from. Use windows search and look for *.ico Or you can create one go here
  2. Upload the icon to your directory on line the same location of the index.html
  3. Rename the icon on line to favicon.ico
  4. Add both lines below to the head of your index.html page
<.link rel="icon" type="image/ico" href="favicon.ico"><./link>
<.link rel="shortcut icon" href="favicon.ico"><./link>



Also you can add an animated icon, just create an animated gif 16 x 16 and upload it to the root directory and add this code. It works only with Firefox browser. 


<.link rel="shortcut icon" type="image/gif" href="animated_favicon.gif">


They all will look like this 


<.link rel="shortcut icon" type="image/ico"favicon.ico">
<.link rel="shortcut icon" type="image/gif" href="animated_favicon.gif">
<.link rel="shortcut icon" href="favicon.ico">



Also just upload the favicon.ico to the root directory of the site all new browsers will find it.

Wednesday, May 4, 2011

Get Column Name in IDataReader


     DataTable dataTable = reader.GetSchemaTable();
            string[] colValue = new string[9];
            int counter = 0;
            foreach (DataRow row in dataTable.Rows)
            {
                using (DataColumn col = dataTable.Columns[0])
                {
                    colValue[counter] = row[col].ToString();
                    counter++;
                }
            }


Note:-Please comment and reply me.

Get Details OF Column in IDataReader

 
IDataReader reader = null;

    reader = ---some  function return IDataReader----

  DataTable dataTable = reader.GetSchemaTable();


Note:-Please comment and reply me.

DataTable.Columns Property

The following example prints each value of each row in a table using the Columns property.



private void PrintValues(DataTable table)
{
    foreach(DataRow row in table.Rows)
    {
        foreach(DataColumn column in table.Columns)
        {
            Console.WriteLine(row[column]);
        }
    }
}


Note:-Please comment and reply me.

Monday, May 2, 2011

New Features of ASP.NET 4.0

Check out this SlideShare Presentation:

Sunday, May 1, 2011

Fetch All Information About Client Request


You get all infomation about the client request by request header.In ASP.NET,

 you get all  request header infromation by using these:-

NameValueCollection variables = Request.ServerVariables;

To get user agent information use below :-

            string agent = variables["HTTP_USER_AGENT"];


To get user agent information use below :-


 Request.ServerVariables["HTTP_X_FORWARDED_FOR"]



Note:-Please comment and reply me.