Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quotes in server tags?

Status
Not open for further replies.

ThatRickGuy

Programmer
Oct 12, 2001
3,841
US
Hey Guys,
I have a data repeater, I am trying to put a user control into that repeater. The problem I am running into is trying to uses quotes (") in the server tag, for example:

Code:
<uc1:wucSlide ID="WucSlide2" runat="server" IndexPos="<%#DataBinder.Eval(Container.DataItem, [b]"IndexPos"[/b]) %>" Title="Test"/>

Fails with "the server tag is invalid". I tried a variety of single quote ('), quote("), escaped quote ("", \") and the only thing that I found to work was converting the string into a concatination of chr commands:

Code:
<uc1:wucSlide ID="WucSlide2" runat="server" IndexPos="<%#DataBinder.Eval(Container.DataItem, [b]chr(73) & chr(110) & chr(100) & chr(101) & chr(120) & chr(112) & chr(111) & chr(115)[/b]) %>" Title="Test"/>

That works, but it's so kludgie.... there must be a better way. Any ideas?

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Bah, never mind, I must have lost a paranthesies or something, this worked fine:

Code:
<uc1:wucSlide ID="WucSlide2" runat="server" IndexPos=[b]'[/b]<%#DataBinder.Eval(Container.DataItem, [b]"IndexPos"[/b]) %>[b]'[/b] Title="Wheee"/>

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
for those refering to this post in the future. the difference between the 1st and 2nd post is the use of double quotes(") vs single quotes (') respectively.
Code:
<uc1:wucSlide ID="WucSlide2" runat="server" IndexPos=[COLOR=red]'[/color]<%#DataBinder.Eval(Container.DataItem, "IndexPos") %>[COLOR=red]'[/color] Title="Wheee"/>

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top