Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
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
Medium Priority
?
2,686 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 2000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

596 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