代码隐藏的设计流程 [英] Design flow for Code-behind

查看:61
本文介绍了代码隐藏的设计流程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

许多(如果不是大多数)已经说过,如果在团队中工作,代码隐藏最好 -

这似乎是合乎逻辑的。


你怎么样?处理工作流程?


我有一个擅长设计的人,但对ASP一无所知。他可以用表格,标签,文本框等用HTML构建HTML页面的设计。


但是我需要将它们更改为ASP.net对象并编写代码

以使页面正常工作(通常我会这样做 - 如果我在团队环境中工作

则不能这样做)。


您是否通常让设计人员首先使用

html对象构建页面(aspx文件)?然后再来,将你需要的更改为$

对象,然后构建代码隐藏页面?


此时,我认为你会使用这两个文件和设计器

在使用

代码隐藏时无法使用aspx页面。当您将html对象更改为asp对象时,您需要使用两个文件来处理这两个文件,以便在

页面后面的代码中添加对象的引用。


此外,当你在代码隐藏页面上进行更改时,设计师如何使用设计页面,因为页面可能会因你的页面失败而导致

正在对代码隐藏进行更改,因为aspx文件会引用它。


只是想了解物流到这个。


谢谢,


Tom

Many (if not most) have said that code-behind is best if working in teams -
which does seem logical.

How do you deal with the flow of the work?

I have someone who is good at designing, but know nothing about ASP. He can
build the design of the pages in HTML with tables, labels, textboxes etc.

But then I would need to change them to ASP.net objects and write the code
to make the page work (normally I do this as I go - can''t do this if I work
in a team environment).

Do you typically let the designer build the page first (aspx file) with the
html objects? Then later come along and change the ones you need to asp
objects and then build the code-behind page?

At this point, I assume you would work with both files and the designer
can''t be working with the aspx page while you are working with the
code-behind. As you change html objects to asp objects you would need to
work with both files to add the references to the object in the code behind
page.

Also, how would the designer work with the design page while you are making
changes to the code-behind page as the page would probably fail while you
are making changes to the code-behind since the aspx file would refer to it.

Just trying to understand the logistics to this.

Thanks,

Tom

推荐答案

嗨汤姆,


好​​问题。我们的工作方式是,我们为

界面使用自定义服务器控件。每个服务器控件呈现一个Div或一个表,其中包含活动的

元素。 Server Control也有一个CSS类。服务器控件

本身包含没有属性或样式的HTML元素。只有父级

容器(div或table)有一个CSS类。


我们的设计师可以使用外部CSS样式表来提供

服务器控件的布局和样式。 CSS类确定服务器控件中每个

HTML元素将如何在客户端上呈现,因为服务器控件中的每个

HTML元素都是父div的子元素或者表。

除了风格之外你还可以用CSS做很多事情。您可以使用CSS

定位将元素放置在页面中的任何位置,而不管它在HTML中的物理位置是什么。您还可以使用它定义事件行为(使用术语

样式)。例如,超链接可以加下划线,除非

鼠标操作它。一个按钮可以有2个不同的背景图像,一个用于onmouseout

,一个用于onmouseover。


这样,我也不必考虑很多关于它的外观,以及

我们的设计师不必知道它在后端是如何工作的。

封装是一件很美好的事情!


我们还可以在各种页面和

应用程序中混合和匹配这些服务器控件,而CSS使它看起来应该是什么样的/>
环境它在。


-

HTH,


Kevin Spencer

Microsoft MVP

..Net开发人员

无论是关注者还是贷款人都不是。


tshad < TS ********** @ ftsolutions.com>在消息中写道

新闻:eY ************** @ TK2MSFTNGP12.phx.gbl ...
Hi Tom,

Good question. The way we work it is, we use custom Server Controls for our
interface. Each Server Control renders a Div or a Table, with the active
elements inside. The Server Control also has a CSS class. The Server Control
itself contains HTML elements with no attributes or styles. Only the parent
container (div or table) has a CSS class.

Our designer can then work on an external CSS style sheet to provide the
layout and style of the Server Control. The CSS class determines how each
HTML element IN the Server Control will be rendered on the client, as each
HTML element in the Server Control is a child of the parent div or table.
You can do a heck of a lot with CSS besides style. You can use CSS
positoning to position the element anywhere in the page, regardless of its
physical location in the HTML. You can also define event behaviors (in terms
of style) with it. For example, a hyperlink could be underlined except when
the mouse os over it. A button could have 2 different background images, one
for onmouseout, and one for onmouseover.

This way, I don''t have to think too much about how it''s going to look, and
our designer doesn''t have to know how it works on the back end.
Encapsulation is a beautiful thing!

We can also mix and match these Server Controls in various pages and
applications, and the CSS makes it look the way it should in whatever
environment it''s in.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"tshad" <ts**********@ftsolutions.com> wrote in message
news:eY**************@TK2MSFTNGP12.phx.gbl...
很多(如果不是大多数) )如果在团队中工作,那么代码隐藏是最好的 - 这似乎是合乎逻辑的。

你如何处理工作流程?

我有一个擅长设计的人,但对ASP一无所知。他可以使用表格,标签,文本框等构建HTML页面的设计

然后我需要将它们更改为ASP.net对象并编写代码
使页面工作(通常我这样做 - 如果我在团队环境中工作,就不能这样做。)

你通常会让它设计者首先使用
html对象构建页面(aspx文件)?然后出现并更改你需要的asp对象然后构建代码隐藏页面?

此时,我假设您将使用这两个文件和设计器<当你使用
代码隐藏时,不能使用aspx页面。当您将html对象更改为asp对象时,您需要使用这两个文件来在页面后面的代码中添加对象的引用。

另外,如何设计师使用设计页面,而您正在更改代码隐藏页面,因为页面可能会失败
当您对代码隐藏进行更改时,因为aspx文件会
参考它。

只是想了解物流到这个。

谢谢,

汤姆
Many (if not most) have said that code-behind is best if working in
teams - which does seem logical.

How do you deal with the flow of the work?

I have someone who is good at designing, but know nothing about ASP. He
can build the design of the pages in HTML with tables, labels, textboxes
etc.

But then I would need to change them to ASP.net objects and write the code
to make the page work (normally I do this as I go - can''t do this if I
work in a team environment).

Do you typically let the designer build the page first (aspx file) with
the html objects? Then later come along and change the ones you need to
asp objects and then build the code-behind page?

At this point, I assume you would work with both files and the designer
can''t be working with the aspx page while you are working with the
code-behind. As you change html objects to asp objects you would need to
work with both files to add the references to the object in the code
behind page.

Also, how would the designer work with the design page while you are
making changes to the code-behind page as the page would probably fail
while you are making changes to the code-behind since the aspx file would
refer to it.

Just trying to understand the logistics to this.

Thanks,

Tom



我曾在设计师首先创建UI的情况下工作,然后

将html传递给编码器。这样可以正常工作,但是可以让编码人员等待设计师。


我还使用过不同的系统,我们使用了

蒙皮。这种方法需要通过书面

要求为每个UI提供可靠的路线图,但它允许编码器创建后面的代码和

控件,而设计师在html上工作将被放置在

皮肤控件中。设计师在完成

时将html传递给编码器,并且编码器将html控件标签替换为带有aspnet控件标签的

html放入时一起。加载

皮肤控件的自定义控件只使用page.findcontrol(blah)函数。


我不认为一个比其他人好,但这就是我过去处理过这些挑战的方式。


HTH

-

Jeff Davis

..NET应用程序开发人员
回复******************* @ hotmail.com

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

生命是90%发生在你身上,10%是你的反应。

" tshad" ; < TS ********** @ ftsolutions.com>在消息中写道

新闻:eY ************** @ TK2MSFTNGP12.phx.gbl ...
I have worked in situations where the designer created the UI first and then
passed the html on to the coder. This works ok, but can cause the coder to
wait on the designer.

I have also worked with a different system where we used controls that were
skinned. This approach requires a solid roadmap for each UI via written
requirements, but it allows the coder to create the code behind and the
controls while the designer works on the html that will be placed in the
skin control. The designer passes the html to the coder when it''s complete
and the coder replaces the html control tags with the aspnet control tags in
the html when it gets put together. The custom control that loads up the
skin control simply uses the page.findcontrol("blah") function.

I don''t think one is better than the other, but this is how I''ve dealt with
these challenges in the past.

HTH

--
Jeff Davis
..NET Application Developer
re*******************@hotmail.com
---------------------------------------------------------------
Life is 90% what happens to you and 10% how you react.
"tshad" <ts**********@ftsolutions.com> wrote in message
news:eY**************@TK2MSFTNGP12.phx.gbl...
很多(如果不是大多数) )如果在团队中工作,那么代码隐藏是最好的 - 这似乎是合乎逻辑的。

你如何处理工作流程?

我有一个擅长设计的人,但对ASP一无所知。他可以使用表格,标签,文本框等构建HTML页面的设计

然后我需要将它们更改为ASP.net对象并编写代码
使页面工作(通常我这样做 - 如果我在团队环境中工作,就不能这样做。)

你通常会让它设计者首先使用
html对象构建页面(aspx文件)?然后出现并更改你需要的asp对象然后构建代码隐藏页面?

此时,我假设您将使用这两个文件和设计器<当你使用
代码隐藏时,不能使用aspx页面。当您将html对象更改为asp对象时,您需要使用这两个文件来在页面后面的代码中添加对象的引用。

另外,如何设计师使用设计页面,而您正在更改代码隐藏页面,因为页面可能会失败
当您对代码隐藏进行更改时,因为aspx文件会
参考它。

只是想了解物流到这个。

谢谢,

汤姆
Many (if not most) have said that code-behind is best if working in
teams - which does seem logical.

How do you deal with the flow of the work?

I have someone who is good at designing, but know nothing about ASP. He
can build the design of the pages in HTML with tables, labels, textboxes
etc.

But then I would need to change them to ASP.net objects and write the code
to make the page work (normally I do this as I go - can''t do this if I
work in a team environment).

Do you typically let the designer build the page first (aspx file) with
the html objects? Then later come along and change the ones you need to
asp objects and then build the code-behind page?

At this point, I assume you would work with both files and the designer
can''t be working with the aspx page while you are working with the
code-behind. As you change html objects to asp objects you would need to
work with both files to add the references to the object in the code
behind page.

Also, how would the designer work with the design page while you are
making changes to the code-behind page as the page would probably fail
while you are making changes to the code-behind since the aspx file would
refer to it.

Just trying to understand the logistics to this.

Thanks,

Tom



现在我很困惑。


我认为代码背后的主要原因是将设计与

区分开来他们可以同时由不同的人工作。


但是这里的样式看起来像是在页面上然后是另一个。


如果是这种情况,为什么不能在同一页面上完成。你仍然需要代码和设计的分离(代码在顶部和设计在

底部)。


"杰夫戴维斯 < JE ************ @ hotmail.com>在留言中写道

新闻:%2 **************** @ TK2MSFTNGP12.phx.gbl ...
Now I am confused.

I thought the main reason for code behind was to separate the design from
that and they could be worked on by different people at the same time.

But the styles here seems like one works on the page and then the other.

If that is the case, why could it not be done on the same page. You still
have the separation of code and design (code on top and design on the
bottom).

"Jeff Davis" <je************@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
我有在设计师首先创建UI并且然后将html传递给编码器的情况下工作。这可行,但可以使
编码器等待设计师。


这似乎是最合乎逻辑(但可能不是)的方式。没有

设计,编码器如何测试它?

我还使用了一个不同的系统,我们使用了被剥皮的控件。


这是什么?

这种方法需要通过书面
要求为每个UI提供可靠的路线图,但它允许编码人员创建代码当设计师处理将放置在
皮肤控件中的html时,后面和
控件。


再次,这不是很难测试吗?

设计师在完成编码器时将html传递给编码器<编码器
将html控件标签替换为html
中的aspnet控件标签。加载皮肤控件的自定义控件只使用page.findcontrol(blah)函数。


这听起来类似于我所说的设计师

只是使用标准HTML元素创建页面然后编码器

用asp.net控件替换他想要的那些。


Tom

我不认为一个比另一个好,但是这个我是如何应对这些挑战的过程。

HTH

-
杰夫戴维斯
.NET应用程序开发者
remove_je ************ @ hotmail.com
-------------------------------------------- -------------------
生命是90%发生在你身上,10%是你的反应。

" tshad" < TS ********** @ ftsolutions.com>在消息中写道
新闻:eY ************** @ TK2MSFTNGP12.phx.gbl ...
I have worked in situations where the designer created the UI first and
then passed the html on to the coder. This works ok, but can cause the
coder to wait on the designer.
This seems the most logical (but maybe not) way to do it. Without the
design, how does the coder test it?

I have also worked with a different system where we used controls that
were skinned.
What is that?
This approach requires a solid roadmap for each UI via written
requirements, but it allows the coder to create the code behind and the
controls while the designer works on the html that will be placed in the
skin control.
Again, wouldn''t this be tough to test?
The designer passes the html to the coder when it''s complete and the coder
replaces the html control tags with the aspnet control tags in the html
when it gets put together. The custom control that loads up the skin
control simply uses the page.findcontrol("blah") function.
This sounds similar to what I was talking about doing where the designer
just creates the page using standard HTML elements and then the coder
replaces the ones he wants with asp.net controls.

Tom

I don''t think one is better than the other, but this is how I''ve dealt
with these challenges in the past.

HTH

--
Jeff Davis
.NET Application Developer
remove_je************@hotmail.com
---------------------------------------------------------------
Life is 90% what happens to you and 10% how you react.
"tshad" <ts**********@ftsolutions.com> wrote in message
news:eY**************@TK2MSFTNGP12.phx.gbl...
很多(如果不是大多数)都说过如果在团队中工作,代码隐藏最好 - 这似乎是合乎逻辑的。

你如何处理工作流程?

我有一个人擅长设计,但对ASP一无所知。他可以使用表格,标签,文本框等构建HTML页面的设计

然后我需要将它们更改为ASP.net对象并编写
使页面工作的代码(通常我会这样做 - 如果我在团队环境中工作,就不能这样做。)

你通常会让它设计者首先使用
html对象构建页面(aspx文件)?然后出现并更改你需要的asp对象然后构建代码隐藏页面?

此时,我假设您将使用这两个文件和设计器<当你使用
代码隐藏时,不能使用aspx页面。当您将html对象更改为asp对象时,您需要使用这两个文件来在页面后面的代码中添加对象的引用。

另外,如何设计师使用设计页面,而您正在更改代码隐藏页面,因为页面可能会失败
当您对代码隐藏进行更改时,因为aspx文件会
参考它。

只是想了解物流到这个。

谢谢,

汤姆
Many (if not most) have said that code-behind is best if working in
teams - which does seem logical.

How do you deal with the flow of the work?

I have someone who is good at designing, but know nothing about ASP. He
can build the design of the pages in HTML with tables, labels, textboxes
etc.

But then I would need to change them to ASP.net objects and write the
code to make the page work (normally I do this as I go - can''t do this if
I work in a team environment).

Do you typically let the designer build the page first (aspx file) with
the html objects? Then later come along and change the ones you need to
asp objects and then build the code-behind page?

At this point, I assume you would work with both files and the designer
can''t be working with the aspx page while you are working with the
code-behind. As you change html objects to asp objects you would need to
work with both files to add the references to the object in the code
behind page.

Also, how would the designer work with the design page while you are
making changes to the code-behind page as the page would probably fail
while you are making changes to the code-behind since the aspx file would
refer to it.

Just trying to understand the logistics to this.

Thanks,

Tom




这篇关于代码隐藏的设计流程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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