473,386 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

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.

Nov 18 '05 #1
5 2397
Thank god Request.Form is still around in 2.0, right? :)

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"nail" <na**@seaforce.net> wrote in message
news:eQ**************@TK2MSFTNGP14.phx.gbl...
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.

Nov 18 '05 #2
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****************@TK2MSFTNGP15.phx.gbl...
Thank god Request.Form is still around in 2.0, right? :)

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"nail" <na**@seaforce.net> wrote in message
news:eQ**************@TK2MSFTNGP14.phx.gbl...
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.


Nov 18 '05 #3
You might need to write your own httpModule and make it handle
PreRequestHandlerExecute event .??

--
Girish Bharadwaj
http://msmvps.com/gbvb
"nail" <na**@seaforce.net> wrote in message
news:OB*************@TK2MSFTNGP09.phx.gbl...
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****************@TK2MSFTNGP15.phx.gbl...
Thank god Request.Form is still around in 2.0, right? :)

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"nail" <na**@seaforce.net> wrote in message
news:eQ**************@TK2MSFTNGP14.phx.gbl...
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.



Nov 18 '05 #4
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" <na**@seaforce.net> wrote in message
news:OB*************@TK2MSFTNGP09.phx.gbl...
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****************@TK2MSFTNGP15.phx.gbl...
Thank god Request.Form is still around in 2.0, right? :)

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"nail" <na**@seaforce.net> wrote in message
news:eQ**************@TK2MSFTNGP14.phx.gbl...
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.



Nov 18 '05 #5
Thank's Girish.
I try httpmodule an it works very fine.

nail

"Girish Bharadwaj" <gi*****@mvps.org> wrote in message
news:uQ*************@TK2MSFTNGP12.phx.gbl...
You might need to write your own httpModule and make it handle
PreRequestHandlerExecute event .??

--
Girish Bharadwaj
http://msmvps.com/gbvb
"nail" <na**@seaforce.net> wrote in message
news:OB*************@TK2MSFTNGP09.phx.gbl...
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****************@TK2MSFTNGP15.phx.gbl...
> Thank god Request.Form is still around in 2.0, right? :)
>
> Karl
>
> --
> MY ASP.Net tutorials
> http://www.openmymind.net/
>
>
> "nail" <na**@seaforce.net> wrote in message
> news:eQ**************@TK2MSFTNGP14.phx.gbl...
>> 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.
>>
>>
>>
>
>



Nov 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Colin McGuire | last post by:
Hi, I have an report in Microsoft Access and it displays everything in the table. One column called "DECISION" in the table has either 1,2, or 3 in it. On my report it displays 1, 2, or 3. I want...
5
by: Andrei Pociu | last post by:
Inside a method some controls are created at runtime. I added an event handler to one of these controls: tracker.Scroll += new System.EventHandler(this.tracker_Scroll); So in the event handler...
29
by: Patrick | last post by:
I have the following code, which regardless which works fine and logs to the EventViewer regardless of whether <processModel/> section of machine.config is set to username="SYSTEM" or "machine" ...
10
by: Shawn | last post by:
JIT Debugging failed with the following error: Access is denied. JIT Debugging was initiated by the following account 'PLISKEN\ASPNET' I get this messag in a dialog window when I try to open an...
2
by: shapper | last post by:
Hello, I need to set, at runtime, MyLabel.SkinID="MySkinID". I know this must be done in Page PreInit event. However, MyLabel is in my Master Page. I tried to add the Page PreInit event...
6
by: Rahul | last post by:
this is my code in preinit event I have "hlinkAdd" as hyperlink web control and i am using a master page, and below code is of content page preinit event. Protected Sub Page_PreInit(ByVal sender...
7
by: Andy B | last post by:
I have an instance of an object that needs to be accessed by all members of a page like page_load, button_click events and so on. Where in the codebehind would I put the creation of the object...
10
by: Cirene | last post by:
I know that sometimes referring to controls deep in a page using a Master Page can be funky. For a website using a standard header/footer/nav, do you prefer using User Controls for the common...
8
by: Jonathan Wood | last post by:
I want to dynamically set my site's theme based on a setting stored in my database. I just hooked this up but get an error that the theme can only be set in the page's PreInit event or earlier....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.