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

Passing embedded string to Response.Write

P: 3
I need to pass the following to Response.Write:

style="display:none;"

Can't get it to accept this correctly...
Feb 26 '16 #1
Share this Question
Share on Google+
5 Replies


Rabbit
Expert Mod 10K+
P: 12,370
Please post the code, difficult to say what you did wrong without seeing what you tried.
Feb 26 '16 #2

P: 3
Rabbit,

Was trying to do something like this:

Expand|Select|Wrap|Line Numbers
  1. <tr <%If ((rsScheduleItem.Fields.Item("FormatID").Value) = 36) Then Response.Write("style=display:inline;") : Response.Write("style=display:none;")%>>
But I couldn't get it to work...

I ended up doing this instead:

Expand|Select|Wrap|Line Numbers
  1. <%If ((rsScheduleItem.Fields.Item("FormatID").Value) =  36) Then %>
  2. <tr> 
  3. </tr>
  4. <% End If %>
Feb 26 '16 #3

Rabbit
Expert Mod 10K+
P: 12,370
Please use code tags when posting code or formatted data.

Your code block doesn't have those double quotes that you have in your first post.
Feb 26 '16 #4

P: 3
Rabbit,
That's because what's in the first post is what I was trying to put in the Response.Write, but It won't take it that way. What I showed in the second post was an attempt to get it to work. I also tried it with double-quotes and triple quotes. None worked...
Feb 27 '16 #5

Rabbit
Expert Mod 10K+
P: 12,370
If you're going to put double quotes inside double quotes, you need to escape them, otherwise it has no idea you want it as part of a string rather than ending or starting a string.
Feb 27 '16 #6

Post your reply

Sign in to post your reply or Sign up for a free account.