简体   繁体   English

内容页面中控件的母版页位置

[英]Master Page location of controls in content page

I'm trying to rebuild a site using masterpages. 我正在尝试使用母版页重建网站。 I copied the markup of the controls in the old page and placed them in the content place holder in the new page(in source view). 我将控件的标记复制到旧页面中,并将其放置在新页面的内容占位符中(在源视图中)。

Since they were absolutely positioned the controls do not stay inside the content place holder in design view. 由于控件绝对放置在设计视图中,因此它们不会停留在内容占位符内。 Everything is between the content place holder tags in source view. 一切都在源代码视图中的内容占位符标签之间。

the page works when I run it. 该页面在我运行时有效。 Is there anything wrong in leaving it like this? 这样留下来有什么问题吗? I can't seem to drag all the controls into the content placeholder in design view. 我似乎无法将所有控件都拖到设计视图中的内容占位符中。

Honestly I very rarely use the design view. 老实说,我很少使用设计视图。 It is much easier and faster to just type it out by hand and by doing so you become more accustomed to the language. 只需手动输入,会变得更加容易和快捷,您会逐渐习惯这种语言。 As for old content you can just paste it into the source and it should work fine barring mistakes in the old content of course. 至于旧内容,您可以将其粘贴到源代码中,并且当然可以很好地阻止旧内容中的错误。 The Design View is not always going to accurately display your code so I would not worry too much about. 设计视图并不总是能够准确地显示您的代码,因此我不必担心太多。 You should try to build the page and make sure there are not any small discrepancies though. 您应该尝试构建页面,并确保没有任何小的差异。

Since the design view is simply a GUI representation of the code, if the code is right, then you should be fine. 由于设计视图只是代码的GUI表示形式,因此,如果代码正确,那么应该没问题。 As far as user experience goes, I'd be a little worried, though. 就用户体验而言,我会有些担心。 Was there an actual question, or am I misunderstanding? 是否有实际问题,还是我误会了?

Sounds like you don't really have a problem there. 听起来您那里确实没有问题。 Get back to coding and have fun! 回到编码,玩得开心! ***grins* ***咧嘴*

This is the first time I've ever heard of someone using the Design view in Visual Studio. 这是我第一次听说有人在Visual Studio中使用“设计”视图。 :) :)

The code is the master... if the code is between the content tags, then it's in the placeholder. 该代码是主代码...如果代码位于内容标签之间,则位于占位符中。

It would be nice if there was a way to just completely turn off the Design pane, because it's pretty much worthless. 如果有一种方法可以完全关闭“设计”窗格,那就太好了,因为它几乎毫无用处。

I've been having the same problem for years. 我多年来一直遇到同样的问题。 And yes, I know, "always use the source view" and "programmers should just write the code." 是的,我知道,“总是使用源代码视图”和“程序员应该只编写代码”。 But there are times when you just want to drag a control from the toolbox and plop it on the page in design view or link a control to a datasource without typing everything out. 但是有时候,您只想从工具箱中拖动控件,然后将其放到设计视图的页面上,或者将控件链接到数据源,而无需输入所有内容。

So, definite flaw in VS. 因此,VS中肯定存在缺陷。 Design View is almost unusable when using Master Pages & Content Place Holders. 使用母版页和内容占位符时,Design View几乎不可用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 内容控件必须是内容页面中的顶级控件或引用母版页的嵌套母版页 - Content controls have to be top-level controls in a content page or a nested master page that references a master page 母版页怪异 - “内容控件必须是内容页或引用母版页的嵌套母版页中的顶级控件。” - Master Page Weirdness - “Content controls have to be top-level controls in a content page or a nested master page that references a master page.” 母版页上链接的CSS不适用于内容页上的控件 - CSS linked on master page not applying to controls on content page 更改母版页时如何保留内容页控件的视图状态? - How to retain content page controls' viewstate when changing master page? 主页控件正在重置 - Master page controls are resetting 隐藏母版页控件 - Hide Master page controls asp错误:内容控件必须是内容页或引用母版页的嵌套母版页中的顶级控件 - asp error: Content controls have to be top-level controls in a content page or a nested master page that references a master page 如何从嵌套母版页中的内容页访问主母版页中的控件 - How to access controls in Main Master page from content page in Nested Master Page 访问非母版页中的母版页控件? - Accessing Master Page Controls in Non master page? ASP.NET 错误:仅在引用母版页的内容页中允许使用内容控件 - ASP.NET Error: Content controls are allowed only in content page that references a master page
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM