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