473,763 Members | 3,901 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Button1_Click method doesn't exist

Hi

I have an ascx control through which I am calling an aspx page using
the following command.

Page.ClientScri pt.RegisterStar tupScript(GetTy pe(), "test",
"window.open(.. .)");

Initially I just added a label controls on the page and it opened up
fine without any errors.

I then have added a button to the aspx page. When I double click on
the button in design mode, I am transferred to the codebehind class to
the button click event handler ( protected void Button1_Click(o bject
sender, EventArgs e){}).

Now when I run the application and get to the point where the ascx is
calling the aspx page I get an error saying that there doesn't exist a
Button1_Click method. I have checked the code behind and the method
exists there, I can get to the method by double clicking in design
mode and I have already tried removing and readding the button and
that didn't work either. I can't figure out what the issue is here and
any help regarding this would be greatly appreciated.

Thanks

Sumeet

Oct 19 '08 #1
4 2023
On Oct 19, 12:04*pm, Bali <sumeetkb...@gm ail.comwrote:
Hi

I have an ascx control through which I am calling an aspx page using
the following command.

Page.ClientScri pt.RegisterStar tupScript(GetTy pe(), "test",
"window.open(.. .)");

Initially I just added a label controls on the page and it opened up
fine without any errors.

I then have added a button to the aspx page. When I double click on
the button in design mode, I am transferred to the codebehind class to
the button click event handler ( protected void Button1_Click(o bject
sender, EventArgs e){}).

Now when I run the application and get to the point where the ascx is
calling the aspx page I get an error saying that there doesn't exist a
Button1_Click method. I have checked the code behind and the method
exists there, I can get to the method by double clicking in design
mode and I have already tried removing and readding the button and
that didn't work either. I can't figure out what the issue is here and
any help regarding this would be greatly appreciated.

Thanks

Sumeet
Does aspx work when you call it directly as http://.../page.aspx?
Oct 19 '08 #2
On Oct 19, 7:03*am, Alexey Smirnov <alexey.smir... @gmail.comwrote :
On Oct 19, 12:04*pm, Bali <sumeetkb...@gm ail.comwrote:


Hi
I have an ascx control through which I am calling an aspx page using
the following command.
Page.ClientScri pt.RegisterStar tupScript(GetTy pe(), "test",
"window.open(.. .)");
Initially I just added a label controls on the page and it opened up
fine without any errors.
I then have added a button to the aspx page. When I double click on
the button in design mode, I am transferred to the codebehind class to
the button click event handler ( protected void Button1_Click(o bject
sender, EventArgs e){}).
Now when I run the application and get to the point where the ascx is
calling the aspx page I get an error saying that there doesn't exist a
Button1_Click method. I have checked the code behind and the method
exists there, I can get to the method by double clicking in design
mode and I have already tried removing and readding the button and
that didn't work either. I can't figure out what the issue is here and
any help regarding this would be greatly appreciated.
Thanks
Sumeet

Does aspx work when you call it directly ashttp://.../page.aspx?- Hide quoted text -

- Show quoted text -
Apparently not. If I type http://localhost/..../webform2.aspx in IE, I
get the same error.

Compilation error.

Description: An error occured during the compilation of a resource
required to service the request....

Compiler Error Message: ...webform2_asp x does not contain a definition
for 'Button1_Click'

and if I open up the solution in VS2005 and set webform2 as the
startup page and run it, the page opens up fine and the button click
event works as well.

Any ideas?

Thanks for looking into this.

Sumeet
Oct 19 '08 #3
On Oct 19, 9:04*pm, Bali <sumeetkb...@gm ail.comwrote:
Apparently not. If I typehttp://localhost/..../webform2.aspxin IE, I
get the same error.
ok, it means it doesn't matter from where you call it

How did you create the webform? Maybe you did change the namespace or
a name of the class? Check if Namespace.Class from <%@ Page
Inherits="Names pace.Class" is the same as in the code behind. Check if
the AutoEventWireup attribute of the Page directive is set to true (if
it is missing by default it is true). If you see nothing wrong, try to
rename the webform2.aspx to webform2_.aspx and create new
webform2.aspx.
Oct 19 '08 #4
On Oct 19, 2:27*pm, Alexey Smirnov <alexey.smir... @gmail.comwrote :
On Oct 19, 9:04*pm, Bali <sumeetkb...@gm ail.comwrote:
Apparently not. If I typehttp://localhost/..../webform2.aspxin IE, I
get the same error.

ok, it means it doesn't matter from where you call it

How did you create the webform? Maybe you did change the namespace or
a name of the class? Check if Namespace.Class from <%@ Page
Inherits="Names pace.Class" is the same as in the code behind. Check if
the AutoEventWireup attribute of the Page directive is set to true (if
it is missing by default it is true). If you see nothing wrong, try to
rename the webform2.aspx to webform2_.aspx and create new
webform2.aspx.
Hi

I tried all of the above and still none worked! Any other things that
you can think of coz I am surely running out of ideas.

Thanks

Sumeet
Oct 20 '08 #5

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

Similar topics

0
1200
by: Marcin 'Qrczak' Kowalczyk | last post by:
I made a bridge between my language Kogut <http://qrnik.knm.org.pl/~qrczak/kogut/kogut.html> and Python, which gives my language instant access to Python libraries. There is a minor annoyance in the C API: the __unicode__ method does not have its own slot in type objects, it's not treated specially like __str__. /* XXX As soon as we have a tp_unicode slot, we should check this before trying the __unicode__ method. */
31
2936
by: Chris S. | last post by:
Is there a purpose for using trailing and leading double underscores for built-in method names? My impression was that underscores are supposed to imply some sort of pseudo-privatization, but would using myclass.len() instead of myclass.__len__() really cause Python considerable harm? As much as I adore Python, I have to admit, I find this to be one of the language's most "unPythonic" features and a key arguing point against Python. I've...
6
3013
by: Alex Sedow | last post by:
Example 1 interface I { string ToString(); } public class C : I { public void f() {
1
1408
by: tshad | last post by:
I had a project where I had some code in my Button1_Click procedure and copied it over to a new project (that had the same button name on it) and I couldn't figure out why the event never fired. I then double-clicked on the button and a new event opened which normally would have been Button1_Click, but in this case it was Button1_Click_1. I assume this was because I had manually put in the Button1_Click event. Why did it do that?
2
1439
by: Kris | last post by:
Hi All, I'm trying to use the GetImage method in a ASP.NET project that I've created but I keep getting an error stating: The name 'GetImage' does not exist in the class or namespace ... The project includes System.Drawing and I've even tried specifying the fully qualified name System.Drawing.ToolboxBitmapAttribute.GetImage but the
1
2346
by: tony | last post by:
Hello!! Hello Victor! I use a product called flygrid to create grid tables. In many of my forms I create such grid tables. Some columns in these grid tables is of type drop down list where I can select a value from the list. Below I have some code which exist in a file named StringClass.cs
21
2387
by: John Henry | last post by:
Hi list, I have a need to create class methods on the fly. For example, if I do: class Dummy: def __init__(self): exec '''def method_dynamic(self):\n\treturn self.method_static("it's me")''' return
3
2851
by: MD | last post by:
Hi, I have a variable which is defined inside a class method. When I call PyModule_GetDict on the module containing this class, the dictionary doesn't contain any information about this variable. Is this expected behavior? If so, what options do I have to access this variable from my Python C extension. Thanks and Regards, -MD
5
2031
by: Angry C sharp user | last post by:
I am currently working on a Windows Forms Application and I need to create a few methods in another class and then call the methods back into my form1.cs but every time I set my global variables equal to the ones I returned from the method, it says that my variables do not exist in the current context. I'm still learning how to work with c sharp so it might not be any close to perfect but this is an example of what is happenning: private...
0
9563
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9386
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
10145
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
9998
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
9938
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
8822
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6642
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
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2793
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.