473,503 Members | 1,300 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTML quotes problem

I have an issue i can work around, but i'm trying to figure out what i'm
"supposed" to do.

i have a line of HTML/ASP.NET code inside a repeater that is something like
this

<a href="page.aspx?s=<%# DataBinder.Eval(Container, "DataItem.TheData")
%>">Text</a>

This code executes perfectly, and does exactly what i want. When i try to
switch from HTML view to Design view, VS.NET2003 yells at me saying i need
to quote something differently. So, i figured i'd change the quotes...
well.. i can't change the "DataItem.TheData" to 'DataItem.TheData' because
thats a C# character literal, but with too many characters, and it doesn't
like that. I can change the "page.aspx?s= ... "> to be 'page.aspx?s=...'>
but that breaks some of my links that actually have the ' character in their
address.
So what do i do?
Whats the "proper" way to do this so i can actually switch back and forth
between HTML view and Design view without any hassle?

Thanks in advance!

Tim
Nov 18 '05 #1
7 1859
Attaching something i use currently.... doesnt give me the annoying quotes
message

<asp:TemplateColumn>
<ItemTemplate>
<P align="center">
<asp:HyperLink ImageUrl="../Images/edit.gif" NavigateUrl='<%#
"CA_EditSubCategory.aspx?SubCatID=" +
DataBinder.Eval(Container.DataItem,"SubCategoryID" ) %>' runat="server"
ID="Hyperlink1"/>
</P>
</ItemTemplate>
</asp:TemplateColumn>

HTH

HD

"Tim Mulholland" <Mu***************@alumni.virginia.edu> wrote in message
news:OS**************@tk2msftngp13.phx.gbl...
I have an issue i can work around, but i'm trying to figure out what i'm
"supposed" to do.

i have a line of HTML/ASP.NET code inside a repeater that is something like this

<a href="page.aspx?s=<%# DataBinder.Eval(Container, "DataItem.TheData")
%>">Text</a>

This code executes perfectly, and does exactly what i want. When i try to
switch from HTML view to Design view, VS.NET2003 yells at me saying i need
to quote something differently. So, i figured i'd change the quotes...
well.. i can't change the "DataItem.TheData" to 'DataItem.TheData' because
thats a C# character literal, but with too many characters, and it doesn't
like that. I can change the "page.aspx?s= ... "> to be 'page.aspx?s=...'>
but that breaks some of my links that actually have the ' character in their address.
So what do i do?
Whats the "proper" way to do this so i can actually switch back and forth
between HTML view and Design view without any hassle?

Thanks in advance!

Tim

Nov 18 '05 #2
i don't have my code here in front of me, but i'm guessing that this code
will output an anchor tag with double quotes around the href instead of
single quotes? I ask because you have single quotes around the NavigateUrl
property and i just want to make sure (though, i guess i'm just being lazy
and i could test it myself when i get home - but i figured i'd ask :) )

Thanks for your help

Tim

"Hermit Dave" <he************@CAPS.AND.DOTS.hotmail.com> wrote in message
news:ON**************@TK2MSFTNGP10.phx.gbl...
Attaching something i use currently.... doesnt give me the annoying quotes
message

<asp:TemplateColumn>
<ItemTemplate>
<P align="center">
<asp:HyperLink ImageUrl="../Images/edit.gif" NavigateUrl='<%#
"CA_EditSubCategory.aspx?SubCatID=" +
DataBinder.Eval(Container.DataItem,"SubCategoryID" ) %>' runat="server"
ID="Hyperlink1"/>
</P>
</ItemTemplate>
</asp:TemplateColumn>

HTH

HD

"Tim Mulholland" <Mu***************@alumni.virginia.edu> wrote in message
news:OS**************@tk2msftngp13.phx.gbl...
I have an issue i can work around, but i'm trying to figure out what i'm
"supposed" to do.

i have a line of HTML/ASP.NET code inside a repeater that is something

like
this

<a href="page.aspx?s=<%# DataBinder.Eval(Container, "DataItem.TheData")
%>">Text</a>

This code executes perfectly, and does exactly what i want. When i try to switch from HTML view to Design view, VS.NET2003 yells at me saying i need to quote something differently. So, i figured i'd change the quotes...
well.. i can't change the "DataItem.TheData" to 'DataItem.TheData' because thats a C# character literal, but with too many characters, and it doesn't like that. I can change the "page.aspx?s= ... "> to be 'page.aspx?s=...'> but that breaks some of my links that actually have the ' character in

their
address.
So what do i do?
Whats the "proper" way to do this so i can actually switch back and forth between HTML view and Design view without any hassle?

Thanks in advance!

Tim


Nov 18 '05 #3
href can be assigned a URL string with a single quote ' or a double quote ".
no issues bout that

Chao,

HD

"Tim Mulholland" <Mu***************@alumni.virginia.edu> wrote in message
news:eu**************@TK2MSFTNGP10.phx.gbl...
i don't have my code here in front of me, but i'm guessing that this code
will output an anchor tag with double quotes around the href instead of
single quotes? I ask because you have single quotes around the NavigateUrl
property and i just want to make sure (though, i guess i'm just being lazy
and i could test it myself when i get home - but i figured i'd ask :) )

Thanks for your help

Tim

"Hermit Dave" <he************@CAPS.AND.DOTS.hotmail.com> wrote in message
news:ON**************@TK2MSFTNGP10.phx.gbl...
Attaching something i use currently.... doesnt give me the annoying quotes
message

<asp:TemplateColumn>
<ItemTemplate>
<P align="center">
<asp:HyperLink ImageUrl="../Images/edit.gif" NavigateUrl='<%#
"CA_EditSubCategory.aspx?SubCatID=" +
DataBinder.Eval(Container.DataItem,"SubCategoryID" ) %>' runat="server"
ID="Hyperlink1"/>
</P>
</ItemTemplate>
</asp:TemplateColumn>

HTH

HD

"Tim Mulholland" <Mu***************@alumni.virginia.edu> wrote in message news:OS**************@tk2msftngp13.phx.gbl...
I have an issue i can work around, but i'm trying to figure out what i'm "supposed" to do.

i have a line of HTML/ASP.NET code inside a repeater that is something

like
this

<a href="page.aspx?s=<%# DataBinder.Eval(Container, "DataItem.TheData") %>">Text</a>

This code executes perfectly, and does exactly what i want. When i try

to switch from HTML view to Design view, VS.NET2003 yells at me saying i need to quote something differently. So, i figured i'd change the quotes...
well.. i can't change the "DataItem.TheData" to 'DataItem.TheData' because thats a C# character literal, but with too many characters, and it doesn't like that. I can change the "page.aspx?s= ... "> to be 'page.aspx?s=...'> but that breaks some of my links that actually have the ' character in

their
address.
So what do i do?
Whats the "proper" way to do this so i can actually switch back and forth between HTML view and Design view without any hassle?

Thanks in advance!

Tim



Nov 18 '05 #4
Hi Tim,

Thank you for using Microsoft Newsgroup Service. As for the question you
mentioned, I think Hermit's suggestion is quite correct. In case that you
want to use some quote ("") in the <%# %> bound, you should use '' to
include the <%# %> rather than use "", For example:
<ItemTemplate>

<asp:HyperLink NavigateUrl='<%# "target.aspx?id="
+DataBinder.Eval(Container.DataItem,"id")%>' runat="server"
ID="lnkNav">view</asp:HyperLink>

</ItemTemplate>

But be careful that don't include other text in the '' beside the <%# %>,
such as:

<asp:HyperLink NavigateUrl='other text<%# "target.aspx?id="
+DataBinder.Eval(Container.DataItem,"id")%>' runat="server"
ID="lnkNav">view</asp:HyperLink>

That'll cause all the expression between '' be analyzed as a normal string.
The <%# ........%> bound will be output as plain text.

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #5
Hi Tim,

Have you tried my suggestion in the last reply or have you resolved your
problem? Please feel free to let me know if you have any problem on it.

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Nov 18 '05 #6
was finally able to test it, and yes, it works fine.
thanks to all
"MSFT" <v-******@online.microsoft.com> wrote in message
news:0I**************@cpmsftngxa07.phx.gbl...
Hi Tim,

Have you tried my suggestion in the last reply or have you resolved your
problem? Please feel free to let me know if you have any problem on it.

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #7
Hi Tim,

Thanks for your response. I'm glad that you've resolved the problem.
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Nov 18 '05 #8

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

Similar topics

8
2479
by: Nick Messick | last post by:
I have a multi step signup form that I'm building and I have the following question. Should I do it this way: <?php if (blah == 1) { ?><table><td width="100">........etc <?php } else { ?>...
7
3785
by: Rainmaker | last post by:
Greetings, I have not been able to find the documentation that will allow me to insert php code inside the html code in the $message block in the mail() function. Using the example in the help...
1
1868
by: wald | last post by:
Hi group, I've set up an agenda-like system where "admins" can enter upcoming events, including a description of the event. This description can include HTML formatting and is entered in a...
11
7002
by: Ron | last post by:
Hello, I'm having an aggravating time getting the "html" spewed by Word 2003 to display correctly in a webpage. The situation here is that the people creating the documents only know Word, and...
15
1391
by: Craig Hunt | last post by:
I posted this in another newsgroup, so please forgive me if you've already seen it. --- Am I missing something here? Quite frequently, I'll write an aspx document taking care to format the...
1
2715
by: desi.american | last post by:
I have a dynamically generates ASPX page with tables and data. Depending on user selection, the same page can be viewed as a simple web page (rendered in HTML) or as an excel spreadsheet. If the...
2
6583
by: PapaRandy | last post by:
Hello, I am trying to validate the following .py webpage as HTML (through W3C). I put: ----------------------------------------------------------------------------- print "Content-type:...
6
2017
by: csgraham74 | last post by:
Hi Guys, I was wondering if someone could help me with a problem that im having. Basically i have a html editor control and im using this to allow my colleague to create html documents. I...
0
7282
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,...
1
6995
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...
0
7463
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5581
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,...
1
5017
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4678
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...
0
3157
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
738
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
389
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...

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.