Solved

'string' does not contain a definition for 'Controls' and no extension method 'Controls' accepting a first argument of type 'string' could be found

Posted on 2007-11-17
2
2,669 Views
Last Modified: 2008-02-01
after converting my project in VS 2008, I get an error when trying to add the literal control PageTitle

Error    1    'string' does not contain a definition for 'Controls' and no extension method 'Controls' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?)
this.Title.Controls.Add(new LiteralControl(this.PageTitle));

Open in new window

0
Comment
Question by:dba123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 29

Accepted Solution

by:
Göran Andersson earned 500 total points
ID: 20306550
Is this a VS 2003 project that you are converting?

In framework 2.0 (VS 2005), the Title property was added to the Page class. I assume that you had an element in the page with the Id "Title"? If so, that control is not reachable by that name any more.

If you want to set the title of the page, use the Title property:

this.Title = this.PageTitle;

If you are using the element for something else, you have to assign a different Id to it so that you can reach it.
0
 
LVL 29

Expert Comment

by:Göran Andersson
ID: 20452858
Checking back to see if you got it to work?
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
edit .asp files 5 47
Add a Condition in ASP Repeater 6 44
Where does legacy ASP.NET initialize language? 2 56
why JSON Array data not binding on Model ASP.NET ? 1 28
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question