KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Refactoring some code again. Seeing some of this in one of the ASP.NET pages: using (TextBox txtBox = e.Row.Cells[1].FindControl("txtBox") as TextBox) { } There is no need to dispose txtBox, because it's just a reference to an existing control. And you don't want the control disposed at all. I'm not even sure this isn't harmful - like it would appear to ask for the underlying control to be disposed inappropriately (although I have not yet seen any ill effects from it being used this way).
Tags (comma-separated)
Save Edits
Cancel