server.Transfer error on web part
Hi! I'm new to C# and I am currently creating a page that transfers to another page. I've read the other forums and articles about using server.Transfer when opening another page. But when I compile my code, it states that "The type or namespace name 'server' could not be found (are you missing a using directive or an assembly reference?)"
What should I do to remove this error? Thanks!
Re: server.Transfer error on web part
Use a capital S, ie Server.Transfer()...
Re: server.Transfer error on web part
hi! I 've tried replacing server with Server but it resulted to an error :
"The type or namespace name 'Server' could not be found (are you missing a using directive or an assembly reference?)"
Re: server.Transfer error on web part
Where are you putting this code - inline, code behind, etc?
Depending on how you initiated this page, the references may not be set correctly.
You'll need a dll reference to System.Web, then the actual Server.Transfer uses System.Web.HttpServerUtility.Transfer. The Server is an object setup by ASP.NET during runtime.
Re: server.Transfer error on web part
Quote:
Originally Posted by mmetzger
Where are you putting this code - inline, code behind, etc?
Depending on how you initiated this page, the references may not be set correctly.
You'll need a dll reference to System.Web, then the actual Server.Transfer uses System.Web.HttpServerUtility.Transfer. The Server is an object setup by ASP.NET during runtime.
code-behind. (web part)