Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > How to read/write standard server control properties from a class file? VB.NET example requested.

Reply
Thread Tools

How to read/write standard server control properties from a class file? VB.NET example requested.

 
 
John Smith
Guest
Posts: n/a
 
      04-01-2004
I want to be able to read and write standard server control properties
from code in a separate class file in vb.net. I learned how to access
the httpcontext of the calling .aspx page in the class file code, like
this:

Dim _Context As HttpContext = HttpContext.Current

which lets me do things like:

_Context.response.redirect("otherpage.aspx")

This is great. Now I need to learn how to read and write standard
server control properties from the code in a separate class file. For
example, if I have a label named label1 on the calling aspx page, how
do I do a label1.text = "hello" from code in the class file?

I need this to work if I call the code in the class file from any
number of different aspx files, the names of which I won't know up
front. Thus, I need the class file code to be able to sense what aspx
file is calling it, and take the appropriate steps.

I saw so many posts on this question, but the answers were all too
complex or too brief for me to understand. I need a complete example,
and assume I don't know what things like "cast" mean. I know that
this will be easy once I learn the trick, but I burned up most of
today trying to solve this.

In particular, do I need to do anything to the calling aspx page? I
suspect I need to change the server controls somehow so they are
publically available, butg I don't know.

On the class side, do I need to add any imports statements to the top?
Do I need to add any references? What code do I need to be able to
access arbitrary calling aspx pages?

Thanks!
 
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
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Class properties and object properties SuperZE Python 5 10-06-2008 02:14 PM
Designer Support: How to have user control's properties appear in IDE's properties window? Max2006 ASP .Net 2 07-13-2007 01:45 PM
Making Custom Control Properties Visible in Visual Studio's Properties Palette Nathan Sokalski ASP .Net 0 10-17-2005 02:05 AM
Nested Class, Member Class, Inner Class, Local Class, Anonymous Class E11 Java 1 10-12-2005 03:34 PM



Advertisments