简体   繁体   English

ASP.NET设计视图-移动控件

[英]ASP.NET Design View - Moving Controls

I've recently decided to create a web app to host some algorithms - I normally just create them without care for UI. 我最近决定创建一个网络应用程序来托管一些算法-我通常只创建它们而无需关心UI。 However this time I need to dive deep into UI. 但是这一次我需要深入研究UI。 I'm familiar with bootstrap, css, asp.net and have made a good start. 我熟悉bootstrap,css,asp.net,并有了一个良好的开端。

I'm finding it very difficult to deal with asp.net controls in the design view and having too much trouble trying to achieve simple tasks such as moving controls to different areas of the webpage. 我发现在设计视图中处理asp.net控件非常困难,并且在尝试完成简单的任务(例如将控件移至网页的不同区域)方面遇到了太多麻烦。 When I have two textboxes the design view forces one on top of the other leaving me so confused. 当我有两个文本框时,设计视图将一个视图置于另一个视图之上,这让我很困惑。 Then when I try to move my bootstrap button it randomly creates paragraphs and refuses to move the button! 然后,当我尝试移动引导按钮时,它会随机创建段落,并拒绝移动该按钮!

I'm looking for some genuine sincere advise on how I would deal with the design view on asp.net when moving controls and what the best techniques are. 我正在寻找有关在移动控件时如何处理asp.net上的设计视图以及最佳技术的一些真诚建议。 Also advice on how to make a modern UI, best techniques (perhaps bootstrap mentions) etc... 还提供有关如何制作现代UI的建议,最佳技术(也许会提到自举程序)等...

I am creating a fairly simple data display app in asp.net (visual studio 2015) - (most of the algorithm complexity is going to be behind the scenes and nothing to do with UI). 我正在asp.net(Visual Studio 2015)中创建一个相当简单的数据显示应用程序-(大多数算法复杂性将在幕后,而与UI无关)。 Comprehensive and detailed advice would be really appreciated. 全面和详细的建议将不胜感激。 Specifically modern good looking UI in relation to data grids, textboxes for user input (as parameters), dropdowns - you know the typical data app. 特别是与数据网格,用于用户输入的文本框(作为参数),下拉列表相关的现代美观UI,您知道典型的数据应用程序。

I'm sure this will be greatly helpful to many others as well! 我相信这对其他许多人也将大有帮助!

Yeah, as I web designer who has had to work with asp.net in the past I completely feel your pain. 是的,作为我过去必须与asp.net一起工作的网页设计师,我完全感到您的痛苦。 It's not easy to get a modern look mostly because asp.net isn't a modern tool and kind of has a visual vocabulary all its own. 要获得现代外观并不容易,主要是因为asp.net不是现代工具,并且具有自己的视觉词汇。

That said, I found I could get decent results by sticking as close to CSS based solutions as I possibly could. 就是说,我发现我可以尽可能地坚持基于CSS的解决方案,从而获得不错的结果。 You can see some of those results in the following links: 您可以在以下链接中看到其中一些结果:

http://www.design-experiments.com/ http://www.troyjnorris.com/shoppingcart/ http://www.design-experiments.com/ http://www.troyjnorris.com/shoppingcart/

I found that a minimalist approach tends to come with the best results. 我发现最低限度的方法往往会带来最好的结果。

A good process to follow: - Build what you want to build. 一个好的过程可以遵循:-构建您想要构建的东西。 - Add container divs to make selecting elements easier around your controls. -添加容器div,以使控件周围的元素选择更加容易。 This will greatly improve your ability to position elements the way you want. 这将大大提高您按所需方式定位元素的能力。 - Use your browser inspector to figure out the auto generated element names as they appear on the screen. -使用浏览器检查器找出自动生成的元素名称,它们会出现在屏幕上。 Getting good selectors is half the battle in CSS. 获得优秀的选择器是CSS成功的一半。 - Rip out the styling you don't like. -剔除您不喜欢的样式。 Standard reset style sheets won't do here. 标准重置样式表在这里不起作用。 You'll have to build your own to zero everything out on the elements you want to style so you're not fighting the out of the box look of the controls. 您必须构建自己的样式,以将要样式化的元素上的所有内容归零,以免与控件的开箱即用外观发生冲突。 Again you have to rely heavly on your inspector in a web browser to see what styles everything is inheriting. 同样,您必须在Web浏览器中大量依靠检查器来查看所有内容都继承了什么样式。 - Use google fonts to define visual style of the page. -使用Google字体定义页面的视觉样式。 - Stick to mostly black or white backgrounds. -坚持使用大多数黑色或白色背景。 - Bootstrap is helpful for a responsive grid, but won't do much good attempting to style most of the elements on a page as they're not meant for that. -Bootstrap对于响应式网格很有帮助,但尝试对页面上的大多数元素进行样式设置并不会带来太多好处,因为它们并不是为此而设计的。 - As you might have noticed in the examples above the visual interest comes from elements that are unrelated to the asp.net structure and limitations. -如您在上面的示例中可能已经注意到的,视觉兴趣来自与asp.net结构和限制无关的元素。 So have something like that, even a background image or some paralax so it feels like something is going on on the page. 所以有这样的东西,甚至是背景图片或一些视差,都感觉页面上正在发生某些事情。

Hope that helps. 希望能有所帮助。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM