开发者

How can I get compilation failures if objectdatasource's are not properly wired up?

开发者 https://www.devze.com 2022-12-24 01:32 出处:网络
I have a large brown field webforms app that uses ObjectDatasource controls all over the place, which makes refactoring more difficult than it should be.

I have a large brown field webforms app that uses ObjectDatasource controls all over the place, which makes refactoring more difficult than it should be.

Is there a way to get a comile-time failures if an object or method is renamed w开发者_StackOverflow社区hich would cause the ObjectDataSource no longer work? In MVC there is the notion of compiling views, is there a parallel to this for webforms?


There is no easy way, no. Anything defined in .ASPX or .ASCX is created at runtime. The only thing you could do is attempt to access the object in codebehind (assuming a Web Application Project) and make sure the project compiles OK. But that only tells you if it's defined correctly in the .design code-behind file; it won't help you track down any references to it in .ASPX or .ASCX files.

0

精彩评论

暂无评论...
验证码 换一张
取 消