开发者

Runtime HttpException affecting only one page/usercontrol

We're having an issue with a .NET 3.5 WebForms site where occasionally our error logs start filling up with the following error message:

"Multiple controls with the same ID 'ctl09' were found. FindControl requires that controls have unique IDs."

I know very little about the exception as I have never seen it while debugging locally and have never caught it in the error logs soon enough to run a remote debugging session. I开发者_开发知识库 do know that an application pool recycle fixes the issue.

This only affects a single [high traffic] page in the site. The strange thing is that the site uses the pre-4.0 ID generation logic. So, when the page is working, there isn't an html element in the entire view source that isn't some autogenerated control ID prefix followed by a the 'actual' IDs (i.e. ctl09_someID_someOtherID).

So, 2 primary questions, though any ideas are welcome:

  1. What would case a control to randomly stop being built correctly?
  2. Other than the Global.asax, how can I trap this error and force the control to ... recompile? App pool to recycle?

I'm pretty much stumped.


  1. Nothing as far as I'm aware, only an outside entity interferring with the page lifecycle or AJAX postback could potentially cause this, if each control is being generated, in turn, then you will not 'randomly' experience duplicate ids.

  2. I don't think this is a viable option, app pool recycle? No way, there's got to be a valid reason for this.

Perhaps some more info/code would be useful? Is it a particular page? Are you using ViewState? There's lots of reasons for 'dodgy' control ids.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜