passing id using@url.Action
-
i have a listing page liststd view which displays all standards when i click on any standard it redirects to section view in section view i have a @url.Action to add new Section. A new gets opened but i need standard when the section view get opened so that when saving i can save both standard and section
-
i have a listing page liststd view which displays all standards when i click on any standard it redirects to section view in section view i have a @url.Action to add new Section. A new gets opened but i need standard when the section view get opened so that when saving i can save both standard and section
You've got a few options. The one I'd suggest is a navigation property in the section that references the standard; unless you're explicitly sharing an individual section across many standards that would be the best route IMO. Another option would be to put the standard ID into the ViewBag and pass that to your section edit view. I like that one less, as it potentially poses issues on refresh, deep linking, etc. Plus it's pushing DAL logic to the View, which is less than awesome.
"There are three kinds of lies: lies, damned lies and statistics." - Benjamin Disraeli