How to check the mentioned gmail id is exist or not?

Posted by Prabu_Spark under ASP.NET on 1/24/2013 | Points: 10 | Views : 2707 | Status : [Member] | Replies : 2
Hi sir,
Tell me the steps to check the mentioned gmail id is exists or not. Kindly give me the solution for this problem.

[Hint: If you take any registration page in most of the website, they ask for valid mail id and send the confirmation mail to that mail id. I want to know whether the entered mail id is exist(valid) or not. If they mention invalid gmail id that does not exist, it has to show error like , invalid id]

With regards,
J.Prabu.
[Email:prbspark@gmail.com]



Responses

Posted by: Arjunan_Csharp on: 1/24/2013 [Member] Starter | Points: 25

Up
0
Down
visit the following website for your doubts.

http://www.aspdotnet-suresh.com/2010/10/how-to-get-output-parameters-return-by.html



Prabu_Spark, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Chaithragm on: 1/24/2013 [Member] Starter | Points: 25

Up
0
Down
use this in text changed event
// to check the emailid available or not

protected void unametxt_txtchanged(object sender, EventArgs e)
{

if (uname_txt.Text != string.Empty)
{
string strConnection = "Database=dbname;Data Source=sqlexpress;Integrated Security=true";
string strSelect = "SELECT * FROM user_register WHERE user_name = @user_name1";
SqlConnection con = new SqlConnection(strConnection);
SqlCommand cmd = new SqlCommand(strSelect, con);
cmd.Parameters.AddWithValue("user_name1", uname_txt.Text.Trim().ToString());


con.Open();
int result = Convert.ToInt32(cmd.ExecuteScalar());

con.Close();


if (result >= 1)
{


imgid2.Visible = true;
imgid.Visible = false;

lblid.Visible = true;

lblid.Text = "Email id already exists";

lblid.ForeColor = System.Drawing.Color.Red;
this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('User Cant Registered \n UserName already Exists '); window.location.href = 'Home.aspx';", true);
register_btn.Enabled = false;


}

else
{

register_btn.Enabled = true;
imgid.Visible = true;
imgid2.Visible = false;
lblid.Text = "";
lblid.ForeColor = System.Drawing.Color.Green;

}
}
}


Prabu_Spark, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response