473,320 Members | 1,865 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,320 software developers and data experts.

Understanding OnPreRender and how to use it

Hi everyone.

I have a usercontol that changes one of the ViewState variables, it does
this when a button within it is pressed.

I would like to alter the appearance of the page based on this view state
variable, however i am told that the page has already been rendered at this
point, what do i need todo to make my page "rerender" with the new viewstate
information?

Im really unsure what to express in the main page object to accomplish this,
will my user control have to raise an event or something (again stuck, i
need to figure this out! :))

Alternatively, does anyone have a work around for this?

Thanks for all your help everyone.
Taz
Feb 13 '06 #1
3 1556
If you want to change the appearance of the page, you need to do so at the
latest in the pages pre-render event. Organise things this way and you will
be ok.

"Tarun Mistry" <no****@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi everyone.

I have a usercontol that changes one of the ViewState variables, it does
this when a button within it is pressed.

I would like to alter the appearance of the page based on this view state
variable, however i am told that the page has already been rendered at
this point, what do i need todo to make my page "rerender" with the new
viewstate information?

Im really unsure what to express in the main page object to accomplish
this, will my user control have to raise an event or something (again
stuck, i need to figure this out! :))

Alternatively, does anyone have a work around for this?

Thanks for all your help everyone.
Taz

Feb 13 '06 #2
Hi Taz,

I would be careful about believing anything "i am told." Even well-meaning
people can be wrong. When I am told something, even by someone I know, I put
the information into my "data for verification" memory area, and make a note
to research it. Here's a good reference for you. It tells you everything
that happens during the Page's execution (and any other ASP.Net Control's
execution), and when:

http://msdn.microsoft.com/library/de...nLifecycle.asp

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
We got a sick zebra a hat,
you ultimate tuna.
"Tarun Mistry" <no****@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi everyone.

I have a usercontol that changes one of the ViewState variables, it does
this when a button within it is pressed.

I would like to alter the appearance of the page based on this view state
variable, however i am told that the page has already been rendered at
this point, what do i need todo to make my page "rerender" with the new
viewstate information?

Im really unsure what to express in the main page object to accomplish
this, will my user control have to raise an event or something (again
stuck, i need to figure this out! :))

Alternatively, does anyone have a work around for this?

Thanks for all your help everyone.
Taz

Feb 13 '06 #3
Hi all, many thanks for your replies.

I have indeed got it working following your rendering advice. it seems
trying to save and then load data into the viewstate in one go doesnt work!

Thanks again!

With kind regards,
Taz
Feb 13 '06 #4

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

Similar topics

5
by: Daniel Groh | last post by:
Hi, i'd like to know more abou this event, i tryed to found in MSDN but the explanation is null for me...is there some explanation when and how should i use it ?
3
by: Kenton Smeltzer | last post by:
Hello All, I am having a problem with events and the addition of controls on a page I am developing. First let me tell you what I have tried and then maybe someone can see something I missed. ...
1
by: Umut Tezduyar | last post by:
Because of the fact that, handling events method ( IPostBackEventHandler.RaisePorstBackEvent method) is prior to OnPreRender method, i cannot handle the events of the controls that i am adding on...
4
by: Daniel Groh | last post by:
Hi, i'd like to know more abou this event, i tryed to found in MSDN but the explanation is null for me...is there some explanation when and how should i use it ?
1
by: 2310b | last post by:
I have a web form in which i use OnPreRender to load controls. it works fine BUT no matter what other events I call, the OnPreRender keeps executing. If I click on one of the buttons to fire off...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.