473,387 Members | 1,597 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

2.0 SIMPLE PROBLEM: asp:Button click at server

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/
Apr 12 '06 #1
4 1678
Are you using Visual Studio? Not required, but just wondering...

"R.A.M." <r_********@poczta.onet.pl> wrote in message
news:cf********************************@4ax.com...
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/

Apr 12 '06 #2
On Wed, 12 Apr 2006 13:35:31 -0700, "Jeff Dillon"
<je********@hotmail.com> wrote:
Are you using Visual Studio? Not required, but just wondering...

Yes, I am.
Apr 13 '06 #3
Load your page into the designer, then double click on the button to create
the click event handler

Jeff

"R.A.M." <r_********@poczta.onet.pl> wrote in message
news:8u********************************@4ax.com...
On Wed, 12 Apr 2006 13:35:31 -0700, "Jeff Dillon"
<je********@hotmail.com> wrote:
Are you using Visual Studio? Not required, but just wondering...

Yes, I am.

Apr 13 '06 #4
On Thu, 13 Apr 2006 09:49:24 -0700, "Jeff Dillon"
<je********@hotmail.com> wrote:
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.
Apr 18 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: RSB | last post by:
Hi Every one, Having tuff time to make this work .. i want to have a button and on my form say Delete button. So once i click on it i want to confirm "Are you sure?" on the Client Side and if...
11
by: Frag | last post by:
Hi guys, I searched around without any clear answer. Tons of stuff, but nothing concrete. I am trying to call this Javascript function: function ButtonClicked() { alert("The button has...
2
by: pkp303 | last post by:
I have a page with a submit button (<asp.button/>). When run this page in production the button fires and submits the form, however, when I run the page on my local machine, it won't submit! Any...
4
by: Rodrigo Ferreira | last post by:
Anyone uses the simple button component from DevExpress?
2
by: Lasse Edsvik | last post by:
Hello Im using VS.NET and cant get this simple page to work.......... I get: CS0122: 'dbtest.WebForm2.Button1_Click(object, System.EventArgs)' is inaccessible due to its protection level ...
1
by: RUIZCJ | last post by:
Hi, I'm at my wits end!!! I have the following code. The submit button works on my home computer but when I copy the dll and the ASPX file to my host provider, the button does NOT fire. TIA...
8
by: tatemononai | last post by:
I had a beautiful script that was running, well, just beautifully. But then I decided to take a button that fired an event and place it inside a <asp:table. The event WILL NOT FIRE INSIDE THE...
2
by: DFDavis | last post by:
I have a set of code that updates to a div tag through javascript whenever a checkbox is checked, however I need a way to get that information to the server side when the user uses the submit...
1
by: mazdotnet | last post by:
Hi all, I'm really stuck trying to figure the following out. I have been working on a shopping portal where you can select products from a list inside a repeater on the bottom of the page and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.