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

Forum statistics

Threads
473,995
Messages
2,570,233
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top