Friday, 15 January 2010

Broken tag in asp.net -



Broken <a> tag in asp.net -

recently i'm working on website contain of galleries. store info of each album in database , fetch them create links containing field albumid eval("albumid"). code below:

<a href="/showalbum.aspx?albumid=" + <%# eval("albumid") %>><%# eval("title") %></a>

which results in:

~/showalbum.aspx?albumid=

the albumid empty.

does knows problem?

in href when finish double quote (") means value of href has been ended here. , after if append dynamic value using eval give error invalid token

you should set eval between double quotes mentioned below :

<a href="/showalbum.aspx?albumid=<%# eval("link") %>"><%# eval("episode") %></a>

asp.net

No comments:

Post a Comment