In my Web application, I am having two pages.
controls used in Loginpage
username text box
Password text box
then the authentication success on the button click we redirecting to
without authentication if you use the below URL
its going to mainpage.aspx
my problem is if use this URL should be redirected to LoginPage only.
I have searched many examples in Google.But I haven't get the clear solution.
kindly explain me to achieve this.
I have master page and I tried like,
1. in my web.config file
<forms loginUrl="Login.aspx" timeout="1" />
2. and my Login file, we have many images and headers then my button click event
protected void Login_Click(object sender, EventArgs e)
if ((UserEmail.Value == "12") && (UserPass.Value == "12"))
Msg.Text = "Invalid Credentials: Please try again";
3. My WebForm1 file like one logout button click event.
If i run this application my design changed and images were not displayed on the browser.
if i use this part in web.config file
<deny users="?" />
design and images were not displayed properly but i am able to redirect login page when other URL typed in the browser, if i remove this tag design is ok but i am unable to redirect to login page when other URL typed in the browser.