Serenity
Serenity

Reputation: 5098

ASP.NET beginner question regarding reference path

I want to know what "<% =QDAB.Constants.SiteURL %>" means in the following line of code in my aspx page. I did google and didn't really find any information on this.

<td align="center" style="background-image: url(<% =QDAB.Constants.SiteURL %>images/Docs/Plans/myImage.jpg);

So what exactly does this mean?

[Aditional Details]

I changed url(<% =QDAB.Constants.SiteURL %>images/Docs/Plans/myImage.jpg);

to this url(<% =QDAB.Constants.SiteURL %>images/myImage.jpg);

I copied myImage in the "Images" folder.

Why would it access the image from "Images" folder BUT NOT "Images/Docs/Plans"?

This is so weird.

Upvotes: 2

Views: 161

Answers (3)

Jagmag
Jagmag

Reputation: 10366

It means that there is a constant variable defined in QDAB.Constants class called SiteURL.

Most likely it is something of the sort "www.xyz.com/"

Using the <% = variable Name %>, the value of the variable is used in the HTML

What

url(<% =QDAB.Constants.SiteURL %>images/Docs/Plans/myImage.jpg); 

hence does is using the variable value, it concatenates it with the rest of the string creating a complete URL of the type

url(www.xyz.com/images/Docs/Plans/myImage.jpg); 

which is where the image used to set the background of this HTML tag is going to be located

Upvotes: 1

Andy Gaskell
Andy Gaskell

Reputation: 31761

I'm not sure how well Intellisense works in your platform, but this means that there is probably a static property on a Constants static class or a Constants property on the QDAB class. Try right clicking SiteURL and click on Go to definition (or something similar).

As to why someone would do this, they want the url of the background image to be dynamic.

Upvotes: 0

Gary
Gary

Reputation: 1007

It looks like it is referencing a server variable: QDAB.Constants.SiteURL

Try searching through your code for QDAB (It's probably a class)

The <% = blah %> gets the value of blah variable.

Upvotes: 0

Related Questions