Archives / 2010 / October
  • Cannot implicitly convert type 'string' to 'System.Web.UI.WebControls.TextBox'

    I faced this issue yesterday,it was very strange because it doesn't make sense at all.

    I have a master page and 1 content page,in that content page there is only one TextBox and an Ajax Editor (from ASP.NET AJAX Control Toolkit),no more no less.

    I tried to run the page but the debugger doesn't compile at all,it keeps showing this error message:

    Cannot implicitly convert type 'string' to 'System.Web.UI.WebControls.TextBox'

    It was hopeless,there isn't any server side code or even any JavaScript blocks,nothing!

    After a long analysis at the source/html of my page and trying every possibility I finally found what caused the issue that I won't guess it at all:

    EMPTY TITLE for my content page

    That is what caused the issue,I was surprised,after removing/setting a value for the title the problem solved!

    I hope my experience with this issue might help someone else,if anyone face the same issue and solved it in the same way or in a different way then please post it here,this will surely help others as well.


P.S. In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: