Working with Visual Studio
Working with Aspose.Cells.GridWeb Using Visual Studio 2013
This topic shows how to use Aspose.Cells.GridWeb by making a sample website in Visual Studio 2013. The process has been divided into steps.
Step 1: Creating New Web Site
- Open Visual Studio 2013.
- From the File menu, select New Menu, then Web Site.
The New Web Site dialog is opened.
- Select ASP.NET Web Forms Site from Visual Studio installed templates.
- Choose HTTP mode for the location of the web site.
- Specify a location where the web site files will be created and stored.
- Click Browse in the New Web Site dialog.
The Choose Location dialog is displayed.
- Click the Local IIS tab. All folders and web applications stored in your IIS root folder are displayed (for example: C:\Inetpub\wwwroot).
- Now create a new web application in your local IIS where the website files will be stored. The Choose Location dialog lets you create and delete web applications or virtual directories in your local IIS. To create a web application, click a button as shown below in the figure.
A new web application with the default name WebSite is created.
- Rename the web application. We renamed it GridWebOn2013.
- Click Open.
You return to the New Web Site dialog. The path of web site location is set to http://localhost/GridWebOn2013.
- Click OK to let Visual Studio create a web site.
Step 2: Checking Source & Design Views of a Web Page
A default web site will have been created by Visual Studio 2013. It contains a default.aspx web page with some dummy text and markup.
Source view of default.aspx page
All web pages (including ASP.NET) can be opened in two modes. One is the source view that lets developers access and modify the source code. The second mode is design view that can be used to design web pages in a WYSIWYG manner. The above screenshot shows a source view of default.aspx web page. To view the design view, click Design.
Design view of default.aspx page
Delete the Default.aspx page added by Visual Studio and add a new blank Default.aspx page.
Step 3: Adding Aspose.Cells.GridWeb to Web Page
You can simply add Aspose.Cells.GridWeb (or GridWeb) control to a web page by dragging it from the toolbox.
Once GridWeb control is dropped to web page, it would render like this:
Step 4: Change the <!DOCTYPE> tag
- Switch to source view and find the following <!DOCTYPE> tag in the source code:
ASP.NET
<!DOCTYPE html>
- Select the complete tag.
- Retain, change or delete the <!DOCTYPE> tag.
- Or modify the <!DOCTYPE> tag with the following one:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
Step 5: Resizing Aspose.Cells.GridWeb Control
You can change the width and height of the GridWeb control after dragging it to the website.
In design view, you can resize the width and height of the GridWeb.
Step 6: Configuring the Properties of Aspose.Cells.GridWeb
Configure the Aspose.Cells.GridWeb properties in WYSIWYG by clicking the Properties button on the right side of Visual Studio 2013 IDE. A Properties dialog is displayed.
The Properties pane makes it possible to configure the look & feel of the GridWeb and some other properties to control GridWeb’s behaviour.
Step 7: Running Your First Web Site Containing Aspose.Cells.GridWeb
Build and run the web site.
- Run the web site directly from Visual Studio by pressing Ctrl+F5 or clicking Start Debugging.
Now, you can start playing with GridWeb control.
GridWeb control in action