路径中的方便〜(代字号)在纯HTML中不起作用? [英] Convenient ~ (tilde) in path does not work in plain HTML?

查看:42
本文介绍了路径中的方便〜(代字号)在纯HTML中不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在VB运行时我可以指定基本目录中的路径~~

so-


Page.LoadControl("〜\Controls \ SomeControl.ascx")

但是在运行时渲染LINK标签HTML时,这不起作用 -


< LINK rel =" stylesheet"类型= QUOT;文本/ CSS" href ="〜\Styles\Styles.css">


以HTML格式获取基本目录的语法是什么,或者更少

是可取的 - 我是否必须使用页面位置的相对路径?


Paul

In the VB runtime I can specify paths from the base directory with ~ like
so-

Page.LoadControl("~\Controls\SomeControl.ascx")

but when rendering the LINK tag HTML at runtime, this doesn''t work -

<LINK rel="stylesheet" type="text/css" href="~\Styles\Styles.css">

What''s the syntax for getting the base directory in HTML, or - much less
desirable - do I have to use a relative path from the page location?

Paul

推荐答案

使用../Styles/Styles.css synthax。 ../说要上一个目录级别的
。您可以执行../../从页面所在的

上升2个目录级别。

Use the ../Styles/Styles.css synthax. The ../ says to go up one
directory level. You can do ../../ to go up 2 directory levels from
where the page is located.


" ; PJ6" <无**** @ nowhere.net>在新闻中写道:#YOahFqyFHA.2212

@ TK2MSFTNGP15.phx.gbl:
"PJ6" <no****@nowhere.net> wrote in news:#YOahFqyFHA.2212
@TK2MSFTNGP15.phx.gbl:
在HTML中获取基目录的语法是什么,或者 - 更不用说了 - 我是否必须使用页面位置的相对路径?
What''s the syntax for getting the base directory in HTML, or - much less
desirable - do I have to use a relative path from the page location?




服务器处理Tilde以查找基本路径。


不幸的是我不认为有一种方法来指定基础

目录,你需要使用相对路径。


一个替代方案是使用所有ASP.NET控件 - 从而绕过普通的

HTML。会有更多的处理开销,但我不知道多少。


-

Lucas Tam(RE ******* *@rogers.com)

请删除删除来自回复时的电子邮件地址。


Newmarket沃尔沃糟透了! http://newmarketvolvo.tripod.com

保罗,

你正在使用反斜杠......这些仅用于本地路径。一些浏览器

和框架可能会让你离开它。

如果你使用正斜杠它应该工作。链接href就像任何其他web请求一样,所以无论请求类型如何,语法都应该有效:

html页面,gif图像,css样式表等。


hyh

tim


------------------- -------

博客: http://tim.mackey .ie


" PJ6" <无**** @ nowhere.net>在留言中写道

新闻:%2 **************** @ TK2MSFTNGP15.phx.gbl ...
hi Paul,
you''re using backslashes... these are for local paths only. some browsers
and frameworks might let you away with it though.
it should work if you use forward slashes. a link href is just like any
other web request, so the syntax should work regardless of request type:
html page, gif image, css stylesheet etc.

hyh
tim

--------------------------
blog: http://tim.mackey.ie

"PJ6" <no****@nowhere.net> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
在VB运行时我可以指定基本目录中的路径~~


Page.LoadControl(" ~~ \\\\\\\\\\\\\\但是当在运行时呈现LINK标记HTML时,这不起作用 -

< LINK rel =" stylesheet"类型= QUOT;文本/ CSS" href ="〜\Styles\Styles.css">

以HTML格式获取基本目录的语法是什么,或者 - 更不用说了 - 我是不是必须使用页面位置的相对路径?

Paul
In the VB runtime I can specify paths from the base directory with ~ like
so-

Page.LoadControl("~\Controls\SomeControl.ascx")

but when rendering the LINK tag HTML at runtime, this doesn''t work -

<LINK rel="stylesheet" type="text/css" href="~\Styles\Styles.css">

What''s the syntax for getting the base directory in HTML, or - much less
desirable - do I have to use a relative path from the page location?

Paul



这篇关于路径中的方便〜(代字号)在纯HTML中不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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