Book Image

Kentico CMS 5 Website Development: Beginner's Guide

By : Thom Robbins
Book Image

Kentico CMS 5 Website Development: Beginner's Guide

By: Thom Robbins

Overview of this book

<p>There are over 1.7 billion internet users today. What are you doing to manage your web presence and reach your potential audience? A successful website guarantees serious business benefits and substantial cost savings for your company. Kentico CMS provides a flexible, all-in-one solution for web developers to create sites that ensure increase in brand loyalty, customer support savings and better brand management. However, making full use of Kentico CMS for attracting potential audience requires some guidance.<br /><br />This practical guide gives you a head start using Kentico CMS to create professional and engaging web sites. It helps you get started quickly and covers how to build dynamic, scalable, and feature-rich websites that will keep your site visitors engaged and coming back. It moves beyond the basics to take advantage of the most powerful features to create highly interactive websites. Practical examples and tutorials show how to leverage the thirty-four different modules to create everything from a basic website to the most advanced and interactive e-commerce and social media sites. The focus is on clear instructions and easy-to-understand tutorials. This book is for you if you want to get the most out of any Kentico CMS installation!</p> <p>By the end of this book, you will have learned how to build a dynamic, discoverable, and scalable website.</p>
Table of Contents (16 chapters)
Kentico CMS 5 Website Development
Credits
About the Author
Acknowledgement
About the Reviewers
Preface

Time for action—building a web service


The web service web part enables you to connect to web service end points. This web part requires that you specify a web service URL and it implements a GetDataSet() method. The Kentico WebProject contains an example that can be customized. Let's create an example of a web service that allows you retrieve a lunch list using a GetDataSet() method and the following steps.

  1. 1. In the Kentico CMS WebProject, double-click the \App_Code\CMSPages\WebService.cs file, as shown in the following screenshot:

  2. 2. In the WebService.cs GetDataSet() method, replace the existing code with the following:

    /// <summary>
    /// Returns the data from DB
    /// </summary>
    /// <param name="parameter">String parameter for sql command</param>
    [WebMethod]
    public DataSet GetDataSet(string parameter)
    {
    // INSERT YOUR WEB SERVICE CODE AND RETURN THE RESULTING DATASET
    //-- Instantiate the data set and table
    DataSet lunchDS = new DataSet();
    DataTable lunchTable = lunchDS...