Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Quote Trouble

Reply
Thread Tools

Quote Trouble

 
 
scott
Guest
Posts: n/a
 
      08-03-2005
I have a style variable below that I can't figure correct quotes for in
response.write line. Any help?


CODE:

sTeamVisible = "visibility: visible;"


Response.Write "<td class=""teamdrop1"" style=""" & sTeamVisible & """ & " "
& RenderTeamFilter(teamID) & "</td>" & vbCrLf


 
Reply With Quote
 
 
 
 
scott
Guest
Posts: n/a
 
      08-03-2005
thanks for opening my eyes, i forgot about the single quotes with styles.


"Bob Lehmann" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Response.Write "<td class='teamdrop1' style='" & sTeamVisible & "'" & " "
> &
> RenderTeamFilter(teamID) & "</td>" & vbCrLf
>
> Bob Lehmann
>
> "scott" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> I have a style variable below that I can't figure correct quotes for in
>> response.write line. Any help?
>>
>>
>> CODE:
>>
>> sTeamVisible = "visibility: visible;"
>>
>>
>> Response.Write "<td class=""teamdrop1"" style=""" & sTeamVisible & """ &
>> "

> "
>> & RenderTeamFilter(teamID) & "</td>" & vbCrLf
>>
>>

>
>



 
Reply With Quote
 
 
 
 
Bob Lehmann
Guest
Posts: n/a
 
      08-03-2005
Response.Write "<td class='teamdrop1' style='" & sTeamVisible & "'" & " " &
RenderTeamFilter(teamID) & "</td>" & vbCrLf

Bob Lehmann

"scott" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> I have a style variable below that I can't figure correct quotes for in
> response.write line. Any help?
>
>
> CODE:
>
> sTeamVisible = "visibility: visible;"
>
>
> Response.Write "<td class=""teamdrop1"" style=""" & sTeamVisible & """ & "

"
> & RenderTeamFilter(teamID) & "</td>" & vbCrLf
>
>



 
Reply With Quote
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      08-03-2005
Are you getting an error? If not, what tells you it's not right? What does
a view-source give you? What does RenderTeamFilter return?

Ray at home

"scott" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>I have a style variable below that I can't figure correct quotes for in
>response.write line. Any help?
>
>
> CODE:
>
> sTeamVisible = "visibility: visible;"
>
>
> Response.Write "<td class=""teamdrop1"" style=""" & sTeamVisible & """ & "
> " & RenderTeamFilter(teamID) & "</td>" & vbCrLf
>
>



 
Reply With Quote
 
Aaron Bertrand [SQL Server MVP]
Guest
Posts: n/a
 
      08-03-2005
>I have a style variable below that I can't figure correct quotes for in
>response.write line. Any help?


Response.Write "<td class=tempdrop1 style='" & sTeamVisible & "'>"
Response.Write RenderTeamFilter(TeamID)
Response.Write "</td>" & vbCrLf

I find it easier to read and manage quotes if I omit them when not necessary
(e.g. around a word like "teamdrop1"). No, this isn't explicitly correct,
but it sure is useful during debugging, especially when working in an editor
that doesn't make a clear distinction between two ' and one " ...

I also find it easier to manage stuff like this if I break separate elements
onto their own line. Your main problem here, I think, is that you forgot to
close the opening <td> tag. So the resulting output (which you would have
been able to discover if you viewed source) was something like:

<td class="teampdrop1" style="visibility: visible" result of
renderTeamFilter(TeamID)</td>

I find little value in adding all these vbCrLf to the output HTML, unless
you really have a need for the output to be tidy (such as debugging complex
and dynamic HTML layout).

Finally, since the default visibility *is* visible, there is no reason to
explicitly declare this style (you could make it an attribute of tempdrop1
class if you really wanted to), the only time you would need to override the
default and explicitly declare a style attribute is if you were setting it
to something *other* than visible. So your ASP code could just as easily
look like this, and the result in terms of appearance and functionality will
be exactly the same:

<%
....
Response.Write "<td class=tempdrop1>"
Response.Write RenderTeamFilter(TeamID)
Response.Write "</td>"
....
%>

or:

<%
....
Response.Write "<td class=tempdrop1>" & RenderTeamFilter(TeamID) & "</td>"
....
%>

or:

<%
....
Response.Write "<td class=tempdrop1>" & _
RenderTeamFilter(TeamID) & "</td>"
....
%>

or:

<td class=tempdrop1><%=RenderTeamFilter(TeamID)%></td>

There are many ways to skin a cat. Some are a little more likely than
others to yield scratches, cuts & bruises.


 
Reply With Quote
 
scott
Guest
Posts: n/a
 
      08-04-2005
i was until bob helped. ie was giving error about quotes.


"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:(E-Mail Removed)...
> Are you getting an error? If not, what tells you it's not right? What
> does a view-source give you? What does RenderTeamFilter return?
>
> Ray at home
>
> "scott" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>>I have a style variable below that I can't figure correct quotes for in
>>response.write line. Any help?
>>
>>
>> CODE:
>>
>> sTeamVisible = "visibility: visible;"
>>
>>
>> Response.Write "<td class=""teamdrop1"" style=""" & sTeamVisible & """ &
>> " " & RenderTeamFilter(teamID) & "</td>" & vbCrLf
>>
>>

>
>



 
Reply With Quote
 
scott
Guest
Posts: n/a
 
      08-04-2005
thanks for the tips, you're right about keeping it simple.

my reason for the visible variable is i'm hiding/showing that cell.

thanks for your help and extra explanation.

"Aaron Bertrand [SQL Server MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> >I have a style variable below that I can't figure correct quotes for in
> >response.write line. Any help?

>
> Response.Write "<td class=tempdrop1 style='" & sTeamVisible & "'>"
> Response.Write RenderTeamFilter(TeamID)
> Response.Write "</td>" & vbCrLf
>
> I find it easier to read and manage quotes if I omit them when not
> necessary (e.g. around a word like "teamdrop1"). No, this isn't
> explicitly correct, but it sure is useful during debugging, especially
> when working in an editor that doesn't make a clear distinction between
> two ' and one " ...
>
> I also find it easier to manage stuff like this if I break separate
> elements onto their own line. Your main problem here, I think, is that
> you forgot to close the opening <td> tag. So the resulting output (which
> you would have been able to discover if you viewed source) was something
> like:
>
> <td class="teampdrop1" style="visibility: visible" result of
> renderTeamFilter(TeamID)</td>
>
> I find little value in adding all these vbCrLf to the output HTML, unless
> you really have a need for the output to be tidy (such as debugging
> complex and dynamic HTML layout).
>
> Finally, since the default visibility *is* visible, there is no reason to
> explicitly declare this style (you could make it an attribute of tempdrop1
> class if you really wanted to), the only time you would need to override
> the default and explicitly declare a style attribute is if you were
> setting it to something *other* than visible. So your ASP code could just
> as easily look like this, and the result in terms of appearance and
> functionality will be exactly the same:
>
> <%
> ...
> Response.Write "<td class=tempdrop1>"
> Response.Write RenderTeamFilter(TeamID)
> Response.Write "</td>"
> ...
> %>
>
> or:
>
> <%
> ...
> Response.Write "<td class=tempdrop1>" & RenderTeamFilter(TeamID) & "</td>"
> ...
> %>
>
> or:
>
> <%
> ...
> Response.Write "<td class=tempdrop1>" & _
> RenderTeamFilter(TeamID) & "</td>"
> ...
> %>
>
> or:
>
> <td class=tempdrop1><%=RenderTeamFilter(TeamID)%></td>
>
> There are many ways to skin a cat. Some are a little more likely than
> others to yield scratches, cuts & bruises.
>



 
Reply With Quote
 
CJM
Guest
Posts: n/a
 
      08-04-2005

"Aaron Bertrand [SQL Server MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> I find it easier to read and manage quotes if I omit them when not
> necessary (e.g. around a word like "teamdrop1"). No, this isn't
> explicitly correct, but it sure is useful during debugging, ....


It's is either explicitly correct or incorrect depending on what DOCTYPE you
are validating against.

For HTML4.01 and earlier, quotes are optional (though I prefer them).

For XHTML, they are mandatory for validation.

But, hell...who validates in this group?

>
> There are many ways to skin a cat. Some are a little more likely than
> others to yield scratches, cuts & bruises.


With your permission, I think I might borrow this line.

Chris


 
Reply With Quote
 
Aaron Bertrand [SQL Server MVP]
Guest
Posts: n/a
 
      08-04-2005
> my reason for the visible variable is i'm hiding/showing that cell.

You can still do that without explicitly starting it off as visible (since
it does that by default anyway). But unless you are affecting the whole
class en masse in client-side script, the element will need an id to
reference.

A


 
Reply With Quote
 
Aaron Bertrand [SQL Server MVP]
Guest
Posts: n/a
 
      08-04-2005
> It's is either explicitly correct or incorrect depending on what DOCTYPE
> you are validating against.


If you are validating at all.

> With your permission, I think I might borrow this line.


By all means.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem: neither urllib2.quote nor urllib.quote encode the unicodestrings arguments Valery Khamenya Python 3 10-05-2008 10:16 AM
Quote-Dot-Quote Operator kvnsmnsn@hotmail.com C++ 6 06-14-2008 11:34 PM
Datagrid on load; replace all double single quote to single quote to display to user Eric Layman ASP .Net 3 04-14-2007 07:16 AM
replacing strange quote with standard quote Stimp ASP .Net 2 09-20-2006 10:01 AM
Single Quote Versus Double Quote In A href link knee-dragger@hotmail.com HTML 3 06-13-2006 12:42 AM



Advertisments