vbnetcoder
asked on
get asp.net session variable in HTML
I am trying to do:
<asp:HyperLink ID="hlMainImageView2"
runat="server" ImageUrl=Session.BaseUrl & UploadedImages/">View</asp :HyperLink >
Where session is my attempt to get the value of the session BaseUrl as use it has part of the hyperlink
<asp:HyperLink ID="hlMainImageView2"
runat="server" ImageUrl=Session.BaseUrl & UploadedImages/">View</asp
Where session is my attempt to get the value of the session BaseUrl as use it has part of the hyperlink
ASKER
It gives me this error:
If this attribute value is enclosed in quotation marks, the quotation marks must match.
If this attribute value is enclosed in quotation marks, the quotation marks must match.
missing a starting quote for the ImageURL attribute:
<asp:HyperLink ID="hlMainImageView2"
runat="server" ImageUrl="<%Session.BaseUr l%>Uploade dImages/"> View</asp: HyperLink>
<asp:HyperLink ID="hlMainImageView2"
runat="server" ImageUrl="<%Session.BaseUr
ASKER
I did this
<br />
<asp:HyperLink ID="HyperLink4"
runat="server" navigateurl="<%Session.Bas eUrl%>Uplo adedImages /100-Main. jpg">View< /asp:Hyper Link>
AND IT navigated to
http://localhost:52803/MyAPP/products/%3C%Session.BaseUrl%%3EUploadedImages/100-Main.jpg
It did not give me the value for BaseUrL
also /products should not be int the path
<br />
<asp:HyperLink ID="HyperLink4"
runat="server" navigateurl="<%Session.Bas
AND IT navigated to
http://localhost:52803/MyAPP/products/%3C%Session.BaseUrl%%3EUploadedImages/100-Main.jpg
It did not give me the value for BaseUrL
also /products should not be int the path
ok try this :
<asp:HyperLink ID="HyperLink4"
runat="server" navigateurl="~/<%=Session. BaseUrl%> UploadedImages/100-Main.jp g">View</a sp:HyperLi nk>
note <% has change to <%=
<asp:HyperLink ID="HyperLink4"
runat="server" navigateurl="~/<%=Session.
note <% has change to <%=
sorry i got that wrong , try :
<asp:HyperLink ID="HyperLink4"
runat="server" navigateurl="<%=Session.Ba seUrl%> UploadedImages/100-Main.jp g">View</a sp:HyperLi nk>
<asp:HyperLink ID="HyperLink4"
runat="server" navigateurl="<%=Session.Ba
ASKER
ok what about :
<asp:HyperLink ID="HyperLink4"
runat="server" navigateurl=<%=Session.Bas eUrl%> & UploadedImages/100-Main.jp g>View</as p:HyperLin k>
<asp:HyperLink ID="HyperLink4"
runat="server" navigateurl=<%=Session.Bas
ASKER
IT does not render. IT tells me that the server tag is not well formed
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That worked!
Thank you
Thank you
ASKER
ty
<asp:HyperLink ID="hlMainImageView2"
runat="server" ImageUrl=<%Session.BaseUrl