Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- public partial class LoginPage : System.Web.UI.Page
- {
- Shop myShop;
- protected void Page_Load(object sender, EventArgs e)
- {
- //checks if there is a session vairable present - should only run once at the start of the website use
- if(Session["myShop"] == null)
- {
- myShop = new Shop();
- myShop.loadPeopleFromDb();
- //saves a variable into the session
- Session["myShop"] = myShop;
- }
- else
- {
- myShop = (Shop)Session["myShop"];
- }
- }
- protected void SubmitBtn_Click(object sender, EventArgs e)
- {
- string username = UsernameTxt.Text;
- string password = PasswordTxt.Text;
- myShop.login(username, password);
- }
- protected void ClearBtn_Click(object sender, EventArgs e)
- {
- Response.Redirect("LoginPage.aspx");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement