Connecting Tech Pros Worldwide Forums | Help | Site Map

Dealing with Quotations (") in HTML

Jesse
Guest
 
Posts: n/a
#1: Nov 17 '05
Whenever I write a line of code that uses quotation marks, such as..

<% foreach (merri.Data.dsMerri.AlbumDetailsRow dr in
merri.Business.AllBusiness.ArtistAndAlbumByStyle(" Children")) {%>

I recieve an error message if I try to view the designer. I have tried
to comply with the message that says to surround the <%%> with ' quotes,
but it doesn't help. What am I doing wrong?


Jesse
Guest
 
Posts: n/a
#2: Nov 17 '05

re: Dealing with Quotations (") in HTML


Okay, But I can't send HTML tags through functions from the code behind
page if the tag includes ".
I understand object-oriented, but the majority of examples that exist
are not written in that fashion. Can you offer a code based solution for
this?

<% foreach (System.Data.DataRow drs in AlbumArray){
merri.Data.dsMerri.AlbumRow newDr =
(merri.Data.dsMerri.AlbumRow)drs; %>
<td width="100">
<A
href="album.aspx?album=<%=newDr.Album_ID%>;&amp;st yle=<%=newDr.MusicStyle%>"

<p id="albumlink"><%=newDr.Name%></p>
</A>
</td>
<% } %>


The "'s don't allow me to write the text in a function. So how do? I
have been trying to follow the microsoft articles on web patterns, but
no examples exist of this nature. I would really appreciate the help.

Kevin Spencer wrote:[color=blue]
> I would say that what you're doing wrong is treating object-oriented
> technology like it's procedural. This isn't ASP; it's ASP.Net.
>[/color]

/..
Guest
 
Posts: n/a
#3: Nov 17 '05

re: Dealing with Quotations (") in HTML


By Wed, 23 Jul 2003 14:03:43 -0400, Jesse <spootwo@hotmail.com>
decided to post
"Re: Dealing with Quotations (") in HTML" to
microsoft.public.dotnet.framework.aspnet:
[color=blue]
>Okay, But I can't send HTML tags through functions from the code behind
>page if the tag includes ".
>I understand object-oriented, but the majority of examples that exist
>are not written in that fashion. Can you offer a code based solution for
>this?
>
><% foreach (System.Data.DataRow drs in AlbumArray){
> merri.Data.dsMerri.AlbumRow newDr =
>(merri.Data.dsMerri.AlbumRow)drs; %>
> <td width="100">
> <A
>href="album.aspx?album=<%=newDr.Album_ID%>;&amp;s tyle=<%=newDr.MusicStyle%>"
>
> <p id="albumlink"><%=newDr.Name%></p>
> </A>
> </td>
><% } %>
>
>
>The "'s don't allow me to write the text in a function. So how do? I
>have been trying to follow the microsoft articles on web patterns, but
>no examples exist of this nature. I would really appreciate the help.
>
>Kevin Spencer wrote:[color=green]
>> I would say that what you're doing wrong is treating object-oriented
>> technology like it's procedural. This isn't ASP; it's ASP.Net.[/color][/color]

Did you try
1. using single quotes in place of double quotes?
2. escaping the double quotes: \"albumlink\"
3. using hex values for literal characters? (there are some parsing
classes in .net that will do the conversions for you)
4. creating literal strings: @"myValue";
or
@"""myValue""";

Surely one of these suggestions will work for you?

HTH,

/ts


--

exec rm -r /bin/laden*

##--------------------------------------------------##
"We are stardust, we are golden,
And we've got to get ourselves back to the Garden"
Joni Mitchell
##--------------------------------------------------##
Closed Thread