Display different img src depending on hostname

I am trying to edit the logon.aspx file for Exchange 2010 OWA.
I have no knowledge on aspx coding, but some experience with VB, html, and php.

I'd like it to display 1 image for one domain, and a different image for another domain.

How can I achieve this?
Is there a way to set a string and use it later in aspx the aspx file?

Here is what I am trying...

<script type="text/javascript">
      if (location.hostname == 'mail.1.com')
            lgntopl = "owa/14.1.438.0/themes/resources/lgntopl-1.gif";
      if (location.hostname == 'mail.2.com')
            lgntopl = "owa/14.1.438.0/themes/resources/lgntopl-2r.gif";
<img src="<%lgntopl;%>" alt="">

When I load my page I get an error "XML Parsing Error: no element found"
So clearly, there is something wrong with my guessed logic above!

Any help, would be greatly appreciated.
Who is Participating?
antoniokingConnect With a Mentor Author Commented:
I replaced my the javascript with...

	string lngtopl = "14.1.438.0/themes/resources/lgntopl.gif";
	string hostUrl = Request.Url.Host;
	if (hostUrl == "mail.1.com")
		lngtopl = "14.1.438.0/themes/resources/lgntopl-1.gif";
	if (hostUrl == "mail.2.com")
		lngtopl = "14.1.438.0/themes/resources/lgntopl-2.gif";

Open in new window

and now my OWA displays a different image depending on the url entered. Perfect :)
Pierre CorneliusConnect With a Mentor Commented:
I don see you declaring the variable anywhere. Try adding var before lgntopl
antoniokingAuthor Commented:
Hi PierreC
I have added "var" but just get a blank page now.
Is there anything else wrong with my syntax? I did just guess it!
Pierre CorneliusCommented:
Great! Im glad you got it working :)
antoniokingAuthor Commented:
My solution resolves my issue, Pierre's suggestion of adding 'var' before my variable led me down my path
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.