开发者

Login verification in asp.net

I have working in ASP.net web application and my friend working with ASP.net web service. He created a database in his webservice. I want to access this webservice from my web application.

I want to verify the method in the webservice whether the username and password is valid or not when I enter the username and password in my web application. I created the string like

protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
    Response.Redirect("ServiceRequestPage.aspx");
    string user=Login1.UserName;
    string pass = Login1.Password;
    string logcmd = "<login username='" + user + "' password='" + pass + "'/>";  
}


public string BGFocusRequest(String inBGFocusCmd)
{
    string bgtFocusResponseString=null;
    try
    {
        bgtFocusResponseString = serviceInitiatorObject.StringParser(inBGFocusCmd);
    }
    catch (Exception e)
    {

    }
    return bgt开发者_如何学PythonFocusResponseString;
}

But I don't know how to verify my login function. Can anyone help me.


I don't know what you're doing. But first of all you're redirecting the user to a ServiceRequestPage so anything below that authentication line won't execute..

try something like this:

protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
    e.Authenticated = new webservicename().Validate(Login1.UserName, Login1.Password);
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜