且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

response.write问题

更新时间:2023-12-05 22:18:58

嗯,你有两个选择:
>
1.使用ASP(看起来像你习惯的那样)

2.学习ASP.Net的面向对象编程模型。
>
-

HTH,

Kevin Spencer

Microsoft MVP

。 .Net开发商

你所寻求的是什么。


EMW <所以***** @ MikroZoft.com>在留言中写道

news:42 ********************** @ dreader2.news.tiscal i.nl ...
Well, you''ve got 2 choices:

1. Use ASP (looks like what you''re used to)
2. Learn ASP.Net''s Object-oriented programming model.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"EMW" <so*****@MikroZoft.com> wrote in message
news:42**********************@dreader2.news.tiscal i.nl...


当我使用
Response.Write某事时,它被放在< HTML>上方的顶部op de html文档中。标签。
我需要把它放在BODY部分。

我该怎么做?

rg,
Eric
Hi,

When I use
Response.Write "something"
it is placed at the top op de html document above the <HTML> tag.
I need it to be put in the BODY part.

How can I do this?

rg,
Eric



Response.Write几乎从未被使用过,主要是因为你指出了

的原因。


相反,您应该使用Label控件,PlaceHolder控件或

其他控件,因为它们可以在设计时精确放置。

然后你就可以在你的代码背后设置它:


Label1.Text =" Whatever"


-

我希望这会有所帮助,

史蒂夫C.奥尔,MCSD,MVP
http://SteveOrr.net


" EMW" &LT;所以***** @ MikroZoft.com&GT;在留言中写道

news:42 ********************** @ dreader2.news.tiscal i.nl ...
Response.Write is almost never used any more, mainly because of the reason
you pointed out.

Instead you should probably use a Label control, a PlaceHolder control, or
some other control, since they can be placed precisely at design time.
Then you can set it from your code behind like this:

Label1.Text="Whatever"

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"EMW" <so*****@MikroZoft.com> wrote in message
news:42**********************@dreader2.news.tiscal i.nl...


当我使用
Response.Write某事时,它被放在< HTML>上方的顶部op de html文档中。标签。
我需要把它放在BODY部分。

我该怎么做?

rg,
Eric
Hi,

When I use
Response.Write "something"
it is placed at the top op de html document above the <HTML> tag.
I need it to be put in the BODY part.

How can I do this?

rg,
Eric



Response.Write与ASP.NET的对象模型的整个zen有很大关系。

当然,请使用它用于调试(虽然Trace.Write更好),但你不应该使用它来渲染你的页面。如果你想要将某些东西添加到你的页面,请输入一个< asp:Label runat = server id = _myInfo /> (或其他一些服务器

侧控制)并将_myInfo.Text proeprty设置为您想要显示的字符串。

这是一个更高级别的对象模型,它非常不同于经典的ASP。

它确实与众不同,但是一旦你习惯了它就会变得更有效率。

吧。


-Brock

DevelopMentor
http:// staff.develop.com/ballen
Response.Write is ver much against the entire zen of ASP.NET''s object model.
Sure, use it for debugging (though Trace.Write is much better), but you shouldn''t
be using it for rendering your page. If you want something to be added to
your page, put a <asp:Label runat=server id=_myInfo /> (or some other server
side control) and set the _myInfo.Text proeprty to the string you want visible.
This is a higher level object model that''s very different than classic ASP.
It''s definetly different, but a much more productive model once you get used
to it.

-Brock
DevelopMentor
http://staff.develop.com/ballen


当我使用时
Response.Write" something"
它位于< HTML>上方的顶部op de html文档中。标签。
我需要将它放入BODY部分。

我该怎么做?

rg,
Eric
Hi,

When I use
Response.Write "something"
it is placed at the top op de html document above the <HTML> tag.
I need it to be put in the BODY part.

How can I do this?

rg,
Eric