Solved

tag not well formed

Posted on 2013-01-30
11
257 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
WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

 
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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
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…

628 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