Event Handles in .ASPX (.CS)

J

Jake K

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.
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

"Jake K" <msnews.microsoft.com> wrote in message
| 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);
}
 
J

Jake K

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.
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

"Jake K" <msnews.microsoft.com> wrote in message
| 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
 

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

Top