How to customize lightswitch beta 2 login screen to your own design (how to customize the LS logon Interface)

Source: Internet
Author: User

Http://lightswitchdevelopment.wordpress.com/how-to-customize-lightswitch-beta-2-login-screen-to-your-own-design/

1. Switch Your lightswitch solution to "File View"

2. Click on show all files

3. Right click on the server generated project and add new item

4. Add the ASPX page called singin with the appropriate code.

<Form ID = "form1" runat = "server"> <div>

<P> sign in </P>

<Asp: Label id = "label1" runat = "server" text = "User Name"> </ASP: Label>

<Asp: textbox id = "textbox1" runat = "server" width = "128px"> </ASP: textbox>

<Asp: Label id = "label2" runat = "server" text = "password"> </ASP: Label>

<Asp: textbox id = "textbox2" runat = "server"

Textmode = "Password" width = "128px"> </ASP: textbox>

<Asp: button id = "btnsingin" runat = "server" text = "sign in"

Onclick = "btnsingin_click"/>

<Center> <label id = "lblforgot"> forgot password </label>

<A href = "https://www.in4doctor.com" target = "_ self"> click here </a> </center>

</Div>

</Form>

5-now we need to write btnsingin_click event:

Protected void btnsingin_click (Object sender, eventargs E)

{

Microsoft. lightswitch. Security. servergenerated. Implementation. User user;

Microsoft. lightswitch. Security. servergenerated. Implementation. authenticationservice x = new Microsoft. lightswitch. Security. servergenerated. Implementation. authenticationservice ();

User = x. login (textbox1.text, textbox2.text, false, "");

If (user! = NULL)

{

Response. Write ("<SCRIPT> window. Parent. Location = \" http://www.studentcourse.com/default.htm#" </SCRIPT> ");

} // You need to change the URL according to your project

}

6. We now need to get singin. aspx to be written in the build output. Right click on your project in Solution Explorer and select unload project.

7. Right click the project and select edit.

8. Search the file and for default.htm. You shocould find a section called _ buildfile.

9. Underneath the _ buildfile section for default.htm, add the following.

<_ Buildfile include = "servergenerated \ singin. aspx">
<Subfolder>
</Subfolder>
<Publishtype>
</Publishtype>
</_ Buildfile>

10. Now insert your login account the and enjoy

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.