Sir,
I have used Form Authentication in my web application. During registration I have saved users photo in folder and name of file in db. Need to display every users profile image after login. I have given permission to access that folder in Web.Config as below :
<system.web>
<authentication mode="Forms">
<forms loginUrl="~/login.aspx" defaultUrl="~/Index.aspx" protection="All" timeout="15"/>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
<sessionState mode="InProc" timeout="20"/>
<customErrors mode="Off" defaultRedirect="~/Error.aspx" redirectMode="ResponseRewrite"/>
</system.web>
<location path="Photo">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
As you can see I have provided access permission to Photo folder.
During accessing image at bakend I am providing exact location as:
Server.MapPath("~/Photo/"+dr["Photo"].ToString());
I have checked on browser the path of the called image using Inspect Element property of Chrome, the path is ok as below:
<img src="Photo/user_profile1.jpg" alt="" id="image1" />
But image is not displaying on page. Why ?