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,657 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
  • 2
2 Comments
 
LVL 29

Accepted Solution

by:
Göran Andersson earned 500 total points
Comment Utility
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
Comment Utility
Checking back to see if you got it to work?
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now