asp.net vb.net master page section different

I have a master page, in my website, but i need a different section of master page only when user calls site (first page) like www.xxxx.com. In the other pages, mastewr page is the same. For ex. in main page i need put an image, but in other pages i want a menu in the same location of image.
rflorencioAsked:
Who is Participating?
 
abelConnect With a Mentor Commented:
Do you mean that you want to use one Master Page, but you would like to access the contents for this masterpage? You can do as follows:
  1. Create a public property, sub or function in the masterpage: Property MySectionUrl
  2. set the <@ MasterType directive in the Page ASPX code to the file of the masterpage
  3. use Master.MySectionUrl just like you would with any other class
-- Abel --
0
 
CodeCruiserCommented:
You need to use different masterpages in this case. Or you need to put some logic in the masterpage to see what the request URL is. Depending on the requested URL, the masterpage can adjust itself.
0
 
abelCommented:
@CodeCruiser: see my comment. That is not necessary. You can access the masterpages from the pages.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
CodeCruiserCommented:
Yes but the question was not to access the property but rather to display different content.
0
 
abelCommented:
I know. But the beauty is, that by changing the property (or accessing a method) you can display different content...
0
 
CodeCruiserCommented:
My comment was accepted in a similar way but the moderator forced the acceptance of jpaulino's comment.
0
 
abelCommented:
I don't understand. There's no moderator here and no jpaulino...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.