Solved

tag not well formed

Posted on 2013-01-30
11
216 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
Comment Utility
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
Comment Utility
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
Comment Utility
my version: (untested)
<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
Comment Utility
<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
Comment Utility
Hi knowlton,

I have copyed and  paste your above code in visual studio 2012 , but not found any error.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 41

Accepted Solution

by:
guru_sami earned 500 total points
Comment Utility
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
Comment Utility
guru_sami, your solution is the same as what I posted.
0
 
LVL 5

Author Comment

by:knowlton
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks everybody.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article discusses four methods for overlaying images in a container on a web page
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now