ahmed salah

ahmed salah

  • 1.2k
  • 547
  • 62.8k

How to make jQuery ajax request to this function on razor asp.net

Jun 11 2023 11:33 PM

I work on razor asp.net .i can't make jquery ajax request to call get function 

so please how to make ajax request return value on LoginStatusMsg have value then set visability true 

so i need to make jquery ajax request to function ChangeLoginStatus and if LoginStatusMsg have value then set visability to  true 

public JsonResult OnGetChangeLoginStatus(string UserId)
{
    string MyUserData = Request.Cookies["myUserData"];
    userAuthResponse = System.Text.Json.JsonSerializer.Deserialize<UserAuthResponse>(MyUserData);
    UserId = userAuthResponse.Data.UserID;
   
    string strHost = _ISecurityService.GetPCName();
    DataSet ds = _IUserSecurity.ChangeLoginStatus(UserId, strNewStatus, UserId, strHost);
    if (ds.Tables[0].Rows.Count > 0)
    {
        if (ds.Tables[0].Rows[0][0].ToString() != "0")
        {
            LoginStatusMsg = ds.Tables[0].Rows[0][1].ToString();
        }
    }
    return new JsonResult(LoginStatusMsg);
}

 


Answers (2)