Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New to .net web development

Status
Not open for further replies.

JScannell

Programmer
Jan 9, 2001
306
US
I've been programming in VS2005 for a few years now. My exposure has been to creating desktop applications. I am now venturing into .net web sites. I have a solution and source code that was developed by an outside vendor. My company will be taking over the ownership of the product. That's where I come in. I will be supporting it as we move forward.

I have a copy of the solution and source code; have loaded it into VS 2010; and am trying to get myself familiar with the code.

There is a big problem, though. I think there is supposed to be some kind of additional environment that I need to create (IIS? Default website? something else?) When I attempt to open up the designer of a form, I get a "Master Page error" frame that tells me that the file '~/Masterpage.master' cannot be loaded.
What does that mean? I did find out that the ~ symbol represents the "home folder", so I presume it would be something like" c:\Inetpub\ folder>, right?

I can look at the code behind, but without seeing the controls that doesn't do me much good.

Please help...

Thanks in advance,

Jerry Scannell
 
welcome to the world of web development

the ~\masterpage should be located in the root of the asp.net webforms project. there is also a chance that while the solution might not be able to see the master file, the webpage will render just fine when the site is compiled and running.
Code:
I can look at the code behind, but without seeing the controls that doesn't do me much good.
there are 2 parts to a webform page
1. the markup/template. this where html meets server controls. (aspx files)
2. the code behind. this is where your server code starts. (aspx.cs/vb)
the two together allow you to generate dynamic html.
you need to be able to view both to make any adjustments to the UI. There is a toggle switch in the lower left corner of the VS IDE tab for the aspx file. you can view the markup, the WYSIWYG layout or both. viewing the code behind is done on a separate tab within the VS IDE. You can press <F7> to toggle between the markup and code behind.

I would recommend working in the markup view, not the WYSIWYG like a desktop application. You have much more control over the layout and it gets you closer to the html.

somethings to note about web development. It's nothing like desktop development. Webforms gives the appears of desktop like environment, but it's not. And if you try to treat it like a desktop app, you will constantly be fighting against the framework.
web development requires some knowledge of html, js and css as well as C#/VB. with Webforms the level is very low. but the more you understand html, js & css the better/easier it is to develop use friendly UIs.
Styling and layout is not like the desktop. You will use css and js to manipulate DOM (html) elements It's a whole new environment/language.
the web is stateless where the desktop is stateful. each request/response to the server is atomic and the server does not track one request to the next. In other words, once the server sends a response back to the client it forgets everything about that request. Webforms tries to mimic a stateful environment with the concepts of post back & view state, but you need to understand how these concepts (hacks) work to make the stateless appear stateful.

for local development you have 3 choices to host the website
1. install the full version IIS
2. use IIS Express all the features of IIS 7 but it runs as a process instead of a full blown service.
3. use Casinni (webdav) this is the original web development server for VS. for a long time it was the only option. and it had a very limited feature set. It worked for most simple scenarios, but a lot of runtime/configuration bugs could arise if the developer isn't aware of the differences between Casinni and IIS. and deploys a site tested on Casinni directly to the production server.

My personal preference is IIS Express. it doesn't require the overhead of IIS and supports more features than Casinni.

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
Thanks for your quick response. I am unable to see the WYSISYG of any of the forms because they all show the Master page error.

You did say: the ~\masterpage should be located in the root of the asp.net webforms project

The question I have is what constitutes the root of the project? Is it the folder where the solution file resides, or where the code resides? There is a MasterPage.master set of files (including a .vb) in the same folder where all the aspx.vb files are located.

Do I need to install IIS (or IIS express) in order to 1) design web forms, and 2) run the web app in debug mode?

If the anwswer is yes, then how do I set everything up?

Thanks in advance,

Jerry Scannell
 
~\ refers to the root of the asp.net project directory.

Casinni is included with VS all you should have to do is press <F5> and the website will spin up locally. this assumes a default project configuration.

IIS Express was a separate install for awhile. Integrated support was added with VS2010 SP1, but I don't know if IIS Express was part of the download.

IIS (full) is a windows component that can be added from Add/Remove programs > Add/Remove Components. You will need the Windows OS disk to install.

If you right click the project icon in the solutions explorer and select properties or select the project and press <ctrl>+<enter> it will open the project properties as another tab in the IDE.
From this tab there will be a set of Vertical tabs
Application, Build, Web, Package, Build Events ...etc.
Select the Web tab
the first section of the screen will be Start action
the second section of the screen will be Servers
In the Servers section you can configure which web server to use.
Seelct

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
I'm using VS2010. I can right-click on the main solution reference (top line in the Solution Explorer) and choose "Property Pages", or "Properties". Neither of those selections presents a window with tabs like you mentioned.

Property pages gives vertical tabs: References, Build, Accessibility, Start Options, MSBuild options, and Silverlight Applications.

I have enabled IIS and it works ( gives me the IIS7 page).

The Start Options tab of the Property pages window, dose have a section Server where you can select 'use default Web server' or 'Use custom server'. I've tried both.

The ones you mentioned sound like Project properties that can be found in older versions of VS like VS2003.


Jerry Scannell
 
I'm using VS2010. I can right-click on the main solution reference (top line in the Solution Explorer) and choose "Property Pages", or "Properties". Neither of those selections presents a window with tabs like you mentioned.
right click the project icon, not the solution icon. a solution can contain multiple projects. not all of which will be asp.net projects.
I have enabled IIS and it works ( gives me the IIS7 page).
then it sounds like either IIS 7 OR IIS Express (7.5) is installed. the web.config may be missing some directives to IIS (Express). you may also need to set a start page for local debugging.

Can you contact the original vendor and get some documentation or assistance with project setup? this will be the best source rather than having us guess at what the problem could be.

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
We will eventually be contacting the vendor for a lot of things. I'm new here and wanted to get at least a little knowledge before we went to the vendor. I honestly thought that properly loading the solution would be all that I had to do to at least see how things are setup. I guess not. I don't understand why I can't open a form and see the controls like I can do with a desktop app. I'm not even trying to run the code. Just see how it all works.

This may be a silly question, but was I supposed to do File | Open | Project/solution... or File | Open | Website... ??

BTW, there isn't a project icon in my solution explorer. The only item that I can see any advanced properties is the very top item which is in black and when I right-click on it I can do, among other things, Build Website, Publish Website, and at the very bottom Property Pages.

Jerry Scannell
 
that depends on how the project was designed. Personally I don't use File>Open>Website. I design everything, including websites, as a project.
Code:
I don't understand why I can't open a form and see the controls like I can do with a desktop app.
it's not that you can't. VS tries to make the WYSIWYG layout as close to the real thing as possible. Therefore it's trying to load the master file associated with the page. it will then also try to load any skins and css referenced in the master file and page.

it may seem foreign now, but if you can read the html and css you can picture the page in your mind. that's how I "see" the layout. Think of the Matrix.
cypher said:
I don't see code. All I see now is blond, brunette, redhead.

another thought. instead of jumping right into this project spike out a quick asp.net webforms project and learn how the files are structured.

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
I think I will do that last suggestion. I do wish thought that I could get beyond the masterpage. Where is that thing supposed to reside anyway?


Jerry Scannell
 
you can place it where ever you want. conventionally it's placed at the root of the directory it represents. for a master page applied to every page it's placed at the root of the project. but say you also have a master page for the admin section. you could place another master file in the admin directory and have admin pages reference the admin\master file which in turn references the main master file.

here is an example of a conventional directory structure
[tt]
root
/bin
/binaries
/Admin
/AdminMaster.master
/Default.aspx
/AnotherPage.aspx
/Private
/PrivateMaster.master
/Default.aspx
/web.config (optional if you need further configuration)
/Foo
/FooMaster.master
/Default.aspx
/Master.master
/Default.aspx
/web.config
[/tt]
you can have the master files cascade down. or they can stand alone.

each page can then reference the master(s). you can set the master page in the web.config or per page.

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top