请帮助在MASTERPAGE中执行IF TEST [英] Help executing an IF TEST within MASTERPAGE, please

查看:59
本文介绍了请帮助在MASTERPAGE中执行IF TEST的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我正在帮助编写一个.net应用程序,我们正在使用VS2005和asp / vb.net来获取

代码

我们使用的是masterPage.master技术,在主页内

我们有一个asp:contentplaceholder,它是网站正文

主要部分的占位符


我的问题是,有没有办法测试什么aspx页面将被加载到contentplaceholder?
到contentplaceholder?基本上如果它是我们的主页,那么

页面的定义比我们所有其他页面都要宽。所以我想在主页上测试

,如果是home.aspx然后使用某个

布局,如果是其他的话,那么我'' d喜欢使用替代

布局。


任何建议(或代码示例)都会非常感激。我是

相对较新的.net,但已经编码多年了

谢谢,西蒙

Hello,
I''m helping write a .net app, we are using VS2005 and asp/vb.net for
code
we are using the "masterPage.master" technique, within the masterpage
we have an asp:contentplaceholder that is the place holder for the
main portion of the body of the site

my question is, is there a way to test what aspx page will be loaded
into the contentplaceholder? basically if it is our home page, that
page has a wider definition than all of our other pages. so i''d like
to test in the masterpage and if it is home.aspx then use a certain
layout, if it is anything else, then i''d like to use an alternate
layout.

any suggestions (or code examples) would be most appreciated. i''m
relatively new to .net, but have been coding for many years prior
thanks, simon

推荐答案

为什么不从相关内容页面改变母版页布局?


" simon"写道:
Why not alter the master page layout from the relevent content page?

"simon" wrote:

您好,

我正在帮助编写.net应用程序,我们正在使用VS2005和asp / vb.net

代码

我们使用的是masterPage.master。技术,在主页内

我们有一个asp:contentplaceholder,它是网站正文

主要部分的占位符


我的问题是,有没有办法测试什么aspx页面将被加载到contentplaceholder?
到contentplaceholder?基本上如果它是我们的主页,那么

页面的定义比我们所有其他页面都要宽。所以我想在主页上测试

,如果是home.aspx然后使用某个

布局,如果是其他的话,那么我'' d喜欢使用替代

布局。


任何建议(或代码示例)都会非常感激。我是

相对较新的.net,但已经编码多年了

谢谢,simon

Hello,
I''m helping write a .net app, we are using VS2005 and asp/vb.net for
code
we are using the "masterPage.master" technique, within the masterpage
we have an asp:contentplaceholder that is the place holder for the
main portion of the body of the site

my question is, is there a way to test what aspx page will be loaded
into the contentplaceholder? basically if it is our home page, that
page has a wider definition than all of our other pages. so i''d like
to test in the masterpage and if it is home.aspx then use a certain
layout, if it is anything else, then i''d like to use an alternate
layout.

any suggestions (or code examples) would be most appreciated. i''m
relatively new to .net, but have been coding for many years prior
thanks, simon


我的建议是不要使用母版页,因为它们重命名标签并制作脚本

更难。


我使用包括,将你的CSS链接和任何内容放在headPage和

页眉和页脚的顶部和底部。


你可以将保存页面作为模板


< HTML>

< HEAD>

<! - #include virtual =" / headPage。 ASPX" - >

< / HEAD>

< BODY>

<! - #include virtual =" / top的.aspx" - >


这里的内容

<! - #include virtual =" /bottom.aspx" - >

< / BODY>

< HTML>

" simon" < me@here.com在留言中写道

新闻:57 ****************************** ** @ 4ax.com ...
My advice is not to use Master pages, as they rename tags and make scripting
more difficult.

I use includes, putting your CSS links and whatever in the headPage and
header and footer in top and bottom pages.

you can the save page as a template

<HTML>
<HEAD>
<!-- #include virtual ="/headPage.aspx" -->
</HEAD>
<BODY>
<!-- #include virtual ="/top.aspx" -->

Content here
<!-- #include virtual ="/bottom.aspx" -->
</BODY>
<HTML>
"simon" <me@here.comwrote in message
news:57********************************@4ax.com...

您好,

我正在帮助编写.net应用程序,我们正在使用VS2005和asp / vb.net

代码

我们使用的是masterPage.master。技术,在主页内

我们有一个asp:contentplaceholder,它是网站正文

主要部分的占位符


我的问题是,有没有办法测试什么aspx页面将被加载到contentplaceholder?
到contentplaceholder?基本上如果它是我们的主页,那么

页面的定义比我们所有其他页面都要宽。所以我想在主页上测试

,如果是home.aspx然后使用某个

布局,如果是其他的话,那么我'' d喜欢使用替代

布局。


任何建议(或代码示例)都会非常感激。我是

相对较新的.net,但已经编码多年了

谢谢,simon
Hello,
I''m helping write a .net app, we are using VS2005 and asp/vb.net for
code
we are using the "masterPage.master" technique, within the masterpage
we have an asp:contentplaceholder that is the place holder for the
main portion of the body of the site

my question is, is there a way to test what aspx page will be loaded
into the contentplaceholder? basically if it is our home page, that
page has a wider definition than all of our other pages. so i''d like
to test in the masterpage and if it is home.aspx then use a certain
layout, if it is anything else, then i''d like to use an alternate
layout.

any suggestions (or code examples) would be most appreciated. i''m
relatively new to .net, but have been coding for many years prior
thanks, simon



感谢您的回复,相对较新,我不知道怎么做

那个。如果你不介意,你能扩展你的答案吗?谢谢

thanks for the reply, being relatively new, i do not know how to do
that. could you expand on your answer if you don''t mind. thanks


>为什么不从相关内容页面改变母版页布局?

" simon"写道:
>Why not alter the master page layout from the relevent content page?

"simon" wrote:

>我的问题是,有没有办法测试哪些aspx页面将被加载到contentplaceholder?基本上如果它是我们的主页,那个页面的定义比我们所有其他页面都要宽。所以我想在主页面上进行测试,如果是home.aspx然后使用某种
布局,如果是其他任何东西,那么我想使用替代
的布局。
>my question is, is there a way to test what aspx page will be loaded
into the contentplaceholder? basically if it is our home page, that
page has a wider definition than all of our other pages. so i''d like
to test in the masterpage and if it is home.aspx then use a certain
layout, if it is anything else, then i''d like to use an alternate
layout.


这篇关于请帮助在MASTERPAGE中执行IF TEST的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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