Friday, 22 March 2013



                 

What is RegularExpression:-

            RegularExpression is also known as Regxp.by using RegularExpression First you have set some property of the RegularExpression are as follow

  • Add a RegularExpressionValidator control to your page.
  • Set the ControlToValidate property to indicate which control to validate.
  • Set the ValidationExpression property to an appropriate regular expression.
  • Set the ErrorMessage property to define the message to display if the validation fails.
 

Description:-


in this example we explain all validation like email validation,phone number or Mobile number validation,URL validation,Zipcode,validation Password etc.......

we all know that the Validation is main part in every place when the Form data is submited.
For exaple:- suppose you enter your Name in Digit and your Mobile Number in String Format is not a proper way so for this Reason we can use Validation Before Our data is Submited to the Server.

 through validation we can also reduce the load in server because the your data validation is checked in Clientside and then after it is valid then and then submited to server for further process otherwise you show a validation message like enter mobile number 10 digit only or your Email id is not Valid.


  so through validation you can built your website very smoothly. 


example of all validators like EmailValidator,Mobile no validator etc... in asp.net



                 

What is RegularExpression:-

            RegularExpression is also known as Regxp.by using RegularExpression First you have set some property of the RegularExpression are as follow

  • Add a RegularExpressionValidator control to your page.
  • Set the ControlToValidate property to indicate which control to validate.
  • Set the ValidationExpression property to an appropriate regular expression.
  • Set the ErrorMessage property to define the message to display if the validation fails.
 

Description:-


in this example we explain all validation like email validation,phone number or Mobile number validation,URL validation,Zipcode,validation Password etc.......

we all know that the Validation is main part in every place when the Form data is submited.
For exaple:- suppose you enter your Name in Digit and your Mobile Number in String Format is not a proper way so for this Reason we can use Validation Before Our data is Submited to the Server.

 through validation we can also reduce the load in server because the your data validation is checked in Clientside and then after it is valid then and then submited to server for further process otherwise you show a validation message like enter mobile number 10 digit only or your Email id is not Valid.


  so through validation you can built your website very smoothly. 



Description:-

                  in this example we explain how to create a Fancy slide show of an Image witout Refreshing the page using Jquery.

today in Every Application or in Every website we all show that Slide show of the Buisness relative Images are Displayed in Slide show. so you can easily create a Beautiful Slide show and put it in your Application.

in which we use the jquery fadeOut() and  fadeIn() Function to move the image one by one from right to left and continuesoly display image from the bunch of image that we already set it in advance in design time.


Fancy Slideshow of Image Gallery in JQuery Slide Show in JQuery 

Fancy and Beautiful Login Popup in JQuery SignUp and Login Popup in Jquery  

how to Create Image slide show or Image Slider Using JQuery in asp.net


Description:-

                  in this example we explain how to create a Fancy slide show of an Image witout Refreshing the page using Jquery.

today in Every Application or in Every website we all show that Slide show of the Buisness relative Images are Displayed in Slide show. so you can easily create a Beautiful Slide show and put it in your Application.

in which we use the jquery fadeOut() and  fadeIn() Function to move the image one by one from right to left and continuesoly display image from the bunch of image that we already set it in advance in design time.


Fancy Slideshow of Image Gallery in JQuery Slide Show in JQuery 

Fancy and Beautiful Login Popup in JQuery SignUp and Login Popup in Jquery  

This entry was posted in :


Description:-

                  in this example we explain that how to create  onclick,onmouseover,onmousemove or other event   in Gridview Row at runtime or in CodeBehind Class.

When user is Move Mouse on Each Row of GridView you Can Perform Anything or Display Detail of Each Row in a ModalPopup.same thing you will perform with Onclick or OnMouseOver Event. This is  a one kind of facility or you can change the Color of the Row when Mouse is Clicked on each Row.

use of this example are as follws:-

  1. you can perform the onclick event in each row of gridview and you can change the color of row that are clicked or selected.
  1. you can perform the onmouse over method and its Detail are display in popup window
  2. you can also send the ID of each row to the next page when row is clicked.



how to create onclick,onmouse over,onmouseout event from code behind page in asp.net



Description:-

                  in this example we explain that how to create  onclick,onmouseover,onmousemove or other event   in Gridview Row at runtime or in CodeBehind Class.

When user is Move Mouse on Each Row of GridView you Can Perform Anything or Display Detail of Each Row in a ModalPopup.same thing you will perform with Onclick or OnMouseOver Event. This is  a one kind of facility or you can change the Color of the Row when Mouse is Clicked on each Row.

use of this example are as follws:-

  1. you can perform the onclick event in each row of gridview and you can change the color of row that are clicked or selected.
  1. you can perform the onmouse over method and its Detail are display in popup window
  2. you can also send the ID of each row to the next page when row is clicked.



       

Description:-
           
In this example I will explain that how to delete multiple rows or records in GridView based on CheckBox selection and with displaying confirmation message box before deleting rows in ASP.Net.

In which I have added a template field with checkboxes with each and every rows of gridview and  also I have added a check all checkbox in the Header Template of the ASP.net GridView Control. When user check the header checkbox the all rows’s checkbox  will be automatically checked.

This  is nothing but a It is one kind of Facility that for example suppose you have Delete 100  Record  or All Record in Gridview at that this Example is very useful Because you can Select All Record through Checkbox and press delete Button the all Record are Deleted successfully otherwise you have to Delete Record one by one and it is very time consuming process so that this Facility is very useful.

In this Example we provide Facility to user just Checkmark on the Header Checkbox the All Record that are Display in Gridview are Checked. And when Uncheckmark the Header Checkbox All Record that are Display on Gridview are Unchecked.

You can also Delete Selected Record for example suppose Gridview contains 100 Record and we want to delete a  5 and 25 and 35 number Record so it is possible through this Example. 


How To Delete multiple rows from GridView with Checkbox Selection in Asp.net

       

Description:-
           
In this example I will explain that how to delete multiple rows or records in GridView based on CheckBox selection and with displaying confirmation message box before deleting rows in ASP.Net.

In which I have added a template field with checkboxes with each and every rows of gridview and  also I have added a check all checkbox in the Header Template of the ASP.net GridView Control. When user check the header checkbox the all rows’s checkbox  will be automatically checked.

This  is nothing but a It is one kind of Facility that for example suppose you have Delete 100  Record  or All Record in Gridview at that this Example is very useful Because you can Select All Record through Checkbox and press delete Button the all Record are Deleted successfully otherwise you have to Delete Record one by one and it is very time consuming process so that this Facility is very useful.

In this Example we provide Facility to user just Checkmark on the Header Checkbox the All Record that are Display in Gridview are Checked. And when Uncheckmark the Header Checkbox All Record that are Display on Gridview are Unchecked.

You can also Delete Selected Record for example suppose Gridview contains 100 Record and we want to delete a  5 and 25 and 35 number Record so it is possible through this Example. 


 


Description:-

 In this example we Explain That how to call Javascript Function from the CodeBehind or aspx.cs File in asp.net.in which we also explain how to get Gridview Cell value or Rows to perform the operation using javascript

the main use of this example is that we can display the description of each row in a modal popup when user move mouse in each row of the Gridview the javascript function is called and display this row detail in modal popup.

Generally to Create this Type Effect we Have to Define a RowDataBound Event of the Gridview in which we define Click event in each Row of gridview.

Explanation of this example:-

                      in this example when user move mouse in gridview row that time javascript function is call with  two argument RowIndex and Id.

in javascript function we can use this two argument and display this row Detail in modal popup.

File Upload Example in MVC4 Upload File and bind to Gridview

Read/Write File in asp.net Read/write file using c#


How to Call Javascript Function from Codebehind page or .aspx.cs in Asp.net

 


Description:-

 In this example we Explain That how to call Javascript Function from the CodeBehind or aspx.cs File in asp.net.in which we also explain how to get Gridview Cell value or Rows to perform the operation using javascript

the main use of this example is that we can display the description of each row in a modal popup when user move mouse in each row of the Gridview the javascript function is called and display this row detail in modal popup.

Generally to Create this Type Effect we Have to Define a RowDataBound Event of the Gridview in which we define Click event in each Row of gridview.

Explanation of this example:-

                      in this example when user move mouse in gridview row that time javascript function is call with  two argument RowIndex and Id.

in javascript function we can use this two argument and display this row Detail in modal popup.

File Upload Example in MVC4 Upload File and bind to Gridview

Read/Write File in asp.net Read/write file using c#


 


Description:-

  In this example we explain how to redirect to .aspx File from Javascript Function. there is a sitution when the we set timer in javascript function when the time is up then the page is redirect to specify .aspx page. 

To show the Example How to Create Timer in javascript Click Here Create Timer or Display Clock

To Redirect the page in javascript the Location Object is Used:

          Location Object is the PreDefined Object Available in Javascript. It is not created By the User and Location Object Holds the Information of the Current URL.

Property of Javascript Location Objects
Name
Description

host
Specifies the host and domain name, or IP address, of a network host.

hostname
Specifies the host:port portion of the URL.

href
Specifies the entire URL.

pathname
Specifies the URL-path portion of the URL.

protocol
Specifies the beginning of the URL, including the colon.


Methods of Javascript Location Objects
Name
Description

reload
Forces a reload of the window's current document.

replace
Loads the specified URL over the current history entry.


this is very useful example when you have to Redirect your page at Design time means in .Aspx page not in .aspx.cs page so at that time you compulsary have to use a JavaScript.


to show Example of How to Display Gridview Row Detail in Javascript Popup click here Display Gridview ARow Detail in Javascript Popup


to show example of how to create timer or display clock in javascript click here create timer or display clock in javascript

to show example of how to display current time in webpage click here Display current time in webpage

how to Redirect to another aspx page in Javascript

 


Description:-

  In this example we explain how to redirect to .aspx File from Javascript Function. there is a sitution when the we set timer in javascript function when the time is up then the page is redirect to specify .aspx page. 

To show the Example How to Create Timer in javascript Click Here Create Timer or Display Clock

To Redirect the page in javascript the Location Object is Used:

          Location Object is the PreDefined Object Available in Javascript. It is not created By the User and Location Object Holds the Information of the Current URL.

Property of Javascript Location Objects
Name
Description

host
Specifies the host and domain name, or IP address, of a network host.

hostname
Specifies the host:port portion of the URL.

href
Specifies the entire URL.

pathname
Specifies the URL-path portion of the URL.

protocol
Specifies the beginning of the URL, including the colon.


Methods of Javascript Location Objects
Name
Description

reload
Forces a reload of the window's current document.

replace
Loads the specified URL over the current history entry.


this is very useful example when you have to Redirect your page at Design time means in .Aspx page not in .aspx.cs page so at that time you compulsary have to use a JavaScript.


to show Example of How to Display Gridview Row Detail in Javascript Popup click here Display Gridview ARow Detail in Javascript Popup


to show example of how to create timer or display clock in javascript click here create timer or display clock in javascript

to show example of how to display current time in webpage click here Display current time in webpage



Description:-

                     in this example we can create a Timer and redirect to the other page when the time is up.

For Ex:-


           this type of example is very useful in online examination system. when the exam is start the timer is also start and continue display remaining time on right side and when the time is up the page is automatically redirected to another page.


Using timer Event in Javascript there are Four Types
  • setTimeout();
  • clearTimeout();
  • setInterval();
  • clearInterval().



setInterval():-
                        using SetInterval you can Call Function at Specified Interval like for Ex:-
setInterval(codeToExecute, timeIntervalInMilliseconds)
it will call Function Every Specified time means more than once time.

SetTimeout():-
                  
                       using this Function you can call Function at specified Time. it can be called only once like after 2 second or 5 second.
for ex:-setTimeout(Foo, 2000);

How to Stop the Timer:-

            To stop the Time you have to use ClearInterval(timervariable) or ClearTimeout(timervariable) Function. If you use SetTimeout() then you have to use ClearTimeout() and if you use SetInterval() then you have to use ClearInterval() Function.                

Here is some link that is very useful for same programming like :-

to show example of enter on Alphabet Character in TextBox click here Enter only Alphabet Character in TextBox


MVC Registration form with all Validation in MVC client and server side validation in MVC4

Insert,Update,Delete in Gridview without postback CRUD operation without refresh the page

Bind data in Accordion Control from database bind Dynamic data in Accordion Control

inner zoom effect of image bind into gridview from database Display Inner zoom Effect of the image in Gridview

how to crete timer or display clock using javascript in asp.net




Description:-

                     in this example we can create a Timer and redirect to the other page when the time is up.

For Ex:-


           this type of example is very useful in online examination system. when the exam is start the timer is also start and continue display remaining time on right side and when the time is up the page is automatically redirected to another page.


Using timer Event in Javascript there are Four Types
  • setTimeout();
  • clearTimeout();
  • setInterval();
  • clearInterval().



setInterval():-
                        using SetInterval you can Call Function at Specified Interval like for Ex:-
setInterval(codeToExecute, timeIntervalInMilliseconds)
it will call Function Every Specified time means more than once time.

SetTimeout():-
                  
                       using this Function you can call Function at specified Time. it can be called only once like after 2 second or 5 second.
for ex:-setTimeout(Foo, 2000);

How to Stop the Timer:-

            To stop the Time you have to use ClearInterval(timervariable) or ClearTimeout(timervariable) Function. If you use SetTimeout() then you have to use ClearTimeout() and if you use SetInterval() then you have to use ClearInterval() Function.                

Here is some link that is very useful for same programming like :-

to show example of enter on Alphabet Character in TextBox click here Enter only Alphabet Character in TextBox


MVC Registration form with all Validation in MVC client and server side validation in MVC4

Insert,Update,Delete in Gridview without postback CRUD operation without refresh the page

Bind data in Accordion Control from database bind Dynamic data in Accordion Control

inner zoom effect of image bind into gridview from database Display Inner zoom Effect of the image in Gridview

Tuesday, 19 March 2013


                  



Description:-                


In this example we explain that how to Display PageTotal and GranTotal in your GridView.
Listen this thing you have a Qustion in Your Mind is that what is PageTotal and What is GrandTotal.so now we explain that suppose your Gridview Contain 10 pageview with 20 rows in each pageview so finally your Gridview can contain 200 rows.

So Pagetotal means  total of each pageview so in this case total of 20 Record because our Gridview contain 20 Record in each pageview.

And now the GrandTotal means the Total of All pageview so in this case total of 200 Record because our Griview can contain 10 Pageview with 20 record in each pageview so 20*10=200.

We also provide Facility for Edit and Delete Record and main Important point is that the calculation of PageTotal and GrandTotal are Automatically change as per record Deleted.
To do this we Create all Calculation in RowdataBound Event of the GridView are as Follow

if (e.Row.RowType == DataControlRowType.Footer)

        {

            Label rn = (Label)e.Row.FindControl("lblrn");

            Label gr = (Label)e.Row.FindControl("lblgrand");

            rn.Text = irn.ToString();

            gr.Text = to();

        }
 
Look at this It will Check that this RowType is Footer then it will Find Label in Footer in each row and assign Total to this Label. Here to is the Function that will Return the Total of all row in Gridview.

public string to()

    {

        string con = @"Data Source=SQLDB;Initial Catalog=Demo;User ID=Demod;Password=Demo1@";

        String q2 = "select sum(total) from manage";

        SqlConnection cn = new SqlConnection(con);

        SqlCommand cmd1 = new SqlCommand(q2, cn);

        cn.Open();

        string total = cmd1.ExecuteScalar().ToString();

        return total;

    }

So this type of Facility are very useful  In Billing System to Generate a Bill Report.


Here is some link that is very useful for same programming like :-

to show Example of Bind data from XML file to DataList click here Read/Insert from XML file and bind to DataList


MVC Registration form with all Validation in MVC client and server side validation in MVC4

Insert,Update,Delete in Gridview without postback CRUD operation without refresh the page

Bind data in Accordion Control from database bind Dynamic data in Accordion Control

inner zoom effect of image bind into gridview from database Display Inner zoom Effect of the image in Gridview
  to show Example of insert,update,delete in gridview using Three Tier Architecture please click here Three Tier Architecture For insert,update,Delete

how to display pagetotal and grand total in gridview Footer Template in asp.net


                  



Description:-                


In this example we explain that how to Display PageTotal and GranTotal in your GridView.
Listen this thing you have a Qustion in Your Mind is that what is PageTotal and What is GrandTotal.so now we explain that suppose your Gridview Contain 10 pageview with 20 rows in each pageview so finally your Gridview can contain 200 rows.

So Pagetotal means  total of each pageview so in this case total of 20 Record because our Gridview contain 20 Record in each pageview.

And now the GrandTotal means the Total of All pageview so in this case total of 200 Record because our Griview can contain 10 Pageview with 20 record in each pageview so 20*10=200.

We also provide Facility for Edit and Delete Record and main Important point is that the calculation of PageTotal and GrandTotal are Automatically change as per record Deleted.
To do this we Create all Calculation in RowdataBound Event of the GridView are as Follow

if (e.Row.RowType == DataControlRowType.Footer)

        {

            Label rn = (Label)e.Row.FindControl("lblrn");

            Label gr = (Label)e.Row.FindControl("lblgrand");

            rn.Text = irn.ToString();

            gr.Text = to();

        }
 
Look at this It will Check that this RowType is Footer then it will Find Label in Footer in each row and assign Total to this Label. Here to is the Function that will Return the Total of all row in Gridview.

public string to()

    {

        string con = @"Data Source=SQLDB;Initial Catalog=Demo;User ID=Demod;Password=Demo1@";

        String q2 = "select sum(total) from manage";

        SqlConnection cn = new SqlConnection(con);

        SqlCommand cmd1 = new SqlCommand(q2, cn);

        cn.Open();

        string total = cmd1.ExecuteScalar().ToString();

        return total;

    }

So this type of Facility are very useful  In Billing System to Generate a Bill Report.


Here is some link that is very useful for same programming like :-

to show Example of Bind data from XML file to DataList click here Read/Insert from XML file and bind to DataList


MVC Registration form with all Validation in MVC client and server side validation in MVC4

Insert,Update,Delete in Gridview without postback CRUD operation without refresh the page

Bind data in Accordion Control from database bind Dynamic data in Accordion Control

inner zoom effect of image bind into gridview from database Display Inner zoom Effect of the image in Gridview
  to show Example of insert,update,delete in gridview using Three Tier Architecture please click here Three Tier Architecture For insert,update,Delete

Monday, 18 March 2013

 

Description:-

            In this Example we explain that how to import or Fetch or Retrieve Contacts of Gmail of a user by using GContacts Data ApI. It is one kind of Functionality provide by Google and are used to Import Contacts of Gmail.

In this example we have developed a one social network site and in which we provide a Facility to user to Imports Its Contact from Gmail and Bind it to Gridview


To send SMS in Asp.Net to any User then click Here Send SMS or message in Asp.net

To Send Email in Asp.Net click Here Send Email to Other user in ASP.net

 To send Email with Attechment File click Here Send Email with Atteched File in Asp.Net

To Import Gmail Contact in Asp.Net click here Import contact from Gmail in asp.net

To send Email to Multiple User at a time based on checkbox selection click here Send Email to Multiple User in Asp.net

To Send Forgot to an Email in Asp.Net click here Send Forgot Password to user's Email
I used ASP.NET and C# for developing this application.
We need to follow below steps to get gmail contacts 

Step-1:  Download Google data API setup from the specified URL 

Or you can directly download with the following

That Set Up will installs set of Google Data dll’s (Google.GData.Apps.dll, Google.GData.Client.dll, Google.GData.Contacts.dll, Google.GData.Extensions.dll) into client installed Machine, you should collect that dll’s for your program.

Step-2:  Design our aspx page (Default.aspx) by using with the following UI as simple scenario.



<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <table border="1">
                <tr>
                    <td>Gmail User Name</td>
                    <td>
                        <asp:TextBox ID="txtunm" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>Gmail Password</td>
                    <td>
                        <asp:TextBox ID="txtpwd" runat="server" TextMode="Password"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <asp:Button ID="Fetchdatafromgmail" runat="server" Text="Fetchdatafromgmail" OnClick="Fetchdatafromgmail_Click" />
                    </td>
                </tr>
            </table>
        </div>
        <div>
            <asp:GridView ID="gvgmaildata" runat="server" CellPadding="4" EnableModelValidation="True" ForeColor="#333333" GridLines="None">
                <AlternatingRowStyle BackColor="White" />
                <EditRowStyle BackColor="#2461BF" />
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#EFF3FB" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            </asp:GridView>
        </div>

    </form>
</body>
</html>

 Step-3:  Add those downloaded google dll’s as reference to your website in visual studio->Solution Explorer ->Right Click-> Click on Add Reference….->Browse ->Get dll’s from Installed Location->Press OK.

Step-4: Code Behind Code



using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Google.GData.Contacts;
using Google.GData.Client;
using Google.GData.Extensions;
using Google.Contacts;
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    public static DataSet GetGmailData(string App_Name, string GmailUserName, string GmailPassword)
    {

        DataSet dsd = new DataSet();

        DataTable dtd = new DataTable();

        DataColumn Clmn = new DataColumn();

        Clmn.DataType = Type.GetType("System.String");

        Clmn.ColumnName = "EmailID";

        dtd.Columns.Add(Clmn);



        RequestSettings rs = new RequestSettings(App_Name, GmailUserName, GmailPassword);

        rs.AutoPaging = true;

        ContactsRequest cr = new ContactsRequest(rs);

        Feed<Contact> f = cr.GetContacts();

        foreach (Contact t in f.Entries)
        {

            foreach (EMail email in t.Emails)
            {

                DataRow rows = dtd.NewRow();

                rows["EmailID"] = email.Address.ToString();

                dtd.Rows.Add(rows);

            }

        }

        dsd.Tables.Add(dtd);

        return dsd;

    }
    protected void Fetchdatafromgmail_Click(object sender, EventArgs e)
    {

        DataSet ds = GetGmailData("MyNetwork Web Application!", txtunm.Text, txtpwd.Text);

        gvgmaildata.DataSource = ds;

        gvgmaildata.DataBind();
    }
}


how to import Contacts from GMAIL using ASP.NET and C#

 

Description:-

            In this Example we explain that how to import or Fetch or Retrieve Contacts of Gmail of a user by using GContacts Data ApI. It is one kind of Functionality provide by Google and are used to Import Contacts of Gmail.

In this example we have developed a one social network site and in which we provide a Facility to user to Imports Its Contact from Gmail and Bind it to Gridview


To send SMS in Asp.Net to any User then click Here Send SMS or message in Asp.net

To Send Email in Asp.Net click Here Send Email to Other user in ASP.net

 To send Email with Attechment File click Here Send Email with Atteched File in Asp.Net

To Import Gmail Contact in Asp.Net click here Import contact from Gmail in asp.net

To send Email to Multiple User at a time based on checkbox selection click here Send Email to Multiple User in Asp.net

To Send Forgot to an Email in Asp.Net click here Send Forgot Password to user's Email
I used ASP.NET and C# for developing this application.
We need to follow below steps to get gmail contacts 

Step-1:  Download Google data API setup from the specified URL 

Or you can directly download with the following

That Set Up will installs set of Google Data dll’s (Google.GData.Apps.dll, Google.GData.Client.dll, Google.GData.Contacts.dll, Google.GData.Extensions.dll) into client installed Machine, you should collect that dll’s for your program.

Step-2:  Design our aspx page (Default.aspx) by using with the following UI as simple scenario.



<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <table border="1">
                <tr>
                    <td>Gmail User Name</td>
                    <td>
                        <asp:TextBox ID="txtunm" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>Gmail Password</td>
                    <td>
                        <asp:TextBox ID="txtpwd" runat="server" TextMode="Password"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <asp:Button ID="Fetchdatafromgmail" runat="server" Text="Fetchdatafromgmail" OnClick="Fetchdatafromgmail_Click" />
                    </td>
                </tr>
            </table>
        </div>
        <div>
            <asp:GridView ID="gvgmaildata" runat="server" CellPadding="4" EnableModelValidation="True" ForeColor="#333333" GridLines="None">
                <AlternatingRowStyle BackColor="White" />
                <EditRowStyle BackColor="#2461BF" />
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#EFF3FB" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            </asp:GridView>
        </div>

    </form>
</body>
</html>

 Step-3:  Add those downloaded google dll’s as reference to your website in visual studio->Solution Explorer ->Right Click-> Click on Add Reference….->Browse ->Get dll’s from Installed Location->Press OK.

Step-4: Code Behind Code



using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Google.GData.Contacts;
using Google.GData.Client;
using Google.GData.Extensions;
using Google.Contacts;
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    public static DataSet GetGmailData(string App_Name, string GmailUserName, string GmailPassword)
    {

        DataSet dsd = new DataSet();

        DataTable dtd = new DataTable();

        DataColumn Clmn = new DataColumn();

        Clmn.DataType = Type.GetType("System.String");

        Clmn.ColumnName = "EmailID";

        dtd.Columns.Add(Clmn);



        RequestSettings rs = new RequestSettings(App_Name, GmailUserName, GmailPassword);

        rs.AutoPaging = true;

        ContactsRequest cr = new ContactsRequest(rs);

        Feed<Contact> f = cr.GetContacts();

        foreach (Contact t in f.Entries)
        {

            foreach (EMail email in t.Emails)
            {

                DataRow rows = dtd.NewRow();

                rows["EmailID"] = email.Address.ToString();

                dtd.Rows.Add(rows);

            }

        }

        dsd.Tables.Add(dtd);

        return dsd;

    }
    protected void Fetchdatafromgmail_Click(object sender, EventArgs e)
    {

        DataSet ds = GetGmailData("MyNetwork Web Application!", txtunm.Text, txtpwd.Text);

        gvgmaildata.DataSource = ds;

        gvgmaildata.DataBind();
    }
}