DataGrid doubt

  • Thread starter Thread starter CSharp
  • Start date Start date
C

CSharp

<tr>
<td><font size="0"><%# DataBinder.Eval(Container.DataItem,
"PostedDate") %></font></td>
</tr>
<tr>
<td align="right"><font size="0"><a href="edit.aspx?blogid=<%#
DataBinder.Eval(Container.DataItem, "BlogID")%>&msgid=<%#
DataBinder.Eval(Container.DataItem, "MessageID") %>">Edit</a></font></td>

</tr>

That's part of the itemtemplate of my datgrid. I want the BlogID and the
MessageID parameters to be added to the querystring of the hyperlink, while
databinding. But it shows an error. It does not allow me to switch to the
design view. It also causes compilation error.

I ultimately want to get something like:
<a href=edit.aspx?blogid=2&msgid=3>Edit</a>in the <td> tag

How can I correct it?

Thanks
SeeSharp
 
in this case replace "" by ' !!

example :

<tr>
<td align="right"><font size="0"><a
href='edit.aspx?blogid=<%#
DataBinder.Eval(Container.DataItem, "BlogID")%>&msgid=<%#
DataBinder.Eval(Container.DataItem, "MessageID") %
 
Thanks so much Ivans! It helped :)

SeeSharp

Ivan said:
in this case replace "" by ' !!

example :

<tr>
<td align="right"><font size="0"><a
href='edit.aspx?blogid=<%#
DataBinder.Eval(Container.DataItem, "BlogID")%>&msgid=<%#
DataBinder.Eval(Container.DataItem, "MessageID") %
 
Back
Top