Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Redirecting from a Server Control
Message
De
14/08/2002 17:10:57
Jim Rieck
Quicken Loans/Rock Financial/Title Sourc
Livonia, Michigan, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00689714
Message ID:
00689743
Vues:
23
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform