ASP.NET refering an image or asp file in a Strongly Typed fashion

by_bozkurt

New Member
Many times we need to refer another file on the server. Whether it's just an image, or another asp page. For example:\[code\] if (success) { img1.ImageUrl = "RightArrow.jpg" }\[/code\]The problem here is, if someone accidentally change the string "RightArrow.jpg" to "RghtArrow.jpg", it will not cause a compile time error. And it might take a lot of time to notice the run time error.So is there any best practice here?Of course I can build me own little mechanism for that... but I wander if there's anything build-in.Something which is maybe strongly-typed fashioned:\[code\]img1.ImageUrl = Images.RightArrow;\[/code\]
 
Back
Top