By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,919 Members | 1,074 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,919 IT Pros & Developers. It's quick & easy.

Response.Write Placement

P: n/a
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
May 2 '06 #1
Share this Question
Share on Google+
10 Replies


P: n/a
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:
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

May 2 '06 #2

P: n/a
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...
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

May 2 '06 #3

P: n/a
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...
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

May 2 '06 #4

P: n/a
Ron
The problem is size of the string is so large that it is not effcient to use
stringbuilder or string concats this i got from Q306821

"If you are in an environment that supports streaming the data, such as in
an ASPX Web Form or your application is writing the data to disk, consider
avoiding the buffer overhead of concatenation or the StringBuilder, and write
the data directly to the stream through the Response.Write method or the
appropriate method for the stream in question."

Some of the reports can have thousands of lines to them. This is way i would
like to use Response.Write.

Thanks for quick repsonse.
Ron

"Peter Bromberg [C# MVP]" wrote:
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:
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

May 2 '06 #5

P: n/a
Ron
Could i use the Response.Write to generate the HTML Markup in the code behind
of an aspx page?
"Ron" wrote:
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

May 2 '06 #6

P: n/a
Ron
The problem is the size of the reports that are built form the DB currently
we have been using the string concats method but we are have a lot of issues
with timeouts. Thats why i would like to use Response.Write.

"Swanand Mokashi" wrote:
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...
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


May 2 '06 #7

P: n/a

Ron,

Dump your entire <html>....</html> via the response.write.
SA

"Ron" <Ro*@discussions.microsoft.com> wrote in message
news:A0**********************************@microsof t.com...
Could i use the Response.Write to generate the HTML Markup in the code
behind
of an aspx page?
"Ron" wrote:
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

May 2 '06 #8

P: n/a
Ron
What about some controls that i use on the page?
I currently ise a couple of command butons to print and close the report and
a text box to hold the date from a scripted based date picker.

How would that work? If you like i can send you my current code behind and
aspx html code so you may have a better understanding of what i am doing but
i would rather not post it here in the group becuse of sensitivity issues and
security.

Thanks,
Ron

"MSDN" wrote:

Ron,

Dump your entire <html>....</html> via the response.write.
SA

"Ron" <Ro*@discussions.microsoft.com> wrote in message
news:A0**********************************@microsof t.com...
Could i use the Response.Write to generate the HTML Markup in the code
behind
of an aspx page?
"Ron" wrote:
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


May 2 '06 #9

P: n/a
Ron,

I have seen an entire web application build programmatically.
Not even a single static html tag.
I am not saying that is the best solution but you can do it.

Yes create everything programmatically including your buttons. Everything.
<html> <head>..<script>...</script>.<style></style></head>
<body><input..button.onclick='...'.>[Your report using tables etc..]
input..onclick=....></body></html>
This makes it more difficult to maintain in the future etc....

But as other have said: Have you used the StringBuilder instead and does it
help you at all.

Where is the speed problem???

SA
"Ron" <Ro*@discussions.microsoft.com> wrote in message
news:DC**********************************@microsof t.com...
What about some controls that i use on the page?
I currently ise a couple of command butons to print and close the report
and
a text box to hold the date from a scripted based date picker.

How would that work? If you like i can send you my current code behind and
aspx html code so you may have a better understanding of what i am doing
but
i would rather not post it here in the group becuse of sensitivity issues
and
security.

Thanks,
Ron

"MSDN" wrote:

Ron,

Dump your entire <html>....</html> via the response.write.
SA

"Ron" <Ro*@discussions.microsoft.com> wrote in message
news:A0**********************************@microsof t.com...
> Could i use the Response.Write to generate the HTML Markup in the code
> behind
> of an aspx page?
>
>
> "Ron" wrote:
>
>> 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


May 2 '06 #10

P: n/a
Did you try using the StringBuilder? StringBuilder is not the same as string
concatenation and was designed to avoid the problems associated with typical
string concat performance.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"Ron" <Ro*@discussions.microsoft.com> wrote in message
news:48**********************************@microsof t.com...
The problem is the size of the reports that are built form the DB
currently
we have been using the string concats method but we are have a lot of
issues
with timeouts. Thats why i would like to use Response.Write.

"Swanand Mokashi" wrote:
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...
> 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


May 5 '06 #11

This discussion thread is closed

Replies have been disabled for this discussion.