I opened a previously VS 2008 website into VS 2010 and it asked to convert to framework 4 and I said yes. Now when I open any code-behind page I get errors like below example of code for a ListView on the page.
'lvJobSizeSelection' is not declared. It may be inaccessible due to its protection level.
Is this a web application project or a website project? If it's a web application project, click the button to "Show All Files" for a project in the solution explorer and see if the .designer file is marked as hidden for the page/user control. If so un-hide
it and see if that makes a difference.
Right-click on the aspx file and select "Convert to Web Application" (or something like that)
It is a website project.
Just some additional information, I had saved the old web.config file and then took it back to 3.5 and it worked perfectly. No problems with ListView. It appears that most of the problems are with the ListView as I opened a page that had both a GridView
and a ListView and only the ListView code-behind gave me this error. Hope this helps.
No such option. Remember, this is a website project. Thanks.
Hi dlchase,
You can try Right-click the project to open the project properties and then set ”target framwork” as “.NET Framwork 3.5”. if not work for you, you can try checking your code-behind and the method with 'lvJobSizeSelection'. And please tell
us what kind of the variable 'lvJobSizeSelection' in order to help us to understand your issue better.
dlchase
'lvJobSizeSelection' is not declared. It may be inaccessible due to its protection level.
Please copy your dll or something library out of your proj and remove all your 3-rd party references, and then re-refer them to have a try with.
lvJobSizeSelection is a reference to a ListView on the aspx page.
It may be related to the web.config file. I removed the following from the "runtime" section of the web.config and the error went away but not sure I understand why.
沒有留言:
張貼留言