473,395 Members | 1,458 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,395 software developers and data experts.

Event Handles in .ASPX (.CS)

In C#, where do you defined event handlers? In VB.NET you could do
something like:

Public Sub btnNext_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnNext.Click
end sub

Is there an equivalant in C#? All code written in notepad. No VStudio /
Express to work with.

Thanks a lot.

Jan 15 '07 #1
3 1152
Hi,

"Jake K" <msnews.microsoft.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
| In C#, where do you defined event handlers? In VB.NET you could do
| something like:
|
| Public Sub btnNext_Click(ByVal sender As System.Object, ByVal e As
| System.EventArgs) Handles btnNext.Click
| end sub
|
| Is there an equivalant in C#? All code written in notepad. No VStudio /
| Express to work with.
Why is that? VSE is free, honestly I cannot think a single reason why not
using it.

answering your question you do something similar (but different)
you can use a declarative form:

<asp:Button Runat=server ID=button1 OnClick="doclick"></asp:Button>
protected void doclick(object sender, System.EventArgs e)
{
//do stuff
}

or coded in like:

private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
this.button1.onClick += new System.EventHandler( doclick);
}
Jan 15 '07 #2
Thanks for the reply. I have acccess to VStudio 2005 Pro and Express. What
are the benefits of using Pro over Express? I can't seem to find a
comparison chart on MS site.
"Ignacio Machin ( .NET/ C# MVP )" <machin TA laceupsolutions.comwrote in
message news:Ob**************@TK2MSFTNGP03.phx.gbl...
Hi,

"Jake K" <msnews.microsoft.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
| In C#, where do you defined event handlers? In VB.NET you could do
| something like:
|
| Public Sub btnNext_Click(ByVal sender As System.Object, ByVal e As
| System.EventArgs) Handles btnNext.Click
| end sub
|
| Is there an equivalant in C#? All code written in notepad. No VStudio
/
| Express to work with.
Why is that? VSE is free, honestly I cannot think a single reason why not
using it.

answering your question you do something similar (but different)
you can use a declarative form:

<asp:Button Runat=server ID=button1 OnClick="doclick"></asp:Button>
protected void doclick(object sender, System.EventArgs e)
{
//do stuff
}

or coded in like:

private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
this.button1.onClick += new System.EventHandler( doclick);
}


Jan 15 '07 #3
Hi,

"Jake K" <msnews.microsoft.comwrote in message
news:uD*************@TK2MSFTNGP06.phx.gbl...
| Thanks for the reply. I have acccess to VStudio 2005 Pro and Express.
What
| are the benefits of using Pro over Express? I can't seem to find a
| comparison chart on MS site.

Pro cost $$$ , Express is free

There are some projects types that are not accesible in Express I think,
like smart devices apps.

You should check the MSDN for this. I'm sure they have a side by side
comparision
--
Ignacio Machin
machin AT laceupsolutions com
Jan 15 '07 #4

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

Similar topics

3
by: Stevie_mac | last post by:
It might be me but... I dont seem to get a Page_Load event when a opening an ASPX in an iFrame. I do geta Page_Load event when an item on the ASPX (inside the iFrame) is clicked but then...
7
by: Jibey | last post by:
Hello: I'm facing a very strange problem. When I run my Web application in Visual Studio.NET the Page_Load event is not executing. Other events like a Button_Click are executing. It doesn't...
0
by: Oz | last post by:
Hi Using VS.NET 2003, Windows XP SP1, We have a page which has been developed using ASP.NET. On it, is a button which when clicked is supposed to add some data to a table. When the button is...
4
by: Barb | last post by:
I have a user control as my Save button for my page. When the Save button is clicked, I want some client-side validation to take place from a javascript function in the page, and then I'd like the...
6
by: Steve Booth | last post by:
I have a web form with a button and a placeholder, the button adds a user control to the placeholder (and removes any existing controls). The user control contains a single button. I have done all...
0
by: Tand35006 | last post by:
Hi, I hope some one can help with this. I have a basic webform with 2 DropDownLists and a single DataGrid. What I am trying to do is populate the first DDList from a dataset on Form_Load. I then...
8
by: Ken Sturgeon | last post by:
I have a button inside a panel control. Apparently I can't expect VB to respond to the button's _Click event. How do I capture the click event? Thanks Ken
4
by: Nathan Sokalski | last post by:
I have a DataList that has an Button as one of the controls in it's ItemTemplate. The Button has a CommandName="delete" attribute, but when I click it the DeleteCommand event doesn't even get...
5
by: rn5a | last post by:
Consider the following user control which resides in Address.ascx: <script runat="server"> Public Property Address() As String Get Address = txtAddress.Text End Get Set(ByVal value As String)...
6
by: Mel | last post by:
I have a website that allows the user to generate a new quote. When they are finished creating the quote, it brings them to the final page (called the Goodbye.aspx page) which just states the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.