473,786 Members | 2,660 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Quotes within Response.Write, Please help?

Hi ,

I am using Asp.net 1.1 using VB.NET and in the Page_Load() method I am
trying to use a Response.Write method as following but I keep getting
errors,

--------------------------
Response.Write( "<td><a
href=""SecondPa ge.aspx?ID="+co unter.ToString( )+" "" " >Read</a></td>"
--------------------------

I am really stumped as to what could be the error. Please help. Any
help will be highly appreciated.

Thanks,
Erland

Jul 2 '06 #1
4 2084
Erland wrote:
Hi ,

I am using Asp.net 1.1 using VB.NET and in the Page_Load() method I am
trying to use a Response.Write method as following but I keep getting
errors,

--------------------------
Response.Write( "<td><a
href=""SecondPa ge.aspx?ID="+co unter.ToString( )+" "" " >Read</a></td>"
--------------------------

I am really stumped as to what could be the error. Please help. Any
help will be highly appreciated.

Thanks,
Erland
Try:
Response.Write( "<td><ahref=""S econdPage.aspx? ID=" &
counter.ToStrin g() & """ >Read</a></td>")

Jul 3 '06 #2

hello Erland

this sould work

Response.Write ( "<td><a href='SecondPag e.aspx?ID='" + counter.ToStrin g
( ) + "'>Read</a></td>"

you can't use quotes within quotes, as that breaks the statement. use
single quotes instead :)

Jul 3 '06 #3
Hi ,
>
I am using Asp.net 1.1 using VB.NET and in the Page_Load() method I am
trying to use a Response.Write method as following but I keep getting
errors,

--------------------------
Response.Write( "<td><a
href=""SecondPa ge.aspx?ID="+co unter.ToString( )+" "" " >Read</a></td>"
--------------------------

I am really stumped as to what could be the error. Please help. Any
help will be highly appreciated.

Thanks,
Erland
For C#, use \" to represent a literal quote:
Response.Write( "<td><a href=\"SecondPa ge.aspx?ID="+co unter.ToString( )+
"\">Read</a></td>");

Hans Kesting
Jul 3 '06 #4
Hi,

Its fixed. Thank you every one.

Thanks,
Erland
Hans Kesting wrote:
Hi ,

I am using Asp.net 1.1 using VB.NET and in the Page_Load() method I am
trying to use a Response.Write method as following but I keep getting
errors,

--------------------------
Response.Write( "<td><a
href=""SecondPa ge.aspx?ID="+co unter.ToString( )+" "" " >Read</a></td>"
--------------------------

I am really stumped as to what could be the error. Please help. Any
help will be highly appreciated.

Thanks,
Erland

For C#, use \" to represent a literal quote:
Response.Write( "<td><a href=\"SecondPa ge.aspx?ID="+co unter.ToString( )+
"\">Read</a></td>");

Hans Kesting
Jul 3 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
1972
by: Cyrus D. | last post by:
Hi guys, I haven't done that much research on this topic but it seems I can use either the single quotes or the double quotes. SInce I am so used to C(++) I prefer the double quotes and am wondering if they could possible be less efficient. Maybe I should get in the habit of using single quotes with Php instead ? I like my code to be consistent, so in two very similar circumstances I don't want one set of code using single quotes and...
1
3005
by: Thomas Henz | last post by:
Hi there, I want to do: response.write("bla bla bla "in quotes" bla bla") How do I show the quotes on the screen in asp like I have to do \" in php? Thanks,
3
5318
by: addi | last post by:
All, I will be eternally greatful if someone can provide snippet of code, URL or reference material that shows how to display data in a "n colums * n rows" format. I am new to ASP and have looked everywhere that I could, but I have not found an example where data can be formatted to be displayed in a 3 * 4 foramt, like many of the professional sites would do (actually rows and columns can be any number of rows and columns) All the
2
4035
by: Jon Maz | last post by:
Hi, I have written a page to test a function of mine that strips non-English accents and various other characters out of a given string. The function itself (called 'StripAll' in the code below) now works fine. However something else in the test page is not working, and it's starting to bug me! If the user types a string containing double quotes into the textbox, when the textbox is re-populated after the postback, any part of the...
1
1400
by: scott | last post by:
Can someone help me my quotes in LISTING 2 below? LISTING 1 works fine in HTML, but I'm having trouble with quotes in LISTING 2 near the javascript code when trying to response write the entire button code. LISTING 1: HTML <INPUT TYPE=BUTTON VALUE="<< Previous <%=iMaxRecords%> Records" ONCLICK="document.location.href='paging.asp?iPage=<%=iPage-1%>'">
4
1989
by: scott | last post by:
Can someone help me with quote syntax? The single quotes with javascript function are messing me up. CODE --------- response.write ""<a href=""javascript: VerifyDelete1('del-message.asp?fid=" iActiveForumId1 & "&mode=" & thread & "&tid=" & iId "');">" & "<img src=""images/xsm-delete.gif"" width=""10"" height=""10"" border=""0"" alt=""Delete Message""></a></td>"
6
1497
by: scott | last post by:
Below in GOOD CODE, I have a mix of ASP/HTML that works. I'm trying to convert the code into all ASP, but I'm failing in BAD CODE. Can someone help me with these quotes? The single quotes are very hard to master. BAD CODE: sHTML=sHTML & "bgcolor=" & tblcolor & style=""cursor:default;"" onMouseOver="this.bgColor=""'#e6e6e6'"" onMouseOut="this.bgColor='" & tblcolor & "'"
5
1441
by: andy.z | last post by:
I'm writing a PHP line to the foot of a file using another language. my problem is I'm not sure how to write it so that the quotes (both single and double) are corret for PHP to process. The language I'm writing the PHP line with uses single quotes for a print statement. Therefore the line I want to write is (reducing to a single array element to simplify):
5
5158
by: Hels Bells | last post by:
Hi, I'm looking to do some manipulation on a string containing html code in asp which will involve me either using some regular expressions or just plain old simple replace functionality. The text that I want to use will have double quotes in it (as it's xhtml code) so I can't set it as a string value and is actually brought into the page from a content managed element (the details of which I don't think I'll need to go into but...
0
9497
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10169
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6749
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.