473,811 Members | 2,586 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_C lick" />

and in .aspx.cs I have written:
....
protected void Page_Load(objec t sender, EventArgs e)
{
GoTo.Click += new EventHandler(th is.GoTo_Click);
}
public void GoTo_Click(obje ct sender, EventArgs e)
{
Response.Redire ct(...);
}
....

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 1706
Are you using Visual Studio? Not required, but just wondering...

"R.A.M." <r_********@poc zta.onet.pl> wrote in message
news:cf******** *************** *********@4ax.c om...
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_C lick" />

and in .aspx.cs I have written:
...
protected void Page_Load(objec t sender, EventArgs e)
{
GoTo.Click += new EventHandler(th is.GoTo_Click);
}
public void GoTo_Click(obje ct sender, EventArgs e)
{
Response.Redire ct(...);
}
...

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********@hot mail.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_********@poc zta.onet.pl> wrote in message
news:8u******** *************** *********@4ax.c om...
On Wed, 12 Apr 2006 13:35:31 -0700, "Jeff Dillon"
<je********@hot mail.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********@hot mail.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
2184
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 client select "Cancel" then i want to ignore the action and if "OK" selected then i want to Execute a Server side Event or Procedure. Now what is happening here is for "Delete1" button (in my code) even if Client Select Cancel it is still...
11
4660
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 been clicked."); }
2
1676
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 ideas?
4
1908
by: Rodrigo Ferreira | last post by:
Anyone uses the simple button component from DevExpress?
2
2700
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 what's wrong, i clicked the Button1 on designform and it created that onclick event.........
1
3639
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 RuizCJ
8
3901
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 TABLE!?! When I move the button outside the table, it works just fine. Inside the table, it doesn't. What gives?
2
1268
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 button. So I created an asp:button on the page, but for some reason, everytime I press the submit button, the page tries to reload and I get an error page, not an error from the program itself, just a normal error page for explorer. I've noticed...
1
4922
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 on each row, once clicked you can enter a quantity and add it to your cart automatically on top (using UpdatePanel). Everything seems to be working fine when I created a dummy DataTable and did a bind but now that I'm actually reading the contents...
0
9605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10648
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10389
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10402
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6890
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5692
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4339
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3867
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3018
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.