473,624 Members | 2,121 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1566
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******** ********@TK2MSF TNGP12.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******** ********@TK2MSF TNGP12.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
24576
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
2424
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. First I tried adding the controls and the event handlers for my control in the Initialize Components method of my page in the hopes that it would fire the event before the
1
1585
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 the OnPreRender method. Is there a way for that. Can i manually tell asp.net page to check again if there is control that is post backing to the server. ex: Load IPostBackEventHandler.RaisePostBackEvent ( in this phase parameter is
4
2089
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
1583
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 the OnClick event, the OnPreRender runs!!! I don't get it. I've never seen this behaviour before. Does anyone have any ideas??? here's part of the class... namespace mynamespace { /// <summary>
0
8621
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8475
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7159
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6110
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2606
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1785
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.