Click here to Skip to main content
Click here to Skip to main content
Articles » Web Development » ASP.NET » General » Downloads
 
Add your own
alternative version

DotNetNuke Silverlight 3.0 Hello World

, 3 Aug 2009 Ms-PL
The goal of this tutorial is to walk you through creating a simple Silverlight module in DotNetNuke that authenticates the currently logged in user through a web service.
HelloWorld3_01.00.00_Install.zip
ClientBin
HelloWorld3.xap
HelloWorld3.dnn
<%@ WebService Language="C#" Class="HelloWorld3.WebService" %>

using System.Web.Services;
using DotNetNuke.Entities.Users;

namespace HelloWorld3
{
    [WebService(Namespace = "http://ADefWebserver.com/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class WebService : System.Web.Services.WebService
    {
        #region GetUsername()
        [WebMethod]
        public string GetUsername()
        {
            string strUsername = "World!";

            // Get the current user 
            UserInfo objUserInfo = UserController.GetCurrentUserInfo();

            // If the user is not -1 they are logged in
            if (objUserInfo.UserID > -1)
            {
                strUsername = objUserInfo.DisplayName;
            }

            return strUsername;
        }
        #endregion
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)

Share

About the Author

defwebserver
Software Developer (Senior) http://ADefWebserver.com
United States United States
Michael Washington is a Microsoft MVP. He is a ASP.NET and
C# programmer.
He is the founder of
LightSwitchHelpWebsite.com

He has a son, Zachary and resides in Los Angeles with his wife Valerie.

He is the Author of:
Follow on   Twitter

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.141216.1 | Last Updated 3 Aug 2009
Article Copyright 2009 by defwebserver
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid