Click here to Skip to main content
14,208,886 members
Rate this:
 
Please Sign up or sign in to vote.
See more:
Hello friends,

I am having a problem that I want to run some code inside mvc view only when controller return at least one row, mean is should not empty. How can i check this?
Im using custom form in my view.

Can i check this.mvc
Posted
Updated 31-May-10 20:14pm
v2
Comments
Sandeep Mewara 1-Jun-10 2:21am
   
Please post some code here. Someone maybe able to help you.

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

can't you check the result and only call the view if you need to otherwise call another view such as

if ( rowcount >= 1) {
return view();
}
else {
RedirectToAction("index");
}
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Cookies | Terms of Service
Web05 | 2.8.190612.1 | Last Updated 2 Jun 2010
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100