Solved

tag not well formed

Posted on 2013-01-30
11
249 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
AJAX ModalPopupExtender will Not Hide in Asp.net 1 32
Html date format 9 20
Hta File displays dynamic File names 4 43
Set the FileVersion of a website dll 1 20
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

735 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