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(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);
}
Amit MohantyPosted Jun 12, 2023, 9:48 AM
Check this
Prasad RaveendranPosted Jun 12, 2023, 1:47 AM
Please find the same code and see whether this would help.
Sample code atttached for your perusal