对于参考路径ASP.NET初学者问题 [英] ASP.NET beginner question regarding reference path

查看:112
本文介绍了对于参考路径ASP.NET初学者问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道什么是<%= QDAB.Constants.SiteURL%>在我的aspx页面下面一行code的意思。我做了谷歌,并没有真正找到这方面的消息。

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的详情]

[Aditional Details]

我改变了 URL(小于(%)= QDAB.Constants.SiteURL%GT;图片/文档/计划/ myImage.jpg);

URL(小于(%)= QDAB.Constants.SiteURL%GT;图片/ myImage.jpg);

我在图片文件夹中复制MYIMAGE。

I copied myImage in the "Images" folder.

它为什么会访问从图像图像文件夹而不是图像/文档/计划?

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

这是太奇怪了。

推荐答案

这意味着,有一个名为SITEURL在QDAB.Constants类中定义一个常数变量。

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

最有可能是何许东西www.xyz.com /

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

使用的&lt;%=变量名称%>,该变量的值是在使用HTML

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

什么

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

因此​​确实是使用可变值,它与串的创建的类型的一个完整的URL的其余部分并置它

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); 

这就是用于设置此HTML标记的背景的图像将是位于

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

这篇关于对于参考路径ASP.NET初学者问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆