freelanceprogrammers.org Forum Index » ASP
StringWriter and HTMLTextWriter
Joined: 09 Jan 2006
Posts: 27
StringWriter and HTMLTextWriter
If I want to create HTML in the code behind to appear in an <%= %>
block on the aspx page, what is the best way? I would like to use
HTMLTextWriter but not sure that is possible. The trouble is, in C# I
do not know how to concatenate all those """ that exist in HTML. For
instance:
<!-- code
<td valign="true" color="brown">
-->
HTMLTextWriter makes all this much easier to do, but is is possible in
the page_load method to create a string to assign to <%= mySTr %>?
I hope so
Joined: 07 Jan 2006
Posts: 63
StringWriter and HTMLTextWriter
http://www.learnasp.com/freebook/learn/literalsrock.aspx
You just assign this to a literal.
You don`t need the HTMLTextWriter for this
DIM q as string = """"
dim sbTempHTML as new stringbuilder
with sbTempHtml
.append("<td valign=")
.append(q & "true" & q)
.append("color=")
.append(q & "brown" & q)
end with
BUT I stronnglyu suspect the fact you are asking this at all is
because you are taking the wrong approach to converting the code.
PLEASE send me the original ASP page off list to
911@...
and I will give you the correct conversion of it to ASP.net. It seems
unlikely to me that the way we are discussing is the best way.
On Thu, 13 Jan 2005 13:44:53 -0000, scaevola637 <scaevola637@...> wrote:
>
> If I want to create HTML in the code behind to appear in an <%= %>
> block on the aspx page, what is the best way? I would like to use
> HTMLTextWriter but not sure that is possible. The trouble is, in C# I
> do not know how to concatenate all those """ that exist in HTML. For
> instance:
> <!-- code
> <td valign="true" color="brown">
> -->
> HTMLTextWriter makes all this much easier to do, but is is possible in
> the page_load method to create a string to assign to <%= mySTr %>?
>
> I hope so
>
>
>
>
> ________________________________
> Yahoo! Groups Links
>
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
>
> To unsubscribe from this group, send an email to:
> AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Joined: 09 Jan 2006
Posts: 27
StringWriter and HTMLTextWriter
No, I got it to work and I am happy enough. You wrote the code
using that accursed vb.net. I talked to a Java programmer yesterday
and he said C# had left Java in the dust a while ago. Coming from a
Java progammer I was astounded. I had up to that time thought that
C# was MS`s poor attempt to implement Java.
--- In AspNetAnyQuestionIsOk@yahoogroups.com, Charles Carroll
<911@l...> wrote:
> http://www.learnasp.com/freebook/learn/literalsrock.aspx
> You just assign this to a literal.
>
> You don`t need the HTMLTextWriter for this
>
> DIM q as string = """"
> dim sbTempHTML as new stringbuilder
> with sbTempHtml
> .append("<td valign=")
> .append(q & "true" & q)
> .append("color=")
> .append(q & "brown" & q)
> end with
>
> BUT I stronnglyu suspect the fact you are asking this at all is
> because you are taking the wrong approach to converting the code.
>
> PLEASE send me the original ASP page off list to
> 911@l...
> and I will give you the correct conversion of it to ASP.net. It
seems
> unlikely to me that the way we are discussing is the best way.
>
>
> On Thu, 13 Jan 2005 13:44:53 -0000, scaevola637 <scaevola637@y...>
wrote:
> >
> > If I want to create HTML in the code behind to appear in an <%=
%>
> > block on the aspx page, what is the best way? I would like to
use
> > HTMLTextWriter but not sure that is possible. The trouble is,
in C# I
> > do not know how to concatenate all those """ that exist in
HTML. For
> > instance:
> > <!-- code
> > <td valign="true" color="brown">
> > -->
> > HTMLTextWriter makes all this much easier to do, but is is
possible in
> > the page_load method to create a string to assign to <%= mySTr %
>?
> >
> > I hope so
> >
> >
> >
> >
> > ________________________________
> > Yahoo! Groups Links
> >
> > To visit your group on the web, go to:
> > http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
> >
> > To unsubscribe from this group, send an email to:
> > AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
> >
> > Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service.
Joined: 09 Jan 2006
Posts: 27
StringWriter and HTMLTextWriter
The part i was missing is that `` is the escape character for C#,
whereas `#` is for vb.net.
--- In AspNetAnyQuestionIsOk@yahoogroups.com, Charles Carroll
<911@l...> wrote:
> http://www.learnasp.com/freebook/learn/literalsrock.aspx
> You just assign this to a literal.
>
> You don`t need the HTMLTextWriter for this
>
> DIM q as string = """"
> dim sbTempHTML as new stringbuilder
> with sbTempHtml
> .append("<td valign=")
> .append(q & "true" & q)
> .append("color=")
> .append(q & "brown" & q)
> end with
>
> BUT I stronnglyu suspect the fact you are asking this at all is
> because you are taking the wrong approach to converting the code.
>
> PLEASE send me the original ASP page off list to
> 911@l...
> and I will give you the correct conversion of it to ASP.net. It
seems
> unlikely to me that the way we are discussing is the best way.
>
>
> On Thu, 13 Jan 2005 13:44:53 -0000, scaevola637 <scaevola637@y...>
wrote:
> >
> > If I want to create HTML in the code behind to appear in an <%=
%>
> > block on the aspx page, what is the best way? I would like to
use
> > HTMLTextWriter but not sure that is possible. The trouble is,
in C# I
> > do not know how to concatenate all those """ that exist in
HTML. For
> > instance:
> > <!-- code
> > <td valign="true" color="brown">
> > -->
> > HTMLTextWriter makes all this much easier to do, but is is
possible in
> > the page_load method to create a string to assign to <%= mySTr %
>?
> >
> > I hope so
> >
> >
> >
> >
> > ________________________________
> > Yahoo! Groups Links
> >
> > To visit your group on the web, go to:
> > http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
> >
> > To unsubscribe from this group, send an email to:
> > AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
> >
> > Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service.
Joined: 09 Jan 2006
Posts: 27
StringWriter and HTMLTextWriter
I am joking about vb.net as I am the only one in this shop using C#
and probably must start writing vb.net soon. I started from Java
before I came to .net so vb.net is too wordy for my taste.
--- In AspNetAnyQuestionIsOk@yahoogroups.com, "scaevola637"
<scaevola637@y...> wrote:
>
> No, I got it to work and I am happy enough. You wrote the code
> using that accursed vb.net. I talked to a Java programmer
yesterday
> and he said C# had left Java in the dust a while ago. Coming from
a
> Java progammer I was astounded. I had up to that time thought
that
> C# was MS`s poor attempt to implement Java.
>
>
>
> --- In AspNetAnyQuestionIsOk@yahoogroups.com, Charles Carroll
> <911@l...> wrote:
> > http://www.learnasp.com/freebook/learn/literalsrock.aspx
> > You just assign this to a literal.
> >
> > You don`t need the HTMLTextWriter for this
> >
> > DIM q as string = """"
> > dim sbTempHTML as new stringbuilder
> > with sbTempHtml
> > .append("<td valign=")
> > .append(q & "true" & q)
> > .append("color=")
> > .append(q & "brown" & q)
> > end with
> >
> > BUT I stronnglyu suspect the fact you are asking this at all is
> > because you are taking the wrong approach to converting the code.
> >
> > PLEASE send me the original ASP page off list to
> > 911@l...
> > and I will give you the correct conversion of it to ASP.net. It
> seems
> > unlikely to me that the way we are discussing is the best way.
> >
> >
> > On Thu, 13 Jan 2005 13:44:53 -0000, scaevola637
<scaevola637@y...>
> wrote:
> > >
> > > If I want to create HTML in the code behind to appear in an <%
=
> %>
> > > block on the aspx page, what is the best way? I would like
to
> use
> > > HTMLTextWriter but not sure that is possible. The trouble
is,
> in C# I
> > > do not know how to concatenate all those """ that exist in
> HTML. For
> > > instance:
> > > <!-- code
> > > <td valign="true" color="brown">
> > > -->
> > > HTMLTextWriter makes all this much easier to do, but is is
> possible in
> > > the page_load method to create a string to assign to <%=
mySTr %
> >?
> > >
> > > I hope so
> > >
> > >
> > >
> > >
> > > ________________________________
> > > Yahoo! Groups Links
> > >
> > > To visit your group on the web, go to:
> > > http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
> > >
> > > To unsubscribe from this group, send an email to:
> > > AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
> > >
> > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service.
All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
China Wholesale - Electronics Products
Character Studio - Tutorials and Help
China Wholesale - Electronics Products
Character Studio - Tutorials and Help







