加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – 我该如何解决这个问题

发布时间:2020-12-16 09:36:15 所属栏目:asp.Net 来源:网络整理
导读:我为asp.net网站下载了一个模板.这些模板适用于Joomla CMS.我转换了所有,但我在标题中有一些问题,无法理解它做了什么,我怎么能专门为asp.net: jdoc:include type="head" / link rel="stylesheet" href="?php echo $this-baseurl ;?/templates/system/css/sy
我为asp.net网站下载了一个模板.这些模板适用于Joomla CMS.我转换了所有,但我在标题中有一些问题,无法理解它做了什么,我怎么能专门为asp.net:

<jdoc:include type="head" /> 
 <link rel="stylesheet" href="<?php echo $this->baseurl ;?>/templates/system/css/system.css" type="text/css" /> 
 <link rel="stylesheet" href="<?php echo $this->baseurl ;?>/templates/system/css/general.css" type="text/css" /> 
 <link rel="stylesheet" href="<?php echo $this->baseurl ;?>/templates/<?php echo $this->template ;?>/css/template.css" type="text/css" /> 
<!--<?php if($this->direction == 'rtl') : ?> -->
 <link href="<?php echo $this->baseurl ;?>/templates/<?php echo $this->template ;?>/css/template_rtl.css" rel="stylesheet" type="text/css" /> 
 <?php endif; ?> 
 <!--[if lte IE 7]>
<link href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/ie7.css" rel="stylesheet" type="text/css" />
<![endif]-->
<!--[if lte IE 6]>
<link href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/ie6.css" rel="stylesheet" type="text/css" />
<![endif]-->

 <link id="JTKLocalCss" href="css/template.css" rel="stylesheet" type="text/css" />

解决方法

您可以将代码<?php echo $this-> baseurl?> /替换为<%= this.ResolveUrl(“?/”)%>

对于代码<?php echo $this-> template?>,请将其替换为<%= this.ResolveUrl(“?/”)%>然后你必须在代码隐藏中定义一个模板访问器:

protected string Template { get; set; }

然后需要设置(例如在PageLoad上)以便属性填充上面的代码.

对于<?php if($this-> direction ==’rtl’):?> …<?php endif; ?>声明,这可以替换为:

<% if(this.Direction) {%>...<%}%>

同样,这将需要代码隐藏中的访问器,就像模板示例一样.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读