Here is the code from the question comments
259: public ActionResult ShowAddress(FormCollection formCollection) {
260: long _userId= long.Parse(formCollection["UserId"].ToString());
261: UserDetails _userDetails = _userDAL.GetUserDetails(_userId);
262: if(!string.IsNullOrEmpty(_userDetails.Address1)) return RedirectToAction("GetAddress", "User"); else return View(); }
If you're seeing a NullReferenceException at line 260, either formCollection or the result of formCollection["UserId"] is null. You need to account for this in your code. For instance you could do the following.
public ActionResult ShowAddress(FormCollection formCollection) {
if ( null == formCollection ) {
return View();
}
object obj = formCollection["UserId"];
if ( null == obj ) {
return View();
}
long _userId = long.Parse(obj.ToString());
...
}