[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 211
  • Last Modified:

Using vb code in aspx for image source

Hi Guys and Gals, can anyone get the following line of code to work ?

<img alt="Item Photo" src='~/UploadLogos/
<script>User.Identity.Name</script>
.jpg' style="border:0;" />
0
Netlink2
Asked:
Netlink2
  • 3
  • 2
1 Solution
 
steveberzinsCommented:
how about:
<img alt="Item Photo" src='<%=ResolveUrl("~/UploadLogos/" & User.Identity.Name & ".jpg")%>' style="border:0;" />
?
0
 
Netlink2Author Commented:
Sorry Steve, that didn't work
0
 
steveberzinsCommented:
ok, what did it do?

you're using this in a aspx page, right?

did you look at the properties/source, and did it do anything?

in my test page, it worked...at least how I expected it to.

src='http://localhost:2521/UploadLogos/DRAGON/Steve.jpg'

my user id is DRAGON\Steve, and it put that in just like I'd think it should...

do you just need the user part of the domain\userid? or???

more info about what it did/didn't do, and what you want it to do maybe would help
0
 
Netlink2Author Commented:
my bad, I hadn't logged in (Oops :)  ). Thanks for testing it, etc.
0
 
steveberzinsCommented:
no problem, just glad it wasn't me this time ;)
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now