asp.net - Checking user authentication in Page_Load()... anywhere else? -


for each page in asp.net webforms app check user's access this:

protected void page_load(object sender, eventargs e) {     if (!usercanaccesspage())         redirecttoaccessnotpermitted();      // < if user has access, set page > } 

my question is, single check enough or should check @ other handlers:

protected void seriousdeletebutton_click(object sender, eventargs e) {      // ** need check access again here? **      // < stuff users have access > } 

i know under normal page lifecycle page_load() should called before event handlers, i'm wondering if there's tricky way hit other asp.net endpoints curl or mucking around javascript or something.

(i'm talking regular webforms-style postbacks, no explicit ajax stuff. of course updatepanel uses asynchronous javascript , i'm sure other controls to.)

yes, enough, because page_load called every time user requests new page or posts page. not need check again in button click events.

however, fine website couple of pages. in other words, if have multiple pages, maintenance nightmare.

normally, want use form authentication, , restrict acesss pages using web.config.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -