Response.Write放置 [英] Response.Write Placement

查看:173
本文介绍了Response.Write放置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我目前通过从我的后端数据库中获取数据来生成一份报告给我的最终用户
和连接串起来并在Label控件中放置这个字符串连接




我发现了一些效率问题,并希望使用Response.Write()

并将此信息直接传送到aspx页面。

。我的所有代码都在代码背后,我想

保留它。


如何将Response.Write流放在Label中控制?

这是可能的。


谢谢,

Ron

Hi,
I currently am generating a report by to my end user by retrieving data from
my back end DB
and concatenating strings together and place this string concatenation
within a Label control.

I am finding some efficiencies issues and would like to use Response.Write()
and stream this information directly
to the aspx page. All of my code is in the code behind and i would like to
keep it there.

How can i place the Response.Write stream in the Label control?
And is this possible.

Thanks,
Ron

推荐答案

Ron,

总之,你不是。你拿到你要去的字符串

Response.Write并将它分配给标签的Text属性。

Peter


-

联合创始人,Eggheadcafe.com开发者门户网站:
http://www.eggheadcafe.com

UnBlog:
http://petesbloggerama.blogspot.com


" Ron"写道:
Ron,
In a word, you don''t. You take the string that you were going to
Response.Write and you assign it to the Text property of the label.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Ron" wrote:

我目前正通过从我的后端数据库中检索数据并连接字符串给我的最终用户生成报告将此字符串串联放在Label控件中。

我发现了一些效率问题,并希望使用Response.Write()
并直接传输此信息
到aspx页面。我的所有代码都在代码背后,我想将它保留在那里。

如何将Response.Write流放在Label控件中?
并且这可能。

谢谢,
Ron
Hi,
I currently am generating a report by to my end user by retrieving data from
my back end DB
and concatenating strings together and place this string concatenation
within a Label control.

I am finding some efficiencies issues and would like to use Response.Write()
and stream this information directly
to the aspx page. All of my code is in the code behind and i would like to
keep it there.

How can i place the Response.Write stream in the Label control?
And is this possible.

Thanks,
Ron



Ron,

你可以'使用

Response.Write将它直接流式传输到特定位置。


您是否尝试过使用StringBuilder?这通常会占用大部分

字符串连接开销,然后您可以通过ToString()将标签'的文本

属性设置为stringbuilders输出。


希望这会有所帮助,

Mark Fitzpatrick

Microsoft MVP - FrontPage


" Ron" ; < Ro*@discussions.microsoft.com>在留言中写道

新闻:E7 ********************************** @ microsof t.com ...
Ron,
You can''t stream it directly into a specific location using
Response.Write.

Have you tried using a StringBuilder? That usually nukes most of the
string concatenation overhead and you can then just set the label''s text
property to the stringbuilders output through ToString().

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"Ron" <Ro*@discussions.microsoft.com> wrote in message
news:E7**********************************@microsof t.com...

我目前正在通过从我的后端数据库中检索数据来向我的最终用户生成报告并将字符串连接在一起,并将此字符串连接放置在Label控件中。

我发现了一些效率问题,并希望使用
Response.Write()
并将此信息直接传送到aspx页面。我的所有代码都在代码背后,我想将它保留在那里。

如何将Response.Write流放在Label控件中?
并且这可能。

谢谢,
Ron
Hi,
I currently am generating a report by to my end user by retrieving data
from
my back end DB
and concatenating strings together and place this string concatenation
within a Label control.

I am finding some efficiencies issues and would like to use
Response.Write()
and stream this information directly
to the aspx page. All of my code is in the code behind and i would like to
keep it there.

How can i place the Response.Write stream in the Label control?
And is this possible.

Thanks,
Ron



我建​​议使用StringBuilder类来连接字符串 - 它比字符串concats更有效率:


str1 = str1 +" test 1";


在这种情况下,会创建3个字符串对象,就好像使用StringBuilder

一样,它使用缓冲区:


System.Text.StringBuilder str = new System.Text.StringBuilder();

str.Append(" test 1");


如果你想要你也可以使用AppendFormat方法格式化字符串

正在追加


HTH

-

Swanand Mokashi

Microsoft认证解决方案开发人员(.NET) - 早期成就者

Microsoft认证应用程序在开发人员(.NET)上

http://www.dotnetgenerics.com /

DotNetGenerics.com - 关于Microsoft .NET的一切事物

技术......

http://www.swanandmokashi.com/
http://www.swanandmokashi.com/HomePage/WebServices/

股票行情,当日行情和星座运势网络服务

" Ron" < Ro*@discussions.microsoft.com>在留言中写道

新闻:E7 ********************************** @ microsof t.com ...
I would suggest using the StringBuilder class to concat strings -- it is a
lot more efficient than just string concats :

str1 = str1 + "test 1";

In this case 3 string objects are created where as if you use StringBuilder
, it uses a buffer :

System.Text.StringBuilder str = new System.Text.StringBuilder();
str.Append("test 1");

you can also use the AppendFormat method if you want to format the string
that is being appended

HTH
--
Swanand Mokashi
Microsoft Certified Solution Developer (.NET) - Early Achiever
Microsoft Certified Application Developer (.NET)

http://www.dotnetgenerics.com/
DotNetGenerics.com -- anything and everything about Microsoft .NET
technology ...

http://www.swanandmokashi.com/
http://www.swanandmokashi.com/HomePage/WebServices/
Home of the Stock Quotes, Quote of the day and Horoscope web services
"Ron" <Ro*@discussions.microsoft.com> wrote in message
news:E7**********************************@microsof t.com...

我目前正在通过从我的后端数据库中检索数据来向我的最终用户生成报告并将字符串连接在一起,并将此字符串连接放置在Label控件中。

我发现了一些效率问题,并希望使用
Response.Write()
并将此信息直接传送到aspx页面。我的所有代码都在代码背后,我想将它保留在那里。

如何将Response.Write流放在Label控件中?
并且这可能。

谢谢,
Ron
Hi,
I currently am generating a report by to my end user by retrieving data
from
my back end DB
and concatenating strings together and place this string concatenation
within a Label control.

I am finding some efficiencies issues and would like to use
Response.Write()
and stream this information directly
to the aspx page. All of my code is in the code behind and i would like to
keep it there.

How can i place the Response.Write stream in the Label control?
And is this possible.

Thanks,
Ron



这篇关于Response.Write放置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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