If I use the following code I lose the ability to right click on variables in the code behind and refactor (rename in this case) them
<a href='<%# "/Admin/Content/EditResource.aspx?ResourceId=" + Eval("Id").ToString() %>'>Edit</a>
I see this practice everywhere but it seems weird to me as I no longer am able to get compile time errors if I change the property name. My preferred approach is to do something like this
<a runat="server" id="MyLink">Edit</a>
and then in the code behind
MyLink.Href= "/Admin/Content/EditResource.aspx?ResourceId=" + myObject.Id;
I'm really interested to hear if people think the above approach is better since that's what I always see on popular coding sites and blogs (e.g. Scott Guthrie) and it's smaller code, but I tend to use ASP.NET because it is compiled and prefer to know if something is broken at compile time, not run time.