By Marcia G Akins - 10/25/2011
Hi All.
I have been doing Winforms apps using Strataframe for over 3 years. Now I have to work on a web app. I created a new solution with a business object library and a SF Web Application Project. I copied the SearchCustomers page from the sample web app, renamed everything appropriately for my prototype and tried to run it. All the controls referenced in the code behind give me the following error:
Error 1 The name 'lstResults' does not exist in the current context C:\StlCI_new\StlCI_new\StlCI_new\SearchProjects.aspx.cs 21 9 StlCI_new
All the labels give me this one:
Error 14 'SearchProjects' does not contain a definition for 'lblResults' and no extension method 'lblResults' accepting a first argument of type 'SearchProjects' could be found (are you missing a using directive or an assembly reference?) C:\StlCI_new\StlCI_new\StlCI_new\SearchProjects.aspx.cs 150 9 StlCI_new
One other bit of information: no intellisense shows up in the code behind for any of the controls on the page.
This has got to be something stupid.
Can anyone help me out here?
TIA.
Marcia
|
By Keith Chisarik - 10/25/2011
I have more than a few times forgotten to make sure the Inherits and CodeBehind attributes in my Page directive in my web form matches the name of my partial class when cutting and pasting... might that be it?
I also make sure the Inherits includes the namespace for my project.
Also, unless the template has been fixed, it includes references to the 1.6.0.0 assemblies and you need to change them to 1.7.0.0 in your web.config.
If that doesnt work feel free to post a code snippet, I do a fair amount of web work with SF. Also, maybe try a simple form with just a single field to make sure your "wired up" properly before pasting too much in. Just some thoughts. Good luck.
|
By Marcia G Akins - 10/25/2011
Keith Chisarik (10/25/2011) I have more than a few times forgotten to make sure the Inherits and CodeBehind attributes in my Page directive in my web form matches the name of my partial class when cutting and pasting... might that be it?
I also make sure the Inherits includes the namespace for my project.
Also, unless the template has been fixed, it includes references to the 1.6.0.0 assemblies and you need to change them to 1.7.0.0 in your web.config.
If that doesnt work feel free to post a code snippet, I do a fair amount of web work with SF. Also, maybe try a simple form with just a single field to make sure your "wired up" properly before pasting too much in. Just some thoughts. Good luck.
Hi Keith.
Thanks for trying to help. I thought I looked at everything carefully, but I will try again in the morning. I knew that it had to be something stupid - maybe it was just a case of looking at it so long that I didn't see what was in front of my nose.
I came home and tried to see what was up on my machine at home, but, if you can believe it, the problem is worse here. When I try to add an SF webform to the project in VS2010, it looks like it is trying to use the VS2008 version of the template. Then when I try to add an SF webform to a different project in VS2008, it looks like it is trying to use the VS2010 version. Is this even possible? This is the error I get in VS2010 when I try to add an SF webform:
When I try the same thing is VS2008, the error is the same but it references version 10.0.0.0
Furthermore, the template dialog is goofy. This is what I get when I select add new item:
No SF templates, But if I click on Visual C#, the SF templates show up like this:
If I select SF Web form, I get the error pictured in the first image.
I also tried adding an SF webform to the Sample web app and in that solution, everything is peachy keen. What is up with that?
|
By Govinda Berrio - 10/26/2011
Marcia,
I just ran into this problem today. To fix this, I went into the ItemTemplates folder for visual studio (C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp) and modified the template file in the SF_WebForm.zip archive.
The file I edited is: WebForm.vstemplate. At the bottom of that file there is an ExtensionWizard tag and within it there is a reference to the Microsoft.VisualStudio.Web.Application. For VS2008 I made sure that the version is 9.0.0.0. To do this I extracted the file out of the archive, edited it and then added it back to the archive and overwrote the old version.
I also did this in the template cache folder: C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplatesCache\CSharp\SF_WebForm_zip
I'm not using VS2010 yet, but it may be that the version in 2010 should be 10.0.0.0.
This fixed it for me.
|
By Marcia G Akins - 10/26/2011
Govinda Berrio (10/26/2011) Marcia,
I just ran into this problem today. To fix this, I went into the ItemTemplates folder for visual studio (C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp) and modified the template file in the SF_WebForm.zip archive.
The file I edited is: WebForm.vstemplate. At the bottom of that file there is an ExtensionWizard tag and within it there is a reference to the Microsoft.VisualStudio.Web.Application. For VS2008 I made sure that the version is 9.0.0.0. To do this I extracted the file out of the archive, edited it and then added it back to the archive and overwrote the old version.
I also did this in the template cache folder: C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplatesCache\CSharp\SF_WebForm_zip
I'm not using VS2010 yet, but it may be that the version in 2010 should be 10.0.0.0.
This fixed it for me.
Thanks for the information. I downloaded the most recent supported version of StrataFrame and installed it. That appeared to solve the problem for me. But this will definitely come in handy if I run into this in the future.
|
By Keith Chisarik - 10/26/2011
"I downloaded the most recent supported version of StrataFrame and installed it"
aha, I had assumed this was the case already ... glad you fixed it.
|
By Marcia G Akins - 10/27/2011
Keith Chisarik (10/26/2011)aha, I had assumed this was the case already ... glad you fixed it. LOL! My ability to recognize the obvious is phenominal I am glad too!
|
|