How access the Page PreInit event from a control at runtime?

N

nail

Hi.
Anyone knows how can I change the theme from my custom control.
My custom control render a dropdownlist with the availables themes, getting
in the Themes folder.
But when I try to chane the Page.Theme property, I get this error:

The 'Theme' property can only be set in or before the Page_PreInit event

So, how can I set the Theme in or befor the Page_PreInit?

Thanks.
 
N

nail

Yeah man, that exists.
But you forgot? I am developing a custom control, and if a try:

Page.Theme = Request.Form[my_custom_control]

I get the same error.
The 'Theme' property can only be set in or before the Page_PreInit event


In what event of my control do you want to put the Request.Form?

Thanks.
 
G

Girish Bharadwaj

You might need to write your own httpModule and make it handle
PreRequestHandlerExecute event .??

--
Girish Bharadwaj
http://msmvps.com/gbvb
nail said:
Yeah man, that exists.
But you forgot? I am developing a custom control, and if a try:

Page.Theme = Request.Form[my_custom_control]

I get the same error.
The 'Theme' property can only be set in or before the Page_PreInit event


In what event of my control do you want to put the Request.Form?

Thanks.
 
K

Karl Seguin

Oh, I was thinking you could put it in the page's preinit event :) I
realize it's an ugly solution though...page reading values that control
sets...

Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/


nail said:
Yeah man, that exists.
But you forgot? I am developing a custom control, and if a try:

Page.Theme = Request.Form[my_custom_control]

I get the same error.
The 'Theme' property can only be set in or before the Page_PreInit event


In what event of my control do you want to put the Request.Form?

Thanks.
 
N

nail

Thank's Girish.
I try httpmodule an it works very fine.

nail

Girish Bharadwaj said:
You might need to write your own httpModule and make it handle
PreRequestHandlerExecute event .??

--
Girish Bharadwaj
http://msmvps.com/gbvb
nail said:
Yeah man, that exists.
But you forgot? I am developing a custom control, and if a try:

Page.Theme = Request.Form[my_custom_control]

I get the same error.
The 'Theme' property can only be set in or before the Page_PreInit event


In what event of my control do you want to put the Request.Form?

Thanks.


Karl Seguin said:
Thank god Request.Form is still around in 2.0, right? :)

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/


Hi.
Anyone knows how can I change the theme from my custom control.
My custom control render a dropdownlist with the availables themes,
getting
in the Themes folder.
But when I try to chane the Page.Theme property, I get this error:

The 'Theme' property can only be set in or before the Page_PreInit event

So, how can I set the Theme in or befor the Page_PreInit?

Thanks.
 
Joined
Jun 27, 2007
Messages
2
Reaction score
0
Hi Guys

Hi

Will nay one tell me how to do by using HTTPModule for setting ASP.Net page theme dynamically.

nail said:
Thank's Girish.
I try httpmodule an it works very fine.

nail

"Girish Bharadwaj" <[email protected]> wrote in message
news:[email protected]...
> You might need to write your own httpModule and make it handle
> PreRequestHandlerExecute event .??
>
> --
> Girish Bharadwaj
> http://msmvps.com/gbvb
> "nail" <[email protected]> wrote in message
> news:[email protected]...
>> Yeah man, that exists.
>> But you forgot? I am developing a custom control, and if a try:
>>
>> Page.Theme = Request.Form[my_custom_control]
>>
>> I get the same error.
>> The 'Theme' property can only be set in or before the Page_PreInit event
>>
>>
>> In what event of my control do you want to put the Request.Form?
>>
>> Thanks.
>>
>>
>> "Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
>> wrote in message news:eN$n8%[email protected]...
>> > Thank god Request.Form is still around in 2.0, right? :)
>> >
>> > Karl
>> >
>> > --
>> > MY ASP.Net tutorials
>> > http://www.openmymind.net/
>> >
>> >
>> > "nail" <[email protected]> wrote in message
>> > news:[email protected]...
>> >> Hi.
>> >> Anyone knows how can I change the theme from my custom control.
>> >> My custom control render a dropdownlist with the availables themes,
>> > getting
>> >> in the Themes folder.
>> >> But when I try to chane the Page.Theme property, I get this error:
>> >>
>> >> The 'Theme' property can only be set in or before the Page_PreInit

> event
>> >>
>> >> So, how can I set the Theme in or befor the Page_PreInit?
>> >>
>> >> Thanks.
>> >>
>> >>
>> >>
>> >
>> >

>>
>>

>
>
 
Joined
Jun 27, 2007
Messages
2
Reaction score
0
Will any one tell me how to do HTTP Module for setting the theme as per the dropdown value of the usercontrol which was included in the Page.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top