Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Double quotes in VB.NET

Posted on 2006-05-02
4
Medium Priority
?
1,600 Views
Last Modified: 2008-01-09
Hi i'm writing a control and i am having trobles with a little javascript in my html.

This is what i would like to achieve

<input type="radio" value="strValue" onclick="show_data(this.value,'Hi, this is some text')" name="rbnEmailTemplate">

Is there a break so i can use double quotes in my code:

So i can write something like this:

Output.Write(String.Format("<input type="radio" value="{0}" onclick="show_data(this.value,'{1}')" name="rbnEmailTemplate">", objEmailTemp.EmailTemplateID, "HI, this is some text"))

cheers

apb2
0
Comment
Question by:apb2
  • 2
4 Comments
 
LVL 6

Author Comment

by:apb2
ID: 16586506
This works

Output.Write(String.Format("<input type=" & Chr(34) & "radio" & Chr(34) & " value=" & Chr(34) & "{0}" & Chr(34) & " onclick=" & Chr(34) & "show_data(this.value,'{1}')" & Chr(34) & " name=" & Chr(34) & "rbnEmailTemplate" & Chr(34) & ">", objEmailTemp.EmailTemplateID, "HI"))

But is there a easier way, that just uses a character break

cheers
0
 
LVL 43

Accepted Solution

by:
TimCottee earned 2000 total points
ID: 16586549
Hi apb2,

Double them:

Output.Write(String.Format("<input type=""radio""  value=""{0}"" onclick=""show_data(this.value,'{1}')"" name=""rbnEmailTemplate"">", objEmailTemp.EmailTemplateID, "HI"))

This will put a single " in the resulting string.


Tim Cottee
0
 
LVL 9

Expert Comment

by:HappyFunBall
ID: 16586579
There isn't a way to declare a literal string like in C#.  You need to use the double quotes as in:

Output.Write(String.Format("<input type=""radio"" value=""{0}"" onclick=""show_data(this.value,'{1}')"" name=""rbnEmailTemplate"">", objEmailTemp.EmailTemplateID, "HI, this is some text"))
0
 
LVL 6

Author Comment

by:apb2
ID: 16586626
AHA

Nice one
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
Suggested Courses

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question