4 Replies - 4752 Views - Last Post: 01 April 2011 - 06:49 AM Rate Topic: -----

#1 G_rose42  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 50
  • Joined: 15-December 10

ASP.net alert problem c#

Posted 30 March 2011 - 03:12 AM

hi,,, the following is my code this is for my login page... in this i added bacground picture but when i check given usr name password if it is wrong it shows alert... but if alert appear my backround picture is not appearing.... how to solve this please any one help me...
:helpsmilie: Thanks :dozingoff:




 con.Open();
                cmd = new SqlCommand("select count(*) from CUM_Dist_Users where CUM_UserName='" + txt_username.Text + "' and CUM_Password='" + txt_password.Text + "'", con);
                a = Convert.ToInt32 (cmd.ExecuteScalar());
                if (a == 1)
        {
             cmd = new SqlCommand("G_dis_suggselect", con);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@CUM_usrnm",txt_username.Text);
            cmd.Parameters.AddWithValue("@CUM_pwd", txt_password.Text);
            SqlDataReader dr = cmd.ExecuteReader();
            if (dr.Read())
            {
                Session["s_cuid"] = Convert.ToInt32(dr.GetValue(1).ToString());
                Session["s_ccmpycd"] = dr.GetValue(0).ToString();
                Session["s_cfstnm"] = dr.GetValue(3).ToString();
                Session["s_clstnm"] = dr.GetValue(4).ToString();
                Session["s_cdesg"] = dr.GetValue(2).ToString();
                Session["s_cemail"] = dr.GetValue(8).ToString();
                Session["s_cphone"] = dr.GetValue(6).ToString();
                Session["s_cmpynm"] = dr.GetValue(9).ToString();
            }



            Response.Redirect("Dis_Home.aspx");
        }
        else
        {
                      
            ScriptManager.RegisterStartupScript(this.Page,this.GetType(),"Alert","alert('Enter the valid username & password')",true);
        }


This post has been edited by eclipsed4utoo: 01 April 2011 - 06:49 AM
Reason for edit:: LEARN TO USE THE CODE TAGS...[code] your code here [/code]


Is This A Good Question/Topic? 0
  • +

Replies To: ASP.net alert problem c#

#2 G_rose42  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 50
  • Joined: 15-December 10

Re: ASP.net alert problem c#

Posted 30 March 2011 - 03:14 AM

hi,,, the following is my code this is for my login page... in this i added bacground picture but when i check given usr name password if it is wrong it shows alert... but if alert appear my backround picture is not appearing.... how to solve this please any one help me...
:helpsmilie: Thanks :dozingoff:





con.Open();
cmd = new SqlCommand("select count(*) from CUM_Dist_Users where CUM_UserName='" + txt_username.Text + "' and CUM_Password='" + txt_password.Text + "'", con);
a = Convert.ToInt32 (cmd.ExecuteScalar());
if (a == 1)
{
cmd = new SqlCommand("G_dis_suggselect", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@CUM_usrnm",txt_username.Text);
cmd.Parameters.AddWithValue("@CUM_pwd", txt_password.Text);
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
Session["s_cuid"] = Convert.ToInt32(dr.GetValue(1).ToString());
Session["s_ccmpycd"] = dr.GetValue(0).ToString();
Session["s_cfstnm"] = dr.GetValue(3).ToString();
Session["s_clstnm"] = dr.GetValue(4).ToString();
Session["s_cdesg"] = dr.GetValue(2).ToString();
Session["s_cemail"] = dr.GetValue(8).ToString();
Session["s_cphone"] = dr.GetValue(6).ToString();
Session["s_cmpynm"] = dr.GetValue(9).ToString();
}



Response.Redirect("Dis_Home.aspx");
}
else
{

ScriptManager.RegisterStartupScript(this.Page,this.GetType(),"Alert","alert('Enter the valid username & password')",true);
}
Was This Post Helpful? 0
  • +
  • -

#3 Nakor  Icon User is offline

  • Professional Lurker
  • member icon

Reputation: 441
  • View blog
  • Posts: 1,488
  • Joined: 28-April 09

Re: ASP.net alert problem c#

Posted 01 April 2011 - 03:47 AM

where are you adding the background picture and during which page event is this being called?
Was This Post Helpful? 0
  • +
  • -

#4 G_rose42  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 50
  • Joined: 15-December 10

Re: ASP.net alert problem c#

Posted 01 April 2011 - 05:23 AM

Hi..
am using alert box in my asp.net login page... after i check username and password if it is wrong i have to show alert... but my problem is when i show alert my background picture disappears till alert closed...
to alert i used
ScriptManager.RegisterStartupScript(this.Page,this.GetType(),"Alert","alert('Enter the valid username & password')",true);


am adding background in <table background="url of the pic" cellspacing="0">
Was This Post Helpful? 0
  • +
  • -

#5 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,957
  • Joined: 21-March 08

Re: ASP.net alert problem c#

Posted 01 April 2011 - 06:49 AM

Topics have been merged.

Please don't create duplicate threads.

Also, please learn to use the code tags.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1