16.01.2013 Views

Microsoft Sharepoint Products and Technologies Resource Kit eBook

Microsoft Sharepoint Products and Technologies Resource Kit eBook

Microsoft Sharepoint Products and Technologies Resource Kit eBook

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 35: Building Applications Using Windows SharePoint Services Data 965<br />

Note Visual Studio does not default to showing all files, which can make it<br />

hard to find parts of the project. To save some time, at the very top of the<br />

Solution Explorer window, click the Show All Files icon (which is the third<br />

icon from the left).<br />

To build a home page for testing<br />

1. From the top menu, click Project <strong>and</strong> select Add New Item.<br />

2. In the right pane, click Web Form to select it.<br />

3. In the Name box on the bottom of the window, clear whatever is there, enter<br />

Default.aspx, <strong>and</strong> then click Open.<br />

4. We need an image to put on the home page, so right-click LocalHost (Or<br />

Server) in the Solution Explorer window, select Add, <strong>and</strong> then click Add<br />

Existing Item.<br />

5. At the bottom of the page, in the Files of type drop-down list, select Image<br />

Files.<br />

6. Next, from the top of the page, use the Look In drop-down list to navigate to<br />

the c:\Windows (or c:\Winnt) folder. From there, click any bitmap (BMP) or<br />

JPG file.<br />

7. Click the Open button to add it to the project. You should have the<br />

Default.aspx file open in the editor.<br />

8. If you are in HTML mode, click Design mode. (The layout grid should be<br />

showing.)<br />

9. In the Solution Explorer pane, click the new image you added, drag it to the<br />

Default.aspx page, <strong>and</strong> drop it near the top left corner of the page.<br />

10. In the Solution Explorer pane, right-click Default.aspx <strong>and</strong> from the menu,<br />

select Set As Start Page. (This sets the Default.aspx page as the page to open<br />

if we are running the debugger.)<br />

11. Now save your project by selecting File <strong>and</strong> then Save All from the top<br />

menu. (You can also press Ctrl+Shift+S to save everything.)<br />

12. Then from the top menu again, select Build <strong>and</strong> then Build Solution. (You<br />

can also press Ctrl+Shift+B.) An Output window should appear <strong>and</strong> indicate<br />

that the build was successful.<br />

Now we need to test the application to make sure it works. Open your browser,<br />

<strong>and</strong> navigate to the new site—in our example, the URL is http://localhost:383 (or<br />

http://:383). You should see the new page with the image as we created it.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!