473,508 Members | 2,303 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Use variable values in class.

Hello,

My aspx.vb file code is as follows:

Public Class _aspxgrid_template
Inherits System.Web.UI.Page
...
Private Sub Page_Load(...) Handles MyBase.Load
...
Dim var1 As String = "A"
Dim var2 As String = "B"
Dim var3 As String = "C"
column.ItemTemplate = CreateItemTemplate()
...
End Sub

Function CreateItemTemplate() As ITemplate
Return New ItemTemplate
End Function

End Class

In my ItemTemplate class I use some constants.
Instead of using constants how can I use var1, var2 and var3 values?

Thank You,
Miguel

Nov 19 '05 #1
2 926
Not quite sure what you are getting at, but this might be what you are after
as it replaces a constant with a property but makes It read only

Public Class Class1

Private m_var1 As String

Public ReadOnly Property var1() As String

Get

Return m_var1

End Get

End Property

End Class
"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message
news:Oz*************@tk2msftngp13.phx.gbl...
Hello,

My aspx.vb file code is as follows:

Public Class _aspxgrid_template
Inherits System.Web.UI.Page
...
Private Sub Page_Load(...) Handles MyBase.Load
...
Dim var1 As String = "A"
Dim var2 As String = "B"
Dim var3 As String = "C"
column.ItemTemplate = CreateItemTemplate()
... End Sub

Function CreateItemTemplate() As ITemplate
Return New ItemTemplate
End Function

End Class

In my ItemTemplate class I use some constants.
Instead of using constants how can I use var1, var2 and var3 values?

Thank You,
Miguel

Nov 19 '05 #2
"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in
news:Oz*************@tk2msftngp13.phx.gbl:

In my ItemTemplate class I use some constants.
Instead of using constants how can I use var1, var2 and var3 values?


You need to expose the variables a public properties.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.

Newmarket Volvo Sucks! http://newmarketvolvo.tripod.com
Nov 19 '05 #3

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

Similar topics

2
4694
by: Marc | last post by:
Hi all, I was using Tkinter.IntVar() to store values from a large list of parts that I pulled from a list. This is the code to initialize the instances: def initVariables(self): self.e =...
166
8479
by: Graham | last post by:
This has to do with class variables and instances variables. Given the following: <code> class _class: var = 0 #rest of the class
10
387
by: Simon Harvey | last post by:
Hi everyone, Can anyone tell me if I declare a global variable in my pages code behind, is it persisted if the page does a post back, or do I need to add the object to the session object in...
9
3121
by: Shapper | last post by:
Hello, I am declaring a variable in my aspx.vb code as follows: Public Class catalogue Public productid As String Private Sub Page_Load ... I have an image button where I call the...
7
2177
by: Aaron | last post by:
Complete code follows. I am new to .NET programming (and programming in general) and I am having a difficult time understanding how to fill a variable in one sub, and then access it from...
10
1427
by: Mark A. Sam | last post by:
Hello, I am using Visual Web Developer and decared a Public Variable in the Class section. I assigned a value in the load section, and on a button I set it up to increment, but it always...
5
2258
by: strawberry | last post by:
In the function below, I'd like to extend the scope of the $table variable such that, once assigned it would become available to other parts of the function. I thought 'global $table;' would solve...
8
12604
by: Jeff | last post by:
Still new to vb.net in VS2005 web developer... What is the proper/standard way of doing the following - setting the value of a variable in one sub and calling it from another? E.g., as below....
0
2019
by: zman77 | last post by:
EDIT: -- forgot to mention... I am using Visual Studio 2005, on Win XP, on an intel machine Hi. This is my first post, though I've "lurked" for a while because I find these forums very helpful....
1
3673
by: sap0321 | last post by:
This should be kindergarten stuff but for some reason I am having trouble with it. I do 99.9% web programming and this is the first windows app i've done in years - probably the first ever in C# ......
0
7225
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,...
0
7123
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...
0
7324
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,...
0
7495
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...
0
5627
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,...
1
5052
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...
0
4707
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...
0
3181
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1556
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.