473,781 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Question about accessing usercontrol variables (VBasic)?

I am fairly new to ASP .NET, and am busy teaching myself as I work through
my current project.

I'm a bit stumped at the moment. I have made a usercontrol called
"RelatedCla ims" . The code as follows :

'************** *************** ***

Private sLinkType As String

Public Property LinkType() As String
Get
Return sLinkType
End Get
Set(ByVal Value As String)
sLinkType = Value
End Set
End Property
'************** *************** ***

On another web form (Companies.aspx ) I have added the following to the html
:

<%@ Register TagPrefix="User Control" TagName="Relate dClaims"
Src="RelatedCla ims.ascx" %>

And then added the control to the page with the following :

<usercontrol:Re latedClaims runat="server"
ID="RelatedClai ms1"></usercontrol:Rel atedClaims>
Right. Now my problem is that I cannot access the control from with the VB
code of the companies.aspx form. If I code

RelatedClaims1. LinkType = "[WHATEVER]"

It highlights RelatedClaims1 and says it is not declared. What am I
forgetting to do? Any help appreciated.

Regards
--
Stephen Chown
Nov 19 '05 #1
1 1211
Ah. Got it now.

Needed to declare a protected variable with the same name as the component
ID. Sorted.
--
Stephen Chown
Nov 19 '05 #2

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

Similar topics

22
3155
by: Tom Moroow | last post by:
Hi, I'm pretty new to javascript and was wondering how you would piece together a variable name and then assign it a value. I want to create a hidden field and assign it a value based on the value of another variable Right now it looks like: ("document.all.SM_MARK_10" + dateNumber + ".value") where dateNumber is an already defined integer. What I want is to say
8
1407
by: Steve Klett | last post by:
This is probably a commonly asked question, but I can't find a good way to search for it, so I will ask here. I assumed that there had to be an easy way to access a page level variable from a user control. IE. default.aspx has a variable "gName" default.aspx has a user control, "Navigation" I want to be able to access gName inside "Navigation"'s page_load This appears to not be possible.... and it makes sense looking at the
8
1211
by: Jolly Student | last post by:
Dear Colleagues: I am a systems guy who has been working with hardware, networking and basic scripting for ten years or so. I have been given the opportunity to attend ..Net classes of all sorts as part of the MSDN training track. I already have the MCSE track under my belt and that is where my strengths lie. The problem is that I have never programmed. Hell, the only scripting I have done is from templates here and there that are...
4
1886
by: Mat | last post by:
Hi, I am having a bit of a problem trying to access / set properties of a usercontrol from the parent codebehind. This is what I have so far.. simple.aspx <%@ Page Inherits="CodeBehindSimple" src="simple.vb" %> <%@ Register TagPrefix="CC" TagName="Simple" Src="ucSimple.ascx"%>
2
4633
by: Sascha | last post by:
Hi there, I searched carefully through the web before finally deciding to post this message, because I could not find a solution for my problem. Hopefully someone will have a hint or explanation for me! I apologize for the length of this posting, but I wanted to make sure that I get an answer other than "Hey man, just use LoadControl!", because this is not what I want. The Task: Isolate a collection of web forms which are created as
4
1224
by: Tiraman | last post by:
Hi , Problem description : I have 2 assemblies (A.dll And B.dll) . They are both under the GAC and they are both using the functions of each other . Each time that I m doing a change in one of them I need to change the
5
1869
by: Alex Maghen | last post by:
Hi. If I create a WebControl (User Control, actually), I know how, easily, to access the design-time Properties that have been set as Propertiy nodes in the tag used on the ASPX page. But I've never tried having CONTENT inside my Control's Tag, e.g.: <Ax:MyCtl id="Something" runat="server"> Some stuff inside the tag </Ax:MyCtl> How do I access the body from the code of my Control (i.e. above, "Some
9
2651
by: J055 | last post by:
Hi I have a standard asp page which uses a MasterPage. The MasterPage contains a User control. How can I access a public method in the User control from my WebForm page? I can't move the method to another location because it populates a Textbox in the user control page. Thanks Andrew
1
1852
by: Bully | last post by:
I want to wrap a .Net command button using COM Interop, and then use this usercontrol in VB6. Is this possible and has anybody tried it? Bully
0
9636
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
9474
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
10306
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
9931
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8961
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
7485
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
6727
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5504
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2869
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.