Loading....
Recent Article links:

facebook

Dasun Wickasitha's Facebook profile

Fun with .NET

Article

Solution for Master Page Image Display Problem in Asp.net

Master Page Image Display Problem and Solution in Asp.net

Master Page is creating problem when a page inside folder is trying to refer master page. The reason of problem is Master Page is using absolute image url, which changes when you try to refer same inside folder.


problem

A simple solution to problem is to define relative path for images inside master page.

So if you have coded like following in your MasterPage File

<img src=”Images/Logo.gif”/>
Than Replace it with,

<img src=”<%= Page.ResolveUrl(”~“)%>Images/Logo.gif”/>

 

Also you can solved this problem by doing this:

<img src=”~/images/logo.gif” runat=”server” />
kick it on DotNetKicks.com

Rate this:
0.0
Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Facebook
  • Google Bookmarks
  • Live-MSN
  • YahooMyWeb
  • DotNetKicks

Comments (No comments)

What do you think?

Subscribe

Everything for free

Archives

Visitors

ACF loading animated gif