Introduction
- A Home page is a starting page of any web
browser.
- A Home page contain the information of a
website.
- There may be many links in a Home page to
other part of web site.
- The initial page which WWW browser shows?
covering page of the web site? or web pages on the whole?
- For a Web user, the home page is the first
Web page that is displayed after starting a Web browser.
- For a Web site developer, a home page is
the first page presented when a user selects a site or presence on the World
Wide Web. It most often refers to the initial or main web page of a web
site, sometimes called the front page. (http://searchsoa.techtarget.com/definition/home-page)
Step by step solution
Step 1: Open Visual Studio
LightSwitch->File->New->Project.
Step 2: Go to properties->Access Control->Mark
Granted for debug.
Step 3: Run application (Press F5)->Click
sign in user section->Fill data->Save.
Step 4: Right click on screens->Add screen.
Step 5: Select New Data Screen->Write name of
screen (Homepage)->Ok.
Step 6: Add data item->Select local
property->Type (string)->Write name (Name)->Ok.
Step 7: Repeat above process 3 or 4 times, with Name, FullName, IsAuthenticated, AuthenticationType.
Step 8: Right click on Command Bar->Delete.
Step 9: Move Name from HomePage to Command Bar,
Likes below image.
Step 10: Add->Select FullName, IsAuthenticated,
AuthenticationType.
Step 11: Go to write code->Select
HomePage_Created->write the below code.
using System;
using
System.Linq;
using
System.IO;
using
System.IO.IsolatedStorage;
using
System.Collections.Generic;
using
Microsoft.LightSwitch;
using
Microsoft.LightSwitch.Framework.Client;
using
Microsoft.LightSwitch.Presentation;
using
Microsoft.LightSwitch.Presentation.Extensions;
namespace
LightSwitchApplication
{
public partial
class HomePage
{
partial void
HomePage_Created()
{
Microsoft.LightSwitch.Security.IUser
currentUser = this.Application.User;
if (currentUser !=
null)
{
this.Name = currentUser.Name;
this.FullName =
currentUser.FullName;
this.IsAuthenticated =
currentUser.IsAuthenticated.ToString();
this.AuthenticationType =
currentUser.AuthenticationType.ToString();
}
}
}
}
Step 13: Go to properties->Screen
Navigation->Select Home Page->set.
Step 14: Run application (Press F5)->Go to
Design screen.
Step 15: Select Label in the Name, FullName,
IsAuthenticated, AuthenticationType->Save.
Step 16: Now Name, FullName, IsAuthenticated,
AuthenticationType will show in the label.
Summary
So a Home page is the front page of a website
which contains information about the website. Every website contains a Home Page.