I am having some trouble using an image embedded in a master page. The image displays fine in all pages, (including those located in child folders), except for my login page. Image tag is as follows...
The really strange thing is that if I edit the web.config so that login.aspx is no longer default "forms loginURL", the image works. As soon as I add the page back into the web.config, all I get is a blank image with a red cross.
I have already tried the following and it didn't work...
Check the generated source codein your browsers to see what the src of the image is. This may help in determining where the issue lies. If you can't find the problem, then paste the generated source code for the page so that we can try pinpoint what the
problem can be.
I adopt a lazy development methodology: write efficient code once which is simply re-used everywhere needed.
The really strange thing is that if I edit the web.config so that login.aspx is no longer default "forms loginURL", the image works. As soon as I add the page back into the web.config, all I get is a blank image with a red cross.
It seems like a permission issue. Try by giving permission for all the users to images folder, like below
steve_flynn
Member
21 Points
42 Posts
Master Page Image on Login Page
Jun 22, 2012 10:12 AM|LINK
Hi
I am having some trouble using an image embedded in a master page. The image displays fine in all pages, (including those located in child folders), except for my login page. Image tag is as follows...
<img alt="" class="style1" src="~/Images/Logo.jpg" align="left" runat="server"/>
The really strange thing is that if I edit the web.config so that login.aspx is no longer default "forms loginURL", the image works. As soon as I add the page back into the web.config, all I get is a blank image with a red cross.
I have already tried the following and it didn't work...
<img src="<%= Page.ResolveUrl("~")%>~/Images/Logo.jpg"/>
Can anyone help me with this?
Regards
Steve
RameshRajend...
Star
7983 Points
2099 Posts
Re: Master Page Image on Login Page
Jun 22, 2012 10:30 AM|LINK
Hey try this
<img src="<%= ResolveUrl("Images/Logo.jpg")%>" />
Mudasir.Khan
All-Star
15346 Points
3142 Posts
Re: Master Page Image on Login Page
Jun 22, 2012 10:45 AM|LINK
try this
<img src="<%= ResolveUrl("~/images/Logo.jpg")%>" />
steve_flynn
Member
21 Points
42 Posts
Re: Master Page Image on Login Page
Jun 22, 2012 10:52 AM|LINK
Thanks for the replys guys, still not making any difference unfortunately - works fine on all pages except for the login page.
Thanks
Steve
kleinkie
Member
30 Points
5 Posts
Re: Master Page Image on Login Page
Jun 22, 2012 12:57 PM|LINK
Check the generated source codein your browsers to see what the src of the image is. This may help in determining where the issue lies. If you can't find the problem, then paste the generated source code for the page so that we can try pinpoint what the problem can be.
Ruchira
All-Star
42936 Points
7023 Posts
MVP
Re: Master Page Image on Login Page
Jun 24, 2012 11:52 AM|LINK
Hello,
It seems like a permission issue. Try by giving permission for all the users to images folder, like below
<location path="Images"> <system.web> <authorization> <allow users ="*" /> </authorization> </system.web> </location>
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.countycowpok...
Participant
1411 Points
340 Posts
Re: Master Page Image on Login Page
Jun 24, 2012 07:35 PM|LINK
steve_flynn
Member
21 Points
42 Posts
Re: Master Page Image on Login Page
Jun 25, 2012 08:06 AM|LINK
Thanks Ruchira, this did the trick. I also had to do the same with the 'styles' folder.
Steve