Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2006

Tip: Looking for answers? Try searching our database.

I'm lost, comming from VB to c#

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Edwin Knoppert - 16 Feb 2006 09:24 GMT
I'm doing some c# in VWD.
In VB-mode i can select a page event and VWD inserts the call for me.
Why isn't this in c# ?
What's the best way to do this?
Karl Seguin [MVP] - 16 Feb 2006 11:53 GMT
Ya...it's a nice feature of VB.NET. The best way to do it in C# is to hand
code it :)

intellisense will often kick in if you simply type in the word "override"
witin a class where you want ur method.

Karl
Signature

http://www.openmymind.net/

> I'm doing some c# in VWD.
> In VB-mode i can select a page event and VWD inserts the call for me.
> Why isn't this in c# ?
> What's the best way to do this?
Edwin Knoppert - 16 Feb 2006 12:17 GMT
yes, that helps a lot but in this case OnUnload() inserted:
base.OnUnload(e);

This is normal right (since it seems to be an override which is not the case
in VB) ?

Full:
protected override void OnUnload(EventArgs e)
{
base.OnUnload(e);
}

I found out that there much more differences between these two than
anticipated.
For the ones needing a comparisation:
http://www.dnzone.com/ShowDetail.asp?NewsId=356

> Ya...it's a nice feature of VB.NET. The best way to do it in C# is to hand
> code it :)
[quoted text clipped - 7 lines]
>> Why isn't this in c# ?
>> What's the best way to do this?
Karl Seguin [MVP] - 16 Feb 2006 13:22 GMT
That's right. You can "overrides" (extra s) in VB.Net as well, in which case
you need to call the base method using MyBase.OnUnload(e). Many people
prefer to override than the magic done by VB.NET because it's more
conventional and follows OO paradigms. You also have control over whether or
not the base method should be called, and when (normally you put it at the
end of the method, but sometimes you want it elsewhere).

Karl
Signature

http://www.openmymind.net/
http://www.fuelindustries.com/

> yes, that helps a lot but in this case OnUnload() inserted:
> base.OnUnload(e);
[quoted text clipped - 24 lines]
>>> Why isn't this in c# ?
>>> What's the best way to do this?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.