Solved

tag not well formed

Posted on 2013-01-30
11
253 Views
Last Modified: 2013-01-30
<a id="linkViewDocument" runat="server" href="~/ViewDoc.Aspx?DocID=" + '<%# Eval("BidDocID") %>' + "-" + '<%# Eval("BidDocSID") %>'">View Document</a>                                        

Open in new window


says it is not well formed.

I take exception to this (pun intended).

I stink at this.  Could use some help.  : )
0
Comment
Question by:Tom Knowlton
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +3
11 Comments
 
LVL 27

Expert Comment

by:nmarun
ID: 38836090
Try this:

<a id="linkViewDocument" runat="server" href="~/ViewDoc.Aspx?DocID=" + '<%# Eval("BidDocID") %>' + "-" + '<%# Eval("BidDocSID") %>'>View Document</a>

The preview version was '">View...

I removed the double quotes in between the single quote and the closing tag.

Arun
0
 
LVL 11

Expert Comment

by:David Kroll
ID: 38836091
Looks like you might need to take out the last double quote.

+ '<%# Eval("BidDocSID") %>'>View Document</a>
0
 
LVL 35

Expert Comment

by:Robert Schutt
ID: 38836096
my version: (untested)
<a id="linkViewDocument" runat="server" href="~/ViewDoc.Aspx?DocID=<%# Eval("BidDocID") %>-<%# Eval("BidDocSID") %>">View Document</a>

Open in new window

0
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!

 
LVL 27

Expert Comment

by:nmarun
ID: 38836107
<a id="linkViewDocument" runat="server" href='"~/ViewDoc.Aspx?DocID=" + <%# Eval("BidDocID") %> + "-" + <%# Eval("BidDocSID") %>'>View Document</a>

Sorry for the previous one.. VS din't complain on the string concatenation for this one.

Arun
0
 
LVL 21

Expert Comment

by:Tapan Pattanaik
ID: 38836118
Hi knowlton,

I have copyed and  paste your above code in visual studio 2012 , but not found any error.
0
 
LVL 41

Accepted Solution

by:
guru_sami earned 500 total points
ID: 38836120
Here's how your href should look like...everything within single <%#...%>:

<a id="linkViewDocument" runat="server"
href='<%# "~/ViewDoc.Aspx?DocID=" + Eval("BidDocID") + "-" + Eval("BidDocSID") %>'>View Document</a>

Open in new window

0
 
LVL 27

Expert Comment

by:nmarun
ID: 38836129
guru_sami, your solution is the same as what I posted.
0
 
LVL 5

Author Comment

by:Tom Knowlton
ID: 38836149
Going to try:

<a id="linkViewDocument" runat="server"
href='<%# "~/ViewDoc.Aspx?DocID=" + Eval("BidDocID") + "-" + Eval("BidDocSID") %>'>View Document</a>

Open in new window


in just a minute.

The other one displayed, but had problems.
0
 
LVL 41

Expert Comment

by:guru_sami
ID: 38836165
nmarun,
It looks like that but it's different.
I just plugged-in your code. The first one gave the same error. Second one is showing some weird formatting.
0
 
LVL 5

Author Comment

by:Tom Knowlton
ID: 38836200
This seems to work:

In the ASP.NET markup:
 <asp:TemplateField HeaderText="Bid Document:" SortExpression="BidDocID">
                                    <ItemTemplate>
                                        <a id="linkViewDocument" runat="server" href='<%# "~/ViewDoc.Aspx?DocID=" + Eval("BidDocID") + "-" + Eval("BidDocSID") %>'>View Document</a>
                                    </ItemTemplate>
                                </asp:TemplateField>

Open in new window



in the rendered HTML:
<a href="ViewDoc.Aspx?DocID=1887855-1" id="ctl08_gvPendingRepairBids_ctl06_linkViewDocument">View Document</a>

Open in new window

0
 
LVL 5

Author Closing Comment

by:Tom Knowlton
ID: 38836209
Thanks everybody.
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

Suggested Solutions

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

751 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