.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Master Page HTML IMG Path issue

Posted By:      Posted Date: October 15, 2010    Points: 0   Category :ASP.Net

This is directory structure

Project >> Portal >> Images >>Inside these are images

Project >> Portal >> StyleSheet>>Inside these are styelsheet

Project>> Portal >> Master Page

Project >> Portal >> Signup >> Web form using master pages

Image path on master page

<img src="images/logo.jpg" />

but this image doesn't show up in the web form, I could use ASP image tag to solve this issue, is there any other way out? HTML does understand this ~

View Complete Post

More Related Resource Links

Re-positioning an HTML container with javascript onresize with a Master page.


I have an HTML <div> container that I float to the right of a gridview.  When the browser window is maximized, it looks fine.  When minimized, the gridview positions below the floating container and most of the data is pushed off the bottom of the browser - you have to scroll down to see it.

If I position the floating container above the gridview it looks fine in a minimized window, but looks real bad when maximized.

What I want to do is use a javascript: onresize event to re-position the floating container up or down depending on the window.inner.width AND do it with a Master/Content page structure AND do it for only the one page where needed.

I can capture the onresize event and display the window dimensions but haven't figured-out how to do it with a Content page that still uses the Master page.  I think I'm having a very "thick" week...

- Tinker


Master Page css linking issue

I'm having an issue with my css file linking to one of my nested master page.This is the general setup of my site:Root-RootMaster.master--Dir1---Dir1Master.master---Dir1Style.css--Dir2---SubDirA----Dir2Master.master----Dir2Style.cssI have a content place holder in the <head> of the RootMaster.master so that I can specify a css file for each nested master page.  I have Dir2Style.css linked in Dir2Master.master, and it works both in the designer and on the site for all content pages.  It's linked like so:<link href="Dir2Style.css" rel="Stylesheet" type="text/css" />However when I link Dir1Style.css to Dir1Master.master, it is only linking correctly in Visual Studio.  Whenever I open a content page in that directory using that master it doesn't apply the css.  I've also tried dragging and dropping the css file onto the page so that it sets up the path itself, and it still won't work.  The only way I've been able to get it to show correctly on the site is by doing a <% ResolveUrl() %> for the href, but then it doesn't work in the designer.  Any ideas on why it's working for one and not the other?  Both the nested master pages are set up the exact same except for the css link...

Permission issue - users not seeing correct master page and css


I have started playing with permission and created a whole that I can not climb out of! Any help will be great!!! Here are my issues:

1. (this one started it all) I added an approval workflow to a library with the thought that a doc would not show to the public until it is approved. Ain't happening...what do I have to do for this process to work?

2. In trying to solve the above I restricted nt auth to the visitors group and then made that group read only. Now members of the visitor group only sees the old master page and css. The only way to fix it so far is to add nt auth to the owners group. that won't fly.


Sharepoint 2007 Minimal Master Page Picture Library Thumbnail and FilmStrip issue



If i use custom master pages. For some reason a user cannot view the thumbnail or filmstrip view;  only the details view will display. No errors are thrown when a user selects the filmstrip or thumbnail view, in fact nothing happens at all.

If the master page for the site is changed to default.master then the picture library functionality returns.

Anyone can help me in this. Thanks in advance.

Virtual path provider to have custom path tokens in master page references


I managed to port Asp.net MVC to run in a Sharepoint site (only inside a particular folder not everywhere) by:

  1. Writing an IHttpModule that I use to register routes, areas, view engine and virtual path provider inside the Init method, that is called only once per application life hence it works like an application_start event
  2. Writing a custom URL routing module that only performs routing for a particular subfolder path, all other paths are ignored, so everything else works just as it does and is completely handled by sharepoint
  3. Writing a custom view engine that defines different view/master paths related to the subfolder where MVC is running
  4. Writing a costom virtual path provider that should allow me to reference masterpages based on my configured subfolder where MVC is running.
  5. Adding a virtual folder (without assigning it an application) to my Sharepoint's site, so my app will be running as part of Sharepoint site and not as a separate application
  6. Customizing Sharepoint site's config to add my MVC application's configuration, adding MVC assemblies to compilation section, adding namespaces to <pages> element so I my view will see Html helpers, and adding two modules (my intialization module that registers routes etc) and subfolder routing module.

But I would like to accomplich

Issue creating new master page



I'm trying to create a new master page by clicking on the 'Blank Master Page' button within Sharepoint Designer 2010. I have appropriate permissions. I am getting a dialog - 'SErver error: The file http://www.mydomain.com/_catalogs/masterpage/Untitled_1.master is checked out for editing by i:0#.w|domain\username.' (where domain\username are legitimate values) and I cannot proceed.

I have checked and that user has no such file checked out, and in fact, we can find no such file. 

Any ideas how to proceed?

IE 7 rendering issue in Sharepoint 2010 Master Page


Hi All,

I have an Branding issue, we designed a Custom Master page with Custom Css in Sharepoint 2010 Designer, it is rendering perfectly in all browsers as per design and css but, if we open in IE 7 design is distorted all the webparts are placed differently,

we used all Doctype tag

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 and <meta http-equiv="X-UA-Compatible" content="IE=7" /> also

we used DIV 's for this,

unable to find the solution please help me.

Thanks in advance


Unique content within master page based on conditions met


 Hi all-

I would like to present users with unique content based on certain conditions being met as they land on the home page (default.aspx).  The condition logic will be in the VB code behind Page Load event. The content will go in a content placeholder as specificed from the master page. 

However, the content change wouldn't be something small (ie making a panel or label visible or not) but rather it will be different HTML,  Divs and databound gridview content.  The HTML content will be stored in the database.

Can someone point me in the right direction for best practices on how to accomplish this?


Passing Linq Statement between master and content page


I usually work with windows forms, and am just starting to work with ASP.Net, so appologies if this is a dumb question!

I have a master page which has a search button on it. The results of this are built up using a Linq statement and if there are any results, I want to display the results in a contents page.

On the masterpage, I have the following code:

Private _res

    Public Overridable ReadOnly Property SearchRes()
            Return _res
        End Get
    End Property

 Private Sub DoSearch()
   'some code to get a linq result

    If res.Any Then
            _res = res
            Server.Transfer("SearchResults.aspx", True)
            'no results
            LabelNoRes.Visible = True
        End If
 End Sub

On the SearchResults.aspx page I have this code.

Dim m As pxSite = CType(Page.Master, MasterPage)
        If m.SearchRes IsNot Nothing Then
            Label1.Text = "Results found = " & m.SearchRes.Count
        End If

m.searchRes is always nothing. 

What am I doing wrong here?


Not getting multiple composite controls on master page


I have created two composite controls in the same assembly and registered that assembly in a master page using <%@ Register tag.

When I try to use these controls using the registered tag prefix I am getting only one control along with the tagprefix .

How to get all the composite controls present in the registered assembly?

Master Pages: Master Your Site Design with Visual Inheritance and Page Templates


Master pages in ASP.NET 2.0 solve a problem many Web developers have been solving on their own with a variety of techniques for years - providing a single master template for an entire site. This article covers the details of master pages, discussing their usage and implementation and how they are a natural evolution of custom techniques developers are using today.

Fritz Onion

MSDN Magazine June 2004

Dynamic Checkboxlist exception when adding to Panel when using Master Page


In essence, I am creating Dynamic Checkboxlist controls and adding them to a Panel.  It works well when I do not have a Master Page configure to this webpage. Once I have a masterpage congifured.. I get a "Object Reference not set to instance of object" error on the Panel_Control.Controls.Add(Checkboxlistnew) line:

protected void Page_PreInit(object sender, EventArgs e)
        XML OXML = new XML();
        alistChkBoxLabels = OXML.XMLTransform("C:\\Documents and Settings\..\\Config_new.xml", "config_options/check_box/applications/app/@name");
        int count = 1;
        alistCheckisFacility = new ArrayList();
        alIDTracker = new ArrayList();
        while (count <= alistChkBoxLabels.Count)

            Checkboxlistnew = new CheckBoxList();
            Checkboxlistnew.ID = count.ToString();
            Checkboxlistnew.Items.Add(new ListItem(alistChkBoxLabels[count - 1].ToString(), alistChkBoxLabels[count - 1].ToString()));

            String sAppName = alistChkBoxLabels[count - 1].ToString().Trim();

            alistCheckisFacility = OXML.XMLTransform("C:\\Documents and Settings\\Administrator\\My Documents\\Visual Studio 2005\\WebSites\\User_Trial\\Config_new

Button click in master page use in other pages I have to click twice. Why?


In my masterpage I have a menu with buttons. I want the buttons to do something after click. It works but I have to click twice on the button, why? What do I have to do to just to click once?

Is master page a best alternative for Frame Sets ??


My webpage has one banner with a logo, a vertical menu bar on the left side of the page and a footer . I have 5 other pages which should get loaded when the user select them from the menu bar. what my concern is actually the banner,  menu bar  and the footer should not change when the requested page loads. This definitely can be handled by sets. But I want to know whether there are any other alternatives for frame sets or could master page be helpful for this purpose ????? 

Any help would be appreciative .

DropDownMenu disapper in master page


Dear all,


I have master page and wen i use master page my drop down menu selection disapper in web forms...could anyone pls help me...am not so clear about z-index...








@ Master Language="VB" AutoEventWireup="false" CodeBehind="Default.master.vb" Inherits="E_Management._Default1" %>

asp.net path issue


Hi all,
I am working on an application where many hyperlinks ( <a hrefs> like <a href=/web/index.html ) are used. The website is working fine on live server. The previous link goes to wwww.mysite.com/web/index.html which fine. But when i setup the website on my local machine. The above link goes to
http://localhost/web/index.html which is not correct path and I get resource not found error. If i correct the path in browser like this :

Apply custom.master to "Site Settings" page?


I'm using a custom.master page, which is applied to almost all pages available to READ users.

However, I'd like to apply it to the Search, Site Settings, and View All Site Content pages.

I'm not sure where this would be applied.

Guidance much appreciated. Thanks!

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend