473,395 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Response.Write Placement

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
10 1883
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
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
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
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
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
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

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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: Giancarlo Niccolai | last post by:
Hello all. I have peeked through the FAQ and all relevant links, and also through Stroustrup book, but I have not been able to find an answer, so I have to post here as a last resort. It...
20
by: Ioannis Vranos | last post by:
When we use the standard placement new operator provided in <new>, and not a definition of owr own, isn't a call to placement delete enough? Consider the code: #include <new>
8
by: elviin | last post by:
Hello. I tried a sample programm using placement new. I am not sure if i understand this technique correctly. I do not mean usage but a real world application. Could anyone to describe some...
15
by: mangesh | last post by:
This code is from c++ faq in section 11 : void someCode() { char memory; void* p = memory; Fred* f = new(p) Fred(); f->~Fred(); // Explicitly call the destructor for the placed object }
1
by: SarahT | last post by:
Hi folks, I am doing something Very Bad and Wrong (which I'll spare you the details of) that requires overloading new for some specific classes. So, for example: class MyWeirdThingy {...
15
by: LuB | last post by:
I am constantly creating and destroying a singular object used within a class I wrote. To save a bit of time, I am considering using 'placement new'. I guess we could also debate this decision -...
9
by: karthikbalaguru | last post by:
Hi, I find that articles stating that 'placement new' constructs an object on a pre-allocated buffer and so takes less time. Actually, we have to consider the allocation of the buffer and then...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.