Click here to Skip to main content
16,005,069 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionClassic Asp Session not getting expire As per IIS setting timeout Pin
googlejumbo23-Feb-09 23:28
googlejumbo23-Feb-09 23:28 
QuestionPassing parameters to Javascript popup window Pin
pavanip23-Feb-09 22:53
pavanip23-Feb-09 22:53 
AnswerRe: Passing parameters to Javascript popup window Pin
Greg Chelstowski23-Feb-09 23:03
Greg Chelstowski23-Feb-09 23:03 
GeneralRe: Passing parameters to Javascript popup window Pin
pavanip23-Feb-09 23:13
pavanip23-Feb-09 23:13 
GeneralRe: Passing parameters to Javascript popup window Pin
Greg Chelstowski23-Feb-09 23:28
Greg Chelstowski23-Feb-09 23:28 
GeneralRe: Passing parameters to Javascript popup window Pin
pavanip24-Feb-09 0:35
pavanip24-Feb-09 0:35 
GeneralRe: Passing parameters to Javascript popup window Pin
Greg Chelstowski24-Feb-09 1:32
Greg Chelstowski24-Feb-09 1:32 
Questionlogin control error Pin
rosae61923-Feb-09 22:53
rosae61923-Feb-09 22:53 
i have written a code for login control but it generate the following error


Server Error in '/' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0161: 'ASP.login_aspx.SiteLevelCustomAuthenticationMethod(string, string)': not all code paths return a value

Source Error:

[No relevant source lines]


Source File: Line: 0



Microsoft (R) Visual C# 2008 Compiler version 3.5.21022.8
for Microsoft (R) .NET Framework version 3.5
Copyright (C) Microsoft Corporation. All rights reserved.

e:\New Folder (2)\WebApplication1\WebApplication1\login.aspx(15,14): error CS0161: 'ASP.login_aspx.SiteLevelCustomAuthenticationMethod(string, string)': not all code paths return a value


the code is
database name pubs and table name pswd
where columns are User and pswd
]]>
]]>


protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
bool Authenticated = false;
Authenticated = SiteLevelCustomAuthenticationMethod(Login1.UserName, Login1.Password);
e.Authenticated = Authenticated;
if (Authenticated == true)
{
//Response.Redirect();
}
}
private bool SiteLevelCustomAuthenticationMethod(string UserName, string Password)
{
SqlCommand cmdSelect;
bool boolReturnValue = false;
string strConnection = "@Server=localhost;Integrated Security=SSPI; Database=Pubs";
SqlConnection Connection = new SqlConnection(strConnection);
cmdSelect = new SqlCommand( "Select * From pswd", Connection );
SqlDataReader Dr;
Connection.Open();
Dr = cmdSelect.ExecuteReader();

while (Dr.Read())
{
if ((UserName == Dr["user"].ToString()) & (Password == Dr["Pswd"].ToString()))
{
boolReturnValue = true;
}
Dr.Close();
return boolReturnValue;
}
}




<asp:login id="Login1" runat="server" onauthenticate="Login1_Authenticate" xmlns:asp="#unknown">


AnswerRe: login control error Pin
ABitSmart24-Feb-09 2:36
ABitSmart24-Feb-09 2:36 
QuestionConvert HTML to XML Pin
rhemy23-Feb-09 22:45
rhemy23-Feb-09 22:45 
QuestionMechanism to handle user authentication and authorization Pin
mukkanti00723-Feb-09 21:53
mukkanti00723-Feb-09 21:53 
AnswerRe: Mechanism to handle user authentication and authorization Pin
Expert Coming23-Feb-09 22:21
Expert Coming23-Feb-09 22:21 
GeneralRe: Mechanism to handle user authentication and authorization Pin
mukkanti00724-Feb-09 23:29
mukkanti00724-Feb-09 23:29 
QuestionSimple activation email Pin
netsooz (Amir Hamidi)23-Feb-09 21:52
netsooz (Amir Hamidi)23-Feb-09 21:52 
AnswerRe: Simple activation email Pin
Greg Chelstowski23-Feb-09 22:01
Greg Chelstowski23-Feb-09 22:01 
AnswerRe: Simple activation email Pin
Abhijit Jana23-Feb-09 22:04
professionalAbhijit Jana23-Feb-09 22:04 
GeneralRe: Simple activation email Pin
J4amieC23-Feb-09 22:09
J4amieC23-Feb-09 22:09 
GeneralRe: Simple activation email Pin
Expert Coming23-Feb-09 22:12
Expert Coming23-Feb-09 22:12 
GeneralRe: Simple activation email Pin
J4amieC24-Feb-09 0:04
J4amieC24-Feb-09 0:04 
GeneralRe: Simple activation email Pin
Abhijit Jana23-Feb-09 22:13
professionalAbhijit Jana23-Feb-09 22:13 
GeneralRe: Simple activation email Pin
Expert Coming23-Feb-09 22:17
Expert Coming23-Feb-09 22:17 
GeneralRe: Simple activation email Pin
J4amieC24-Feb-09 0:00
J4amieC24-Feb-09 0:00 
GeneralRe: Simple activation email Pin
J4amieC24-Feb-09 0:02
J4amieC24-Feb-09 0:02 
GeneralRe: Simple activation email Pin
Abhijit Jana24-Feb-09 0:42
professionalAbhijit Jana24-Feb-09 0:42 
QuestionLeftMouseUp / LeftMouseDown events for ASP.NET controls Pin
alvarog0123-Feb-09 21:46
alvarog0123-Feb-09 21:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.