13.07.2015 Views

ASP.NET 3.5: A Beginner's Guide - www.mustafaof.com

ASP.NET 3.5: A Beginner's Guide - www.mustafaof.com

ASP.NET 3.5: A Beginner's Guide - www.mustafaof.com

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

346<strong>ASP</strong>.<strong>NET</strong> <strong>3.5</strong>: A Beginner’s <strong>Guide</strong>Whether to use the DataList control or some other control, such as the Repeater,wholly depends on what you need to do with the data.DataGrid Made EasyIf you’re in a big hurry and have to get a table produced yesterday, you’ll like this nextmethod of data binding. Use the following steps:1. Open a new Web Site to be saved as EZdataGrid.2. In the <strong>ASP</strong>.<strong>NET</strong> editor, open the Server Explorer. Drag a table of your choice from theServer Explorer to the container as shown in Figure 13-9.3. Save the file and test it by pressing CTRL-F5. You should see the table in Figure 13-10.As you can see in Figure 13-10, the data are neatly laid out in rows and columns witha boldface header. You need not add a single line of C# code. In fact, you don’t even haveto open the C# portion of the application at all. It’s <strong>com</strong>pletely done.If you’re wondering how this can be ac<strong>com</strong>plished in <strong>ASP</strong>.<strong>NET</strong> with no call to theSQL table using C# statements, the answer lies in <strong>ASP</strong>.<strong>NET</strong> tags that automaticallyFigure 13-9 Drag table from Server Explorer to <strong>ASP</strong>.<strong>NET</strong> editor

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

Saved successfully!

Ooh no, something went wrong!