2.0 SIMPLE PROBLEM: asp:Button click at server

R

R.A.M.

Hi
I have very simple problem - I need to process asp:Button click at
server. I have written (my experience is little) in .aspx:

<asp:Button ID="GoTo" runat="server"
Text="Go To" OnClick="GoTo_Click" />

and in .aspx.cs I have written:
....
protected void Page_Load(object sender, EventArgs e)
{
GoTo.Click += new EventHandler(this.GoTo_Click);
}
public void GoTo_Click(object sender, EventArgs e)
{
Response.Redirect(...);
}
....

I don't understand why it doesn't work - GoTo_Click is not called.
Could you explain me please what's wrong? (I copied MSDN sample code).
Thank you!!!
/RAM/
 
J

Jeff Dillon

Load your page into the designer, then double click on the button to create
the click event handler

Jeff
 
R

R.A.M.

Load your page into the designer, then double click on the button to create
the click event handler

I tried. Visual Studio did the same thing as I had done manually.
It didn't help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,188
Latest member
Crypto TaxSoftware

Latest Threads

Top