Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Redirecting from a Server Control
Message
From
14/08/2002 17:10:57
Jim Rieck
Quicken Loans/Rock Financial/Title Sourc
Livonia, Michigan, United States
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00689714
Message ID:
00689743
Views:
22
Hi Cathi,

You are a life Saver!! Thank you very much for the help...

Jim

>The Page property in WebControl class gets you the page in which the server control is running. Once you get the page you will be able to get its response and use the redirect method. For instance you could do the following from your custom control class:
>
>
>Page.Response.Redirect("hello.aspx")
>
>
>
>>Cathi,
>>
>> Thanks for the response. Is there another way to accomplish what I want to? Again, it would be redirecting a browser from a web page.
>>
>>
>>
>>>If you look at System.Web.UI.Page class, which is what a webform inherits from, you will see that it implements IHttpHandler. This interface is what is used to process HTTP Web requests. It exposes the Response object. Custom controls do not implement this interface and therefore Response is not available.
>>>
>>>>Hello,
>>>>
>>>> Ok, if you can answer this one, you are great! The issue is with redirecting the browser through code. I know that from a webform you can use Response.Redirect which is part of the System.web.HttpResponse class. Simple enough.... What about redirecting from a Custom Control? I tried the following code:
>>>>System.Web.HttpResponse.
>>>>
>>>>The wonderful Intellisense only gives me three options after the period for the code above. The options are Equals, ReferenceEquals and RemoveOutputCacheItem.
>>>>
>>>>What am I doing wrong?
Thanks

Jim
Previous
Reply
Map
View

Click here to load this message in the networking platform