jtran007
asked on
login control
Hi Expert,
I use login control in the login page. When I run in
the Visual IDE, it starts with login page. Then I type usernam, and
password. If it passes, I go to the other page (called dialcode.aspx).
However if i run in the browser (firefox), it always go to my dialcode page.
Could you help?
Thx,
JT
I use login control in the login page. When I run in
the Visual IDE, it starts with login page. Then I type usernam, and
password. If it passes, I go to the other page (called dialcode.aspx).
However if i run in the browser (firefox), it always go to my dialcode page.
Could you help?
Thx,
JT
ASKER
Hi expert,
How is web.config working; since I am new to web app.
Thx,
JT
How is web.config working; since I am new to web app.
Thx,
JT
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi expert,
I copied your attached code, and put into my web.config. It's not working; it did not
allow me to go to another page either.
What do I have to change your code?
Thx,
JT
I copied your attached code, and put into my web.config. It's not working; it did not
allow me to go to another page either.
What do I have to change your code?
Thx,
JT
ASKER
Hi expert,
Attached is my added in the web.config.When I click login,
nothing happens.
Please help.
Thx,
JT
Attached is my added in the web.config.When I click login,
nothing happens.
Please help.
Thx,
JT
<authentication mode="Forms">
<forms loginUrl = "Login.aspx" name="3345C" timeout="1"/>
</authentication>
Can you share the code how you are authenticating the user?
Are you using Membership Provider?
Make sure browser cookies is enabled.
Are you having any roles?
Please share all relevant code.
Are you using Membership Provider?
Make sure browser cookies is enabled.
Are you having any roles?
Please share all relevant code.
ASKER
Hi expert,
Yes, I can.
No I am using membership provider.
What are cookies for?
No I don't have any roles.
Just create user name, and password. And let them
use my web app. That's all ai want.
Thx,
Jt
Yes, I can.
No I am using membership provider.
What are cookies for?
No I don't have any roles.
Just create user name, and password. And let them
use my web app. That's all ai want.
Thx,
Jt
protected void Login1_Authenticate1(object sender, AuthenticateEventArgs e)
{
bool Authenticated = false;
Authenticated = Authenmethod(Login1.UserName, Login1.Password);
e.Authenticated = Authenticated;
if (Authenticated == true)
{
Response.Redirect("dialcode.aspx");
}
}
private bool Authenmethod(string UserName, string Password)
{
if (UserName.Equals("qiiq") && Password.Equals("abc"))
return true;
else
return false;
}
----What are cookies for?
FormsAuthentication requires cookies enabled by default...So check you browers accept cookies...
With FireFox .. Got to Tools->Options->Privacy Tab -> Make sure Accept cookies from site Checkbox is Selected.
Might sound stupid to ask...but make sure you are entering correct username and password...i.e. by mistake you are not entering leading or trailing spaces....
Also Drag and drop LoginName and LoginStatus control on your Login.aspx page for troubleshooting purpose.
FormsAuthentication requires cookies enabled by default...So check you browers accept cookies...
With FireFox .. Got to Tools->Options->Privacy Tab -> Make sure Accept cookies from site Checkbox is Selected.
Might sound stupid to ask...but make sure you are entering correct username and password...i.e. by mistake you are not entering leading or trailing spaces....
Also Drag and drop LoginName and LoginStatus control on your Login.aspx page for troubleshooting purpose.
Oh yeah also make sure you are denying anonymous access to your website ...i.e. add this to your web.config:
<authentication mode="Forms">
<forms loginUrl = "Login.aspx" name="3345C" timeout="1"/>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
<authentication mode="Forms">
<forms loginUrl = "Login.aspx" name="3345C" timeout="1"/>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
ASKER
Hi expert,
Yes I did include it in the web.config.
Somehow I run in the Visual IDE, it's workin fine but not
in the browser.
Thx,
JT
Yes I did include it in the web.config.
Somehow I run in the Visual IDE, it's workin fine but not
in the browser.
Thx,
JT
There is one problem i found with your code.
You have e.Authenticated = Authenticated; outside the if statement so the user is always Authenticated= true.
Do it like that
You have e.Authenticated = Authenticated; outside the if statement so the user is always Authenticated= true.
Do it like that
protected void Login1_Authenticate1(object sender, AuthenticateEventArgs e)
{
bool Authenticated = false;
Authenticated = Authenmethod(Login1.UserName, Login1.Password);
if (Authenticated == true)
{
e.Authenticated = Authenticated;
Response.Redirect("dialcode.aspx");
}
}
private bool Authenmethod(string UserName, string Password)
{
if (UserName.Equals("qiiq") && Password.Equals("abc"))
return true;
else
return false;
}
ASKER
Hi expert,
guru_sami:
I did check Firefox.its setting is ok as you said.
Also in the web.config, I do include .
But the result is still the same.
Thx,
JT
guru_sami:
I did check Firefox.its setting is ok as you said.
Also in the web.config, I do include .
But the result is still the same.
Thx,
JT
Hmm.. Lets see it again....
When you say:
"However if i run in the browser (firefox), it always go to my dialcode page."
Does same thing happens when you try it in IE?
Do you mean after logging or directly to dialcode.aspx without logging-in?
Did you try placing LoginName Control on your Login.aspx page? What do you see when you start your website first.
Can you also place a LoginName control on your dialcode page and let us know what you see.
When you say:
"However if i run in the browser (firefox), it always go to my dialcode page."
Does same thing happens when you try it in IE?
Do you mean after logging or directly to dialcode.aspx without logging-in?
Did you try placing LoginName Control on your Login.aspx page? What do you see when you start your website first.
Can you also place a LoginName control on your dialcode page and let us know what you see.
ASKER
Hi expert,
No, when I run in IDE, the login starts first. Then if the authentication is OK,
user is allowed to the other page.
The logging happens only in the login page, not in the dialcode page.
The result I told you so far is that login control is in the login page .
If you want to try login control in the dialcode page, I'll do. But not my
intention.
Regards,
JT
No, when I run in IDE, the login starts first. Then if the authentication is OK,
user is allowed to the other page.
The logging happens only in the login page, not in the dialcode page.
The result I told you so far is that login control is in the login page .
If you want to try login control in the dialcode page, I'll do. But not my
intention.
Regards,
JT
I think you misunderstood about LoginName control...
Login Control and LoginName Control are two different control.
So I am suggesting you to place LoginName control in your Login.aspx(which also has Login Control)
and your Dialcode.aspx(which will have just LoginName control and not Login control).
Check this: http://www.dotnetjunkies.ddj.com/QuickStartv20/aspnet/doc/ctrlref/login/loginname.aspx
Login Control and LoginName Control are two different control.
So I am suggesting you to place LoginName control in your Login.aspx(which also has Login Control)
and your Dialcode.aspx(which will have just LoginName control and not Login control).
Check this: http://www.dotnetjunkies.ddj.com/QuickStartv20/aspnet/doc/ctrlref/login/loginname.aspx
and when I say:
Does same thing happens when you try it in IE?
I mean Internet Explorer (IE) as you mentioned firefox specifically so just wondering if it is working fine with IE.
Does same thing happens when you try it in IE?
I mean Internet Explorer (IE) as you mentioned firefox specifically so just wondering if it is working fine with IE.
ASKER
Hi expert,
Since I have a lot of controls in the dialcode page. Now I put login control in this page, other
controls must be disabled, and enable when authentication is verified.
Is it possible to have login in the login page, and my othe controls in the dialog page?
Thx,
JT
Since I have a lot of controls in the dialcode page. Now I put login control in this page, other
controls must be disabled, and enable when authentication is verified.
Is it possible to have login in the login page, and my othe controls in the dialog page?
Thx,
JT
Did you get my last post....I still confirm ...login Control and LoginName control are two different controls.
ASKER
Hi expert,
I did get your last post; however I went home at 5:30PM. Now I return your
post from home. How do I use login control name?
Thx,
JT
I did get your last post; however I went home at 5:30PM. Now I return your
post from home. How do I use login control name?
Thx,
JT
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window