Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with a event of a button

Status
Not open for further replies.

jalojavier

Programmer
Aug 22, 2006
14
ES
Hello,

I have a little problem with a button in a web application that i'm developing. I have two textbox for the user and password and a button to log in.. I have this code:

protected void Page_Load(object sender, System.EventArgs e) {
// this.LBLinkProductos.Text = "<A href=\"products.aspx\">[Productos]</A>";
// this.LBLinkRegistrarse.Text = "<A href=\"registro.aspx\">[Registrarse]</A>";
// this.LBLinkContactar.Text = "<A href=\"contact.aspx\">[Contactar]</A>";
// this.LBRegistrarse.Text = "<A href=\"registro.aspx\">Registrarse</A>";
this.error.Text = "XXVVVV";
this.Load += new System.EventHandler(this.Page_Load);
this.Login.Click += new System.EventHandler(this.Login_Click);
if (User.Identity.IsAuthenticated) {
userIdentificado();
}
else {
userNoIdentificado();
}

// Put user code to initialize the page here
}


Where:

this.Login.Click += new System.EventHandler(this.Login_Click);

______________________________________________________________________

Is the code where i assign the event to the button "Login"..


In the other hand:

Code:
protected void Login_Click(object sender, EventArgs e)
{
error.Text = "Pushing....?";
identify();
}

______________________________________________________________________


When i press the button loads a web page that seems to this:



But the labels don't change and not execute the "identify()" method that is the method that identify the users.. In resumen, don't do nothing.

¿Anyone know whats happen?
 
>>When i press the button loads a web page that seems to this:

a new window is opened? from the looks of it the form is submitting in "GET" mode.

that shouldnt happen in ASP.NET. try do do a view source and check the <form> tag's method attribute...

Known is handfull, Unknown is worldfull
 
Thanks for the answer, the problem was where you said.
 
welcome. but how did that happen? i am interested there...

Known is handfull, Unknown is worldfull
 
No new window was opened when i pushed the button, simply reload the actual page passing the parameters that i mentioned in the previous post. I review the HTML code and i found a extra <form> tag that was the cause of the problems. I delete it and let a unique form tag like this:

<form id="Ident" method="post" runat="server">

rest of code

</form>

And all works ok :)
 
cheers...

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top