Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Whenever I Enter an invalid entry, the code catches the exception but updates the view anyways, please help me fix this . public ActionResult ManagePortfolioGridCreate([DataSourceRequest]

Whenever I Enter an invalid entry, the code catches the exception but updates the view anyways, please help me fix this .

public ActionResult ManagePortfolioGridCreate([DataSourceRequest] DataSourceRequest request, ManagePortfolioGridViewModel vm) { try { var result =_adminBll.CreatePortfolio(vm); return Json(new[] { result }.ToDataSourceResult(request, ModelState));

} catch (Exception e) { Log.Error(e.Message);

ModelState.AddModelError(string.Empty, e.Message); return Json(new[] { vm }.ToDataSourceResult(request, ModelState));

}

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What is centering, why would you use it, and how is it done?

Answered: 1 week ago

Question

2. Define identity.

Answered: 1 week ago

Question

1. Identify three communication approaches to identity.

Answered: 1 week ago

Question

4. Describe phases of majority identity development.

Answered: 1 week ago