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

where in page cycle to place code?

in my masterpage codebehind I want to do a final check after the content
page codebehind has been run. Where in the page cycle (in what event) could
I place this code?
Nov 19 '05 #1
4 1522
it dpends on what your final check means. the prerender is the last chance
to add /modify any controls. page unload is called after render, so all
processing that means anything is done.

-- bruce (sqlwork.com)

"Daves" <db****@simnet.is> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
| in my masterpage codebehind I want to do a final check after the content
| page codebehind has been run. Where in the page cycle (in what event)
could
| I place this code?
|
|
Nov 19 '05 #2
ok it's just a short code to check if user has access to the current page
and so to forward him to login page if not. The content page sets the
PageNeedsLogin property which the masterpage code checks for...
so I'd add a void Page_PreRender(...) event function, right?

"bruce barker" <no***********@safeco.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
it dpends on what your final check means. the prerender is the last chance
to add /modify any controls. page unload is called after render, so all
processing that means anything is done.

-- bruce (sqlwork.com)

"Daves" <db****@simnet.is> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
| in my masterpage codebehind I want to do a final check after the content
| page codebehind has been run. Where in the page cycle (in what event)
could
| I place this code?
|
|

Nov 19 '05 #3
to check access, i'd do it in the onauthenticate request event (in
global.asmx) or oninit if done at page level

-- bruce (sqlwork.com)
"Daves" <db****@simnet.is> wrote in message
news:ON**************@tk2msftngp13.phx.gbl...
| ok it's just a short code to check if user has access to the current page
| and so to forward him to login page if not. The content page sets the
| PageNeedsLogin property which the masterpage code checks for...
| so I'd add a void Page_PreRender(...) event function, right?
|
| "bruce barker" <no***********@safeco.com> wrote in message
| news:%2****************@TK2MSFTNGP12.phx.gbl...
| > it dpends on what your final check means. the prerender is the last
chance
| > to add /modify any controls. page unload is called after render, so all
| > processing that means anything is done.
| >
| > -- bruce (sqlwork.com)
| >
| >
| >
| > "Daves" <db****@simnet.is> wrote in message
| > news:%2****************@TK2MSFTNGP10.phx.gbl...
| > | in my masterpage codebehind I want to do a final check after the
content
| > | page codebehind has been run. Where in the page cycle (in what event)
| > could
| > | I place this code?
| > |
| > |
| >
| >
|
|
Nov 19 '05 #4
Daves wrote:
ok it's just a short code to check if user has access to the current page and so to forward him to login page if not. The content page sets the PageNeedsLogin property which the masterpage code checks for...
so I'd add a void Page_PreRender(...) event function, right?


Hang on. Wouldn't you want to check permissions BEFORE you populate
the page? Not only are you throwing away a lot of effort, but you're
opening yourself up to some nice security holes too. Imagine a user
calling:

DeleteSomeRecord.aspx?recordID=1000

If you perform all your processing, and only wait until
Page_PreRender() to redirect, the page will have done its thing
already. Redirecting the user would then only stop him from seeing the
"Successfully Deleted Company #1000" message.

First order of business in Page_Load should be to do any security
checking and user redirection.

Good luck!
Jason
http://www.expatsoftware.com/

Nov 19 '05 #5

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

Similar topics

3
by: islay | last post by:
Hello, I'm trying to print more than one page using the PrintDocument object. I set "e.HasMorePages = True" after completeing the first page in the "PrintDocument1_PrintPage" subroutine, and...
3
by: HP | last post by:
Hi there The problem of dynamically created controls vs viewstate is widely known one. To access values of controls they have to be recreated on Page_Load. Unfortunately it causes many...
1
by: ywoolf | last post by:
Trying to figure out how to auto-cycle an iFRAME. Here is the link in question: http://pushingtheenvelope.ca/new/web.html Would like to cycle the iFRAME choices. Got this from...
11
by: pg | last post by:
My old HD crashes, so I had to do a total re-install. After installer XP, I went to the Micrsoft Update site to get all the update. After 5 hours or so ... the update cycle started looping. ...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.