Solved

tag not well formed

Posted on 2013-01-30
11
237 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:knowlton
  • 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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: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: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:knowlton
ID: 38836209
Thanks everybody.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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 …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

786 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