0
votes

I have anchor tag in asp.net repetor I want to be to embed data binder to add to href to create light-box

error Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1002: ; expected

Source Error:

<a href="editReminders.aspx?reminderID=<% DataBinder.Eval(Container.DataItem, >"ReminderID") %>" shape="rect" > class="extLink">Edite</a>      
3
I dont think the <% tag is allowed inside the repeater i thought it was <# this one instead. but the line of code you pasted also contains errors and is not well formed i think take a look at you DataBinder.Eval() - Jordy van Eijk

3 Answers

2
votes

You can also do this in the code behind by creating a method

protected string GetReminderLink(object Data)
{
 return "<a target=\"_BLANK\" href=\"editReminders.aspx?reminderID=" + Data.ToString() + "\";\">Text</a>";
}

and then calling it on your asp page as follows

<%# GetReminderLink(Eval("ReminderID"))%>
0
votes

Try this:

<a href='<%#Eval("ReminderID","editReminders.aspx?reminderID={0}") %>' shape="rect" class="extLink">Edite</a>
0
votes

This should work:

<a href='editReminders.aspx?reminderID=<%# Eval("ReminderID") %>' shape="rect" class="extLink">Edite</a>