Master and Content Pages VB.Net - asp.net

I created a master page using visual studio. I'm trying to add content my pages but I'm having an issue. It's probably a simple thing that I'm missing.
My master page has a few divs. Basically a Header, a Sub Header, a left column with a menu, a Footer and then the bulk of the page is my Main.
My example video shows the instructor just dragging an image over to the body of the content page (in design view) and it works. She also dragged a gridview and a couple other items.
This part is annoying me because it's hanging me up.
Any thoughts?

I figured it out. I created several divs. When I did this my content placeholder shifted all the way down to the bottom, which is why my content was placed on the bottom.
I fixed my code so that way I had something like this.
<div id="Main">
<asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server">
</asp:ContentPlaceHolder>
</div>
which fixed it. You need those lines and the in order to place the content in the main.
I am happy I found my problem.
JWV

Related

Getting secondary sidebar menu to remain highlighted while visiting page

I recently added a page to our website and how it originally is set up so the Top Nav remains hightlighted as well as the menu on the left hand side. I am just looking to get the "Employee training" on the left hand side to remain highlighted while on the page. If you browse the other pages under this section you will see what I mean. Thanks for the help!
http://www.petrowestcorp.com/employee-training/
It appears that you have copied the Company Overview page to the Employee Training page and then made the necessary page changes.
The one change that you missed was within the
Remove the class from the first menu item (Company Overview) and put it in the last menu item (Employee Training)

How do you force an asp:Panel to overflow to the right when dynamically adding controls to a web site?

I'm trying to dynamically add controls to an asp:Panel on a web site so that they all appear on the same line. I have a set width, but when I add overflow:auto they still continue to be added on the next line when they run out of space. Is there a way to fix this?
Edit: I think I need something like the flowLayoutPanel for windows forms
Are your controls based on panel controls? Then this is normal behavior. Panels are usually generated as <div/> tags, and <div/> tags start on a new line by default.
Without actual HTML as a base I can't give you example code, but I suspect in order to do what you want, you're going to have to explore the display attribute in CSS. You can find out more about that here.

Adding a copyright message to images whatever size they are

I would like help for ways to add a copyright footer on web page.aspx so that it always remains at the end no matter the size of the image.
When my image increases in size, the copyright message should still appear on it.
Do you want copyright to appear on image or your aspx page ? If you want it on your aspx page, just wrap it inside a div and place it in your master page in the end.
If you want it on an image in your aspx page your should consider water marking it instead.

asp.net master pages, content pages

i have a master page with three sections, left pane + 2 right panes (one top header and one main screen area)
i want to have the main screen area dynamically fill a url based on a link click from the top header pane.
so in the header if i have three links - assume i have three pages (one.aspx, two.aspx, three.aspx) and i want to click a one, two, three link in the header pane of the master and have the content load in the main area of each associated child page in the main areas.
any idea?
The point of ASP .NET master pages are to do exactly what you are wanting without needing to fill areas of the page.
What I would suggest doing is moving the content that does not change per page (e.g. left pane and the top header/right pane) into the master page. and create a contentplaceholder for your main screen.
Then create your one.aspx, two.aspx, three.aspx pages and have them use your new master page. Now, when you edit the pages, the only area you will edit will be the content for the main screen area.
Any changes you make on the master page will be immediately reflected on all three pages without having to update each one.
If you had a different goal in mind please let me know. I'll do what I can to help.
When you created your pages you should have selected the MasterPage.
On each page you fill the content areas of your MasterPage.
So if you want to link to your pages you can put the links in each page's Head ContentPlaceHolder. So you link to 'one.aspx', 'two.aspx' and 'three.aspx' directly.
Each page will load it's MasterPage contents when it's requested. So it works like includes not frames (forget frames).
Just create your master page with your layout divs and use the to leave a place holder inside your content tab.
Next create a new page that uses your master page as its base and inside the automatically generated tag put your specific content for that page.
Create a new page inheriting the master page for each content page you want the header links to point to.
Hey presto no need for frames or script.
I'm not sure I completely follow your intent, but if I do get it, it sounds to me like what you want is a floating frame.

How to show content from contentPlaceholder inline

I have a page where in my masterpage have a toolbar with a "Home" button to the far left. This button is not in a contentplaceholder but on the page.
I want to have the opportunity for derived pages to add their own controls or whatever to the toolbar to be whown after the "home" button. But how to do this?
I have tried to put in a contentplaceholder, but it seems that I cannot get it to show inline with the other stuff, it breaks and the content of the contentplaceholder is shown below the button instead.
Does anyone know how to solve this?
Update:
Regarding the comment from #Remy below:
Do you, by chance, have a line break
in the masterpage's markup between the
button and contentplaceholder?
I started looking and because I'm a bit inexperienced at designing with CSS (when aligning text and an image vertically center). I created a table that enclosed each button - forgot that table are block elements, so there was my line break.
You can make the toolbar in the MasterPage available through a public property. Then you can access the master page from the content using Content.Master propery. Then you can add the controls to the toolbar as you add any runtime control.
Also, you need to Typecase the Content.Master to the type of your master file class before accessing its public property.
There are many ways:
from derived page you can get to the master page content over Page.MasterPage, and manipulate by controls located there. So you just need to allocate at master server-div or Panel and locate it by Page.MasterPage.FindControl to populate with particular inline elements
ContentPlaceholder does nothing with HTML layout, so you header can looks like:
<div>
<span> <!-- your Home button declaration goes there --> </span>
<span> <asp:ContentPlaceHolder ... </span>
</div>

Resources