I runned business logic when user submit form. such as;
.
.
.
//some process
if(model.UserName == "foo")
{
//some process
}
if(model.City != "Istanbul")
{
//Alert user; Are you sure you want to continue bla bla bla...
//Then user click if 'yes' some process else some process
}
I thought, keep object in session and show javascript confirm message. if user click ‘yes’ or no i create hidden input match viewModel’s property and set input value user’s choise. then submit form automatcally.
but i thought again, it’s way not good. What is the bestpractice for?
What u have thought about javascript is quite right. JS is the best practise for this type of scenario. It will add some attraction to ur page. Though u can do this from C# itself by putting a ‘visible’ property true/false when a event would be triggered.