Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Update server side asp variable in page behind code

Reply
Thread Tools

Update server side asp variable in page behind code

 
 
=?Utf-8?B?Um9iZXJ0?=
Guest
Posts: n/a
 
      02-04-2004
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.
 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      02-04-2004
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" <> wrote in message
news:075105B5-6021-44EA-9667-...
> 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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LinkButton Client side code firing before server side code alexmac262@hotmail.com ASP .Net 1 03-22-2007 06:13 PM
server side code access the text of <asp:label> changed by client-side javascript code? nick ASP .Net 3 12-15-2004 06:26 PM
how client-side presentation code interacts with server-side sorting/filter code? jrefactors@hotmail.com Java 1 12-08-2004 12:30 AM
how client-side presentation code interact with server-side filter/sort processing code? jrefactors@hotmail.com Javascript 0 12-07-2004 11:15 PM
How can Server-Side variable'value be given to Client-Side variable by program Jack ASP General 3 01-29-2004 01:09 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57