473,396 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Update server side asp variable in page behind code

I have a User Control. Is it possible to define a variable in the User Control HTML like this

<
Dim strTem
%

and then use the page behind code in the Page_Load event to update this strTemp variable? VBScript please.
Nov 18 '05 #1
1 989
Hi Robert,

I think you need to get more OOP under your belt. You're thinking
procedurally. A User Control is a class. When you use the Dim statement in a
class, you are essentially creating a Private field, which is not accessible
to anything other than the class itself. You need to expose data in your
User Control either through a Public Field (Public strTemp As String) or a
Public Property (Public Property strTemp As String). You can then access the
value through any other class, including the Page class.

And do yourself a favor, and turn Option Strict ON!

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Robert" <an*******@discussions.microsoft.com> wrote in message
news:07**********************************@microsof t.com...
I have a User Control. Is it possible to define a variable in the User Control HTML like this:
<%
Dim strTemp
%>

and then use the page behind code in the Page_Load event to update this

strTemp variable? VBScript please.
Nov 18 '05 #2

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

Similar topics

4
by: Bob T | last post by:
Hi All, I am trying to pass a variable from my VB asp.net script (from for example Sub Page_Load in mypage.aspx.vb) to my Client side script. I have found and looked at a very good example...
1
by: radha | last post by:
hi friend Could somebody please tell me how to update an access record having two primary keys?(vb.net, asp.net, access Also how do we show a page from another page,for eg i am in page1.aspx and...
4
by: usl2222 | last post by:
Hi folks, I appreciate any assistance in the following problem: I have a form with a bunch of dynamic controls on it. All the controls are dynamically generated on a server, including all...
8
by: Mike Fellows | last post by:
Ok, im not sure if this is at all possible and if it is how i go about it is beyond me i have a piece of client side code that requires a piece of data from the server side (an ID number in this...
2
by: Guadala Harry | last post by:
In an aspx file I have declared a hidden field like this: <input id="hTestVal" type=hidden value="-1" runat="server"> Defined in the code-behind like this: protected...
4
by: Terry | last post by:
Hello, I am trying to get a response for an .aspx page in my current project (same virtual directory) by using WebRequest.GetResponse but I keep getting a exception with "500 Internal server...
3
by: rodchar | last post by:
hey all, i'm having trouble understanding the connection (if there is one beween) client-side scripting and server side scripting. For example can a variable that is defined in the code-behind...
3
by: J055 | last post by:
Hi I have a PlaceHolder control inside a FormView EditItemTemplate: <asp:PlaceHolder ID="phResponseText" runat="server"> <tr> <td> <asp:Label ID="lblResponseText"...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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
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
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...

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.