[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

asp.net vb.net master page section different

Posted on 2009-04-20
7
Medium Priority
?
159 Views
Last Modified: 2012-05-06
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.
0
Comment
Question by:rflorencio
  • 4
  • 3
7 Comments
 
LVL 39

Accepted Solution

by:
abel earned 2000 total points
ID: 24183894
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
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24184944
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
 
LVL 39

Expert Comment

by:abel
ID: 24185286
@CodeCruiser: see my comment. That is not necessary. You can access the masterpages from the pages.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24185400
Yes but the question was not to access the property but rather to display different content.
0
 
LVL 39

Expert Comment

by:abel
ID: 24185818
I know. But the beauty is, that by changing the property (or accessing a method) you can display different content...
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24185989
My comment was accepted in a similar way but the moderator forced the acceptance of jpaulino's comment.
0
 
LVL 39

Expert Comment

by:abel
ID: 24186021
I don't understand. There's no moderator here and no jpaulino...
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question