.NETGURU
Codebehind Web Control
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngcontrolsvb' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Bob Levittan (VIP)
I'm taking a page from beta1->beta2. It worked in beta1 without using
codebehind.

I now have a codebehind user control I'm using in a codebehind page. The
control exposes a function:

public function Brand() as string
Return cellBID.Text
end function

It's registered and declared in the html code:

<bbk:navbar id="Navbar2" ForeColor="Silver" WidthPct="100"
BackColor="LightSteelBlue" runat="server"></bbk:navbar>

In the codebehind of my main page, I'm trying to access "Navbar2.Brand" but
the compiler says that Navbar2 is not declared. I figured that it was
because the control wasn't declared in the codebehind, so I added:

protected withevents Navbar2 as UserControl

and now it says, "The name Brand is not a member of
System.Web.UI.Usercontrol".

I tried to look in ibuyspy to see how they did it, but they're not using
codebehind (see my other post.)

Any ideas?
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

Reply to this message...
 
    
Doug Seven

Can we see the whole user control and web form? Or at least the important
parts?

Doug

-----Original Message-----
From: Bob Levittan [mailto:Click here to reveal e-mail address]
Sent: Thursday, June 28, 2001 7:34 PM
To: aspngcontrolsvb
Subject: [aspngcontrolsvb] Codebehind Web Control

I'm taking a page from beta1->beta2. It worked in beta1 without using
codebehind.

I now have a codebehind user control I'm using in a codebehind page. The
control exposes a function:

public function Brand() as string
Return cellBID.Text
end function

It's registered and declared in the html code:

<bbk:navbar id="Navbar2" ForeColor="Silver" WidthPct="100"
BackColor="LightSteelBlue" runat="server"></bbk:navbar>

In the codebehind of my main page, I'm trying to access "Navbar2.Brand" but
the compiler says that Navbar2 is not declared. I figured that it was
because the control wasn't declared in the codebehind, so I added:

protected withevents Navbar2 as UserControl

and now it says, "The name Brand is not a member of
System.Web.UI.Usercontrol".

I tried to look in ibuyspy to see how they did it, but they're not using
codebehind (see my other post.)

Any ideas?
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

| [aspngcontrolsvb] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngcontrolsvb.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
    
Bob Levittan (VIP)
I already answered this one myself (and posted the answer) earlier. The
answer was:

protected withevents Navbar2 as colorm.C_navbar

where colorm is my program's namespace and C_navbar is the class name of the
user control.

........................

Can we see the whole user control and web form? Or at least the important
parts?

Doug

-----Original Message-----
From: Bob Levittan [mailto:Click here to reveal e-mail address]
Sent: Thursday, June 28, 2001 7:34 PM
To: aspngcontrolsvb
Subject: [aspngcontrolsvb] Codebehind Web Control

I'm taking a page from beta1->beta2. It worked in beta1 without using
codebehind.

I now have a codebehind user control I'm using in a codebehind page. The
control exposes a function:

public function Brand() as string
Return cellBID.Text
end function

It's registered and declared in the html code:

<bbk:navbar id="Navbar2" ForeColor="Silver" WidthPct="100"
BackColor="LightSteelBlue" runat="server"></bbk:navbar>

In the codebehind of my main page, I'm trying to access "Navbar2.Brand" but
the compiler says that Navbar2 is not declared. I figured that it was
because the control wasn't declared in the codebehind, so I added:

protected withevents Navbar2 as UserControl

and now it says, "The name Brand is not a member of
System.Web.UI.Usercontrol".

I tried to look in ibuyspy to see how they did it, but they're not using
codebehind (see my other post.)

Any ideas?
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

| [aspngcontrolsvb] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngcontrolsvb.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

| [aspngcontrolsvb] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngcontrolsvb.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

Reply to this message...
 
 
System.Web.UI.UserControl
System.Windows.Forms.UserControl




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification