jiya
jiya

Reputation: 31

how to Change Session.ToString to int

HttpContext.Session.SetString("module", "CallLogDetail");
HttpContext.Session.SetString("module", "CommentsPanel");
HttpContext.Session.SetString("module", "Update");
HttpContext.Session.SetString("Id", "0");
       
return View();

i have these code of line here Id is string how can i now change it to int.

Upvotes: 1

Views: 163

Answers (1)

Xinran Shen
Xinran Shen

Reputation: 9993

If you want to set Id to int instead of string in session, You can use .SetInt32(string key,int value) to achieve it.

Please refer to this Microsoft Docs.

Upvotes: 3

Related Questions