CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.security Tags:
Item Type: NewsGroup Date Entered: 2/8/2008 4:16:43 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 10 Views: 9 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
11 Items, 1 Pages 1 |< << Go >> >|
Programor
Asp.Net User
Problems with Login control won't even debug2/8/2008 4:16:43 AM

0/0

I don't know what the problem is, its the first time using the login control and

I'm using a custom approach of authentication. When I try to log in, it won't even

get into the debugger. I'm using Vista Premium, Visual Studio 2005, SQL Server

and ASP.NET 2.0

 My Code Look Like this:

protected void DefaultLogin_Authenticate(object sender, AuthenticateEventArgs e)

{

bool isAuthenticated = false;

isAuthenticated = SiteLevelCustomAuthentication(DefaultLogin.UserName, DefaultLogin.Password);

e.Authenticated = isAuthenticated;

if (isAuthenticated == true)

{

Response.Redirect(
"WelcomePage.aspx");

}

 

}

public bool SiteLevelCustomAuthentication(String username, String password)

{

bool isAuthenticated = false;

strConnection = ConfigurationManager.ConnectionStrings["DB1"].ConnectionString;

sqlConn = new SqlConnection(strConnection);

cmd = new SqlCommand("spGetAuthenticationStatus", sqlConn);

cmd.CommandType = CommandType.StoredProcedure;

cmd.Parameters.Add(new SqlParameter(@username, SqlDbType.VarChar)).Value = username;

cmd.Parameters.Add(new SqlParameter(@password, SqlDbType.VarChar)).Value = password;

try

{

sqlConn.Open();

int ret = cmd.ExecuteNonQuery();if (ret == -1)

{

isAuthenticated =
false;

}

else

{

isAuthenticated = true;

}

}

catch (SqlException)

{

}

finally

{

sqlConn.Close();

}

return isAuthenticated;

 

}

 

Thanks in Advance,

Programor

TonyDong
Asp.Net User
Re: Problems with Login control won't even debug2/8/2008 5:33:17 AM

0/0

int ret = cmd.ExecuteNonQuery();

The ret is  the row affected, so if (ret ==1) is true, else will be false.

Try to print the ret for your logic


Don't forget to click "Mark as Answer" on the post(s) that helped you.
TonyDong
Asp.Net User
Re: Problems with Login control won't even debug2/8/2008 5:33:19 AM

0/0

int ret = cmd.ExecuteNonQuery();

The ret is  the row affected, so if (ret ==1) is true, else will be false.

Try to print the ret for your logic

and
Don't forget to click "Mark as Answer" on the post(s) that helped you.
TonyDong
Asp.Net User
Re: Problems with Login control won't even debug2/8/2008 5:33:23 AM

0/0

int ret = cmd.ExecuteNonQuery();

The ret is  the row affected, so if (ret ==1) is true, else will be false.

Try to print the ret for your logic and


Don't forget to click "Mark as Answer" on the post(s) that helped you.
TonyDong
Asp.Net User
Re: Problems with Login control won't even debug2/8/2008 5:33:27 AM

0/0

int ret = cmd.ExecuteNonQuery();

The ret is  the row affected, so if (ret ==1) is true, else will be false.

Try to print the ret for your logic and

double
Don't forget to click "Mark as Answer" on the post(s) that helped you.
TonyDong
Asp.Net User
Re: Problems with Login control won't even debug2/8/2008 5:33:28 AM

0/0

int ret = cmd.ExecuteNonQuery();

The ret is  the row affected, so if (ret ==1) is true, else will be false.

Try to print the ret for your logic and

double check
Don't forget to click "Mark as Answer" on the post(s) that helped you.
TonyDong
Asp.Net User
Re: Problems with Login control won't even debug2/8/2008 5:33:30 AM

0/0

int ret = cmd.ExecuteNonQuery();

The ret is  the row affected, so if (ret ==1) is true, else will be false.

Try to print the ret for your logic and

double check the
Don't forget to click "Mark as Answer" on the post(s) that helped you.
TonyDong
Asp.Net User
Re: Problems with Login control won't even debug2/8/2008 5:33:33 AM

0/0

int ret = cmd.ExecuteNonQuery();

The ret is  the row affected, so if (ret ==1) is true, else will be false.

Try to print the ret for your logic and

double check the result is what
Don't forget to click "Mark as Answer" on the post(s) that helped you.
TonyDong
Asp.Net User
Re: Problems with Login control won't even debug2/8/2008 5:33:34 AM

0/0

int ret = cmd.ExecuteNonQuery();

The ret is  the row affected, so if (ret ==1) is true, else will be false.

Try to print the ret for your logic and

double check the result is what you
Don't forget to click "Mark as Answer" on the post(s) that helped you.
TonyDong
Asp.Net User
Re: Problems with Login control won't even debug2/8/2008 5:33:38 AM

0/0

int ret = cmd.ExecuteNonQuery();

The ret is  the row affected, so if (ret ==1) is true, else will be false.

Try to print the ret for your logic and

double check the result is what you want.
Don't forget to click "Mark as Answer" on the post(s) that helped you.
TechAddict
Asp.Net User
Re: Problems with Login control won't even debug2/8/2008 5:43:16 AM

0/0

Two things:

  1. Have you mapped your control with the event handler function?
  2. Have you set the debug to true in web.config?
11 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
The Guru's Guide to SQL Server Stored Procedures, XML, and HTML Authors: Ken Henderson, Pages: 774, Published: 2002
Linux Network Administrator's Guide Authors: Tony Bautts, Terry Dawson, Gregor N. Purdy, Pages: 338, Published: 2005
Linux Network Administrator's Guide: Network Administrator's Guide Authors: Olaf Kirch, Terry Dawson, Pages: 474, Published: 2000
Beginning ASP.NET 2.0 Authors: Chris Hart, John Kauffman, Chris Ullman, David Sussman, Pages: 759, Published: 2005
Beginning ASP.NET 2.0 with C# Authors: Chris Hart, John Kauffman, David Sussman, Chris Ullman, Pages: 735, Published: 2006
Beginning ASP.NET 2.0 in C# 2005: From Novice to Professional Authors: Matthew MacDonald, Pages: 1148, Published: 2006
Linux Power Tools: Power Tools Authors: Roderick W. Smith, Pages: 644, Published: 2003
Tomcat: The Definitive Guide Authors: Jason Brittain, Ian F. Darwin, Pages: 476, Published: 2007

Web:
debug menu auto quits - ng.asp-net-forum ... Debug? menu disappear after IE lunch. If I have misunderstood your ... net-forum .general_asp-net-security/problems-with-login-control-won-t-even-d ebug . ...
Problem with Login control and web.config The login page doesn't even load, I sometime get the following error: ... start page is set up to your login page, so when you run it from the debugger, ...
ASP.NET Debugging : Loading a control in a Login Control may give ... We also have a nested login control. But even for a less complicated example, ... to see what is inside the LoginView, then those controls won't exist. ...
Troubleshooting the login control? - ASP.NET Forums ...the default Authenticate event implemented by the Login control won't fire, so it's authentication check won't work! ...
Skinned Login Control Apr 14, 2008 ... NET login control with some simple CSS and jQuery for a more ... but IE doesn't support it, so we have to use jQuery to achieve the effect. ...
TheMSsForum.com >> Asp >> Login Control - "Remember Me ... IsPostBack) { //logic here } } But now the code isn't even executed when I click on that button... any suggestions? Tag: Login Control - "Remember Me" ...
Julie Lerman Blog - ASP.NET Teemu Keiski explains why the two won't work together in this blog post. ... NET 2.0 Debugging problems with Vista/IIS7 ยท Login control website spam - fix ...
ASP.NET 2.0 Login debug Is there any way to debug this type of problem to see what the authentication code didn't like? Thanks, .... "login control doesn't match database" ...
15 Seconds : Writing a Custom Membership Provider for the Login ... The login control doesn't care if the membership provider is a custom provider or a .... ...
Sogeti Phoenix Blogs - ASP.NET Login Control The answer is that it won't. You can still use the Login. .... The problem really is that the Login control is rendered using very CSS-unfriendly markup ...




Search This Site:










footer display

how to get my styles listed in the "styles"-dropdown?

javascript

problem defining new module

submitting a form in a contentplaceholder from a javascript function on the master page?

how to pass arguments between pages in a safe way?

asp.net 2.0 membership passwords

dynamic treeview control in master page

subdomains without child portals?

friendlyurls and image paths in javascript

parser error: unknown server tag 'dnn:signin'

designer is bodgy!

hide a module by code

several portal-aliases in dnn2

hold the login while redirecting pages.

creating a login for a whole site

3.13 wtih msde??

can not resize or position the controls in vs 2005

relative addressing in vwd

how to modify asp.net commerce kit register file?

wizard why this error?: both datasource and datasourceid are defined on sidebarlist'. remove one definition.

menu on visual studio 2005

is it possible to configure visual studio 2008 beta express editions to use asp 2.0 instead of 3.5

module brinkster commerce kit headache

is there any keyword likes 'continue' in vb.net ?

complete template walthrough, from design to tableless css template

critical error in modules

what is this stuff?

site log -- disabled ??

where can i download this skin?

 
All Times Are GMT