Book Image

Beginning C# 7 Hands-On ??? Advanced Language Features

By : Tom Owsiak
Book Image

Beginning C# 7 Hands-On ??? Advanced Language Features

By: Tom Owsiak

Overview of this book

Beginning C# 7 Hands-On – Advanced Language Features assumes that you’ve mastered the basic elements of the C# language and that you're now ready to learn the more advanced C# language and syntax, line by line, in a working Visual Studio environment. You'll learn how to code advanced C# language topics including generics, lambda expressions, and anonymous methods. You'll learn to use query syntax to construct queries and deploy queries that perform aggregation functions. Work with C# and SQL Server 2017 to perform complex joins and stored procedures. Explore advanced file access methods, and see how to serialize and deserialize objects – all by writing working lines of code that you can run within Visual Studio. This book is designed for beginner C# developers who have mastered the basics now, and anyone who needs a fast reference to using advanced C# language features in practical coding examples. You'll also take a look at C# through web programming with web forms. By the time you’ve finished this book, you’ll know all the critical advanced elements of the C# language and how to program everything from C# generics to XML, LINQ, and your first full MVC web applications. These are the advanced building blocks that you can then combine to exploit the full power of the C# programming language, line by line.
Table of Contents (35 chapters)
Title Page
Credits
About the Author
www.PacktPub.com
Customer Feedback
Preface

Placing a chart into the HTML page


Crank up a project and what we will do first is to place a chart in the <html> page. Go to Toolbox (Ctrl + Alt + X), enter char... in the Search field, and drag and drop it below the line that begins with <form id=....

As you can see on your screen, this generates all of the following markup. You can leave it as is. It's sufficient for our purposes:

<asp:Chart ID="Chart1"runat="server">
  <Series>
    <asp:SeriesName="Series1" ChartType="Point"></asp:Series>
  </Series>
  <ChartAreas>
    <asp:ChartArea Name="ChartArea1"></asp:ChartArea>
  </ChartAreas>
</asp:Chart>

You can delete the two <div... lines and the <asp:Label ID... line. We don't need them.

Adding a button to the HTML page

Next, you need to place a button below the </asp:Chart> line. So again, go to Toolbox, grab a Button control, and drag it in there. Change the text on the button to say Load Data. Here, Load Data means...