473,796 Members | 2,649 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

[vb->c#] Some conversion problems about handles and Master Page

same question about WEB app.:
In vb i use "handles + handler class name" keyword for events, what can
i use in c#?
In vb i use the directive masterpagefile and mastertype and than i can
see all public methods, classes and vars of the master page, in c# it
seems it is not enaugh, how can i do to """see""" masterPage?

Aug 12 '06 #1
8 1585
e
the samething but with different syntax, you should Combine the funtion into
the delegate chain list and the easiest way to do it C# is in your
constructor, or Page_Init for webpage

myControl/EventOnControl += MyFuctionForThe EventHandler;
you can access the page materpage trhoruh the page property, well it's
called Masterpage, cast it to your masterpage type to access all the public
interfaces

regards
erymuzuan mustapa
www.bespoke.com.my

"cipcip" <pa******@tisca li.itwrote in message
news:11******** **************@ m73g2000cwd.goo glegroups.com.. .
same question about WEB app.:
In vb i use "handles + handler class name" keyword for events, what can
i use in c#?
In vb i use the directive masterpagefile and mastertype and than i can
see all public methods, classes and vars of the master page, in c# it
seems it is not enaugh, how can i do to """see""" masterPage?


Aug 12 '06 #2
is it ok?:

public void Page_Init(objec t sender, EventArgs e)
{
this.Load += new System.EventHan dler(this.Page_ Load);
}

public void Page_Load(objec t sender, EventArgs e)
{

}
If yes, another question:

if i register events in page_init event where i regiser the init event
itself?

Aug 13 '06 #3
The easiest option is to set AutoEventWireup = true and then just use the
"Page_x" naming convention for your page events. See the following for more
details:
http://www.tangiblesoftwaresolutions...d%20CSharp.htm
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C#/VB to C++ converter
C# Code Metrics: Quick metrics for C#
"cipcip" wrote:
is it ok?:

public void Page_Init(objec t sender, EventArgs e)
{
this.Load += new System.EventHan dler(this.Page_ Load);
}

public void Page_Load(objec t sender, EventArgs e)
{

}
If yes, another question:

if i register events in page_init event where i regiser the init event
itself?

Aug 13 '06 #4
cipcip,

I am not too sure what you want but what I can see is C# and master page.
Can I suggest you to download the Pet shop 4 to take a look of the code in
there. It uses C# and master page.

chanmm

"cipcip" <pa******@tisca li.itwrote in message
news:11******** **************@ m73g2000cwd.goo glegroups.com.. .
same question about WEB app.:
In vb i use "handles + handler class name" keyword for events, what can
i use in c#?
In vb i use the directive masterpagefile and mastertype and than i can
see all public methods, classes and vars of the master page, in c# it
seems it is not enaugh, how can i do to """see""" masterPage?

Aug 13 '06 #5

it doesn't work:
public void Page_Init(objec t sender, EventArgs e)
{
this.Load += new System.EventHan dler(this.Page_ Load);

}

public void Page_Load(objec t sender, EventArgs e)
{
Label1.Text="OK "

}
ifi set autoeventwireup to false the load event doesn't fire, so the
question is how to make it work when autoevent wireup is set to false?

Aug 14 '06 #6
cipcip wrote:
>
it doesn't work:
public void Page_Init(objec t sender, EventArgs e)
{
this.Load += new System.EventHan dler(this.Page_ Load);

}

public void Page_Load(objec t sender, EventArgs e)
{
Label1.Text="OK "

}
ifi set autoeventwireup to false the load event doesn't fire, so the
question is how to make it work when autoevent wireup is set to false?
Hi cipcip,

I don't do ASP .NET, but presumably, from what I can infer, if you've set
AutoEventWireup to False, then the Page_Init method won't be called, hence
your code that assigns an event handler to this.Load will not happen.

Can't you put your 'this.Load += ...' code in the constructor?

--
Hope this helps,
Tom Spink

Google first, ask later.
Aug 14 '06 #7
where i can find page costructor?

Aug 14 '06 #8
cipcip wrote:
where i can find page costructor?
Hi,

A constructor takes the form of:

<scope<class-name( <parameters)
{
<block>
}

So, if you're class is called 'Foo', your default constructor will look like
this:

public Foo ( )
{
...
}

Like I said, I don't do ASP .NET, so I'm not sure if you're constructor has
been defined elsewhere. If you're using the VS .NET IDE, I'm sure you can
browse to the constructor, using the dropdowns in the code-editor.

--
Hope this helps,
Tom Spink

Google first, ask later.
Aug 15 '06 #9

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

Similar topics

28
2450
by: Andy | last post by:
Any good resources regarding benefitis by using C3 over VB? /Andy
16
2608
by: Ben Hannon | last post by:
Hi, I'm writting a COM Class in VB.NET to be used in a VB6 project (Tired of the VB6 hassles with cloning and serializing an object). All my classes I need cloneable/serializable are now in a VB.NET class that exposes those objects to COM perfectly. However I ran into a problem because some of these objects requires a Collection. When I compile this project with the VB.NET Collection exposed for a property, I get a compile time error...
182
7561
by: Jim Hubbard | last post by:
http://www.eweek.com/article2/0,1759,1774642,00.asp
25
1829
by: Sharrukin Amiri | last post by:
Hello, I am using VB 6.0 for many years. Everytime I needed to build software applications, I just opened VB 6.0 and started coding. I am now looking VB.NET Express Edition and I find I can no longer do this very easily. I find that there is too much copy and paste of code in order to get an app running. I also find it slow. Is it me or I am missing something? Here is a sample of my coding which you could find at: ...
2
1700
by: D H | last post by:
Hi, Hi, I was looking for your opinion on VB.NET - its long-term prospects, etc. Sorry this is vague, but it's not meant to be a troll. It's a pro-VB.NET post actually. I haven't used VB or VB.NET really, but I have used Realbasic (a vb clone), Java, C#, C, and Python. I work in education, and I'd like something that is easy enough for teachers and students to use to develop real, usable applications, not just to learn programming for...
19
3092
by: lonelyplanet | last post by:
Hi, I'm studying for 70-306 using the book "MCAD/MCSD Visual Basic .NET Windows Applications" published by McGraw Hill (ISBN: 0-07-212583-7). I found the book has no programming exercise provided about how VB.NET work with XML documents (certification objective 15.02). I'm now searching for some example source codes to assist my study. Could anyone also suggest me some useful online study resources ?
39
2541
by: clintonG | last post by:
This is not about starting a fight but an observation that seems to be proving itself on its own merit and is therefore simply a point of conjecture. I did not get serious about writing software until I learned ASP/VBS (if that can be called writing software) as my focus was and remains for the most part developing for the web. Even though I have had a programming class in C which I somehow passed, JavaScript always gave me the heeby...
62
5195
by: zacks | last post by:
A co-worker where I work is proposing all future code devopment be done in Visual C#. Here is his assessment of VB: VB.NET is hack as far as the CLR(Common Language Runtime) goes. It was retrofited into the .Net framework for those people who simply don't, and do not care to, understand object oriented programming. Quite a few of it's (features) were forced into the language through very ugly means to make it easier for the VB guys to...
111
4896
by: =?Utf-8?B?bWFyaw==?= | last post by:
Fact Poll I made the transition from (Borland) C++ to VB.NET around 2004. I have been happy with the choice. I find I can focus more on the problem and less on being "tidy" with VB. But, I fear that many don't take VB.NET seriously, particularly in scientific programming. They ask; "What do you code in?" and you say; "VB.NET." Conversation over.
15
2084
by: Charles Law | last post by:
In the build output appears ========== Rebuild All: 1 succeeded, 1 failed, 0 skipped ========== However, the compiler does not generate any errors, and the Errors list is empty. This is an almost trivial program, but the compiler will not compile it and will not tell me where the error is.
0
9673
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
9524
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
10449
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
10217
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
10168
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
9047
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...
1
7546
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5568
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.