Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 5th, 2007, 07:56 AM
Registered User
 
Join Date: Jan 2007
Location: Surat, Gujarat, India.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to harsh.kintu
Default Problem in nested master pages.

hi,

friends i am littlebit new in .net 2.0 and i have a problem.
please, help me.

i am using nested master pages in my project.
one is :
Front.master - > inner.master - > index.aspx
second is :
InnerFront.master - > inner.master - > aboutme.aspx

here, i have to call Page_PreInit method of inner.master, so it will select the master page according to requested URL.
if it is index.aspx then it will select Front.master
else it will select InnerFront.master.

i am unable to call PreInit method from Page(ex. : index.aspx)

from,
Harsh Pandit
kintu designs
  #2 (permalink)  
Old January 8th, 2007, 07:39 PM
Friend of Wrox
 
Join Date: Feb 2006
Location: , , USA.
Posts: 116
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well you wouldn't call pre_init, you would handle it if necessary by overriding it. It will always be called before the page loads on every iteration of the page life cycle. It will be called regardless of whether you handle it for yourself or "call it". At least thats my understanding of it. I think you should create a base page class that inherits from Page, handle the pre_init event in that, then inherit the base page class in every aspx page. Then in the pre_init handler you would check the request to see what page was requested and specify what master page to load dynamically. This blog post does a much better job of expaining it than I do:

http://www.odetocode.com/Articles/450.aspx

Good luck.
  #3 (permalink)  
Old January 9th, 2007, 10:04 AM
Registered User
 
Join Date: Jan 2007
Location: Surat, Gujarat, India.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to harsh.kintu
Default

thanks a lot Neil.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Master Pages Jayahar ASP.NET 3.5 Basics 1 September 2nd, 2008 04:20 PM
Problem accessing Request.Form with Master Pages kittu_asa ASP.NET 2.0 Basics 1 February 28th, 2008 09:38 AM
Problem accessing Request.Form with Master Pages niceFEPF ASP.NET 2.0 Basics 7 February 14th, 2008 04:25 PM
Master Pages, Content Pages and CSS carliviris Visual Studio 2005 0 January 8th, 2008 05:56 PM
strange "errors" with nested master pages... thenoseknows ASP.NET 2.0 Professional 2 November 28th, 2006 05:28 PM



All times are GMT -4. The time now is 05:04 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.