user979331
user979331

Reputation: 11851

Server tag : The server tag is not well formed

I got this error and I don't know what's wrong with my code...here it is:

<asp:LinkButton runat="server" ID="lnkbtnPDFPreview" Text="Preview" 
  CommandArgument='<%# DataBinder.Eval(Container.DataItem,"productID") %>'                                
  CommandName="<%# DataBinder.Eval(Container.DataItem,"documentID") %>">
</asp:LinkButton>

Upvotes: -1

Views: 1023

Answers (2)

Umair
Umair

Reputation: 3243

I suspect it's this line:

CommandName="<%# DataBinder.Eval(Container.DataItem,"documentID") %>"

You did the right thing here!

CommandArgument='<%# DataBinder.Eval(Container.DataItem,"productID") %>'

Upvotes: 0

Oded
Oded

Reputation: 498924

You are using " in the attribute value delimiter and inside the attribute:

CommandName="<%# DataBinder.Eval(Container.DataItem,"documentID") %>"

Change the outer delimiter to ' as already done for CommandArgument:

CommandName='<%# DataBinder.Eval(Container.DataItem,"documentID") %>'

Upvotes: 2

Related Questions