I'd like to move most of my code from my codebehind file to a class libary. Now I got the following statement:
string name = Server.HtmlEncode(TextBoxName.Text)
When using this in my class (.cs) file I'm obviously getting: The name 'Server' does not exist in the current context. I know it's a member of the Page Class but I can't really reference it from my class file. Is there any way to achieve this in a class file?
Thanks a lot!
reteep
Participant
874 Points
196 Posts
How to use Server.HtmlEncode() in a class file?
Aug 15, 2005 12:15 PM|LINK
string name = Server.HtmlEncode(TextBoxName.Text)
When using this in my class (.cs) file I'm obviously getting: The name 'Server' does not exist in the current context. I know it's a member of the Page Class but I can't really reference it from my class file. Is there any way to achieve this in a class file? Thanks a lot!
MorningZ
Star
8849 Points
1822 Posts
Re: How to use Server.HtmlEncode() in a class file?
Aug 15, 2005 01:52 PM|LINK
reteep
Participant
874 Points
196 Posts
Re: How to use Server.HtmlEncode() in a class file?
Aug 15, 2005 03:15 PM|LINK
Luis Abreu
All-Star
25674 Points
5369 Posts
MVP
Re: How to use Server.HtmlEncode() in a class file?
Aug 16, 2005 11:27 AM|LINK
Viewstate is a persistence mechanism managed by the page. it normally is used by controls. so if you're not building one, you shouldn't use it.
Regards,
Luis Abreu
email: labreu_at_gmail.com
EN blog:http://msmvps.com/blogs/luisabreu