As a software developer, it is important to not waste your time. Everytime you launch your app in debug mode for testing and you have to fill your user and your password, it is lost time.
I wrote this code in order to launch my app without login. You should place it in your Page_Load
event in your Login Page code behind. The goal is to simulate the click from the login button.
Code behind in your login page: LoginPage.aspx.cs:
protected void Page_Load(object sender, EventArgs e)
{
#if DEBUG
userTextBox.Text = "admin";
passTextBox.TextMode = InputMode.SingleLine;
passTextBox.Text = "password1234";
clickLogin(null, null);
#endif
}
Controls in your login page. Two textboxes (user and password) and one login button (ImageButton
in my case): LoginPage.aspx:
<telerik:RadTextBox runat="server" ID="userTextBox" >
</telerik:RadTextBox>
<telerik:RadTextBox runat="server" TextMode="Password" ID="passTextBox">
</telerik:RadTextBox>
<asp:ImageButton ImageUrl="~/images/btnLogin.gif" ID="btnLogin" runat="server"
OnClick="clickLogin" />
If this post helped you, please leave a comment.