Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 41971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:15:53+00:00 2026-05-10T15:15:53+00:00

If I use the following code I lose the ability to right click on

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T15:15:54+00:00Added an answer on May 10, 2026 at 3:15 pm

    I wouldnt call it bad practice (some would disagree, but why did they give us that option in the first place?), but I would say that you’ll improve overall readability and maintainability if you do not submit to this practice. You already conveyed out a good point, and that is IDE feature limitation (i.e., design time inspection, compile time warning, etc.).

    I could go on and on about how many principles it violates (code reuse, separation of concerns, etc.), but I can think of many applications out there that break nearly every principle, but still work after several years. I for one, prefer to make my code as modular and maintainable as possible.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 62k
  • Answers 62k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer I think there is no simple way for you. Serialization… May 11, 2026 at 10:04 am
  • added an answer //using Microsoft.Win32; //using System.Net.NetworkInformation; public class SessionChanges { public SessionChanges()… May 11, 2026 at 10:04 am
  • added an answer I found it's a combination: One The ZSH developers do… May 11, 2026 at 10:04 am

Related Questions

If I use the following code I lose the ability to right click on
I have the following snippet of code that's generating the Use new keyword if
If I use /clr:oldSyntax the following should work: public __value enum IceCreamFlavors { Vanilla,
I want to create the following element: <exercises xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="mySchema.xsd"> If I use something
I normally use the following idiom to check if a String can be converted
If I had the following select, and did not know the value to use
If I use the new keyword in my library (which is built differently than
If I am passing an object to a method, why should I use the
I have an .Net MVC application which runs fine if I use the build
If I use dragMove the wpf window will not move to a location where

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.