title: mvc going from one view to another
body: <p>i would like to know how can we go from one view to another on a button click
  here is what i did
  my first view</p>
  
  <pre><code>@model mymvc.Models.TestModel
  @{
      ViewBag.Title = "review";
  }
  
                  @Html.DropDownList("Dataid")
  </code></pre>
  
  <p>my second view</p>
  
  <pre><code>@model mymvc.Models.TestModel
  @{
      ViewBag.Title = "Index";
  }
  
  
  
  &lt;hgroup class="title"&gt;
      &lt;h1&gt;@ViewBag.Title.&lt;/h1&gt;
  &lt;/hgroup&gt;
  
  &lt;section id="userform"&gt;
  
  @using (Html.BeginForm(new { ReturnUrl = ViewBag.ReturnUrl })) {
      @Html.AntiForgeryToken()
      @Html.ValidationSummary(true)
  
      &lt;fieldset&gt;
          &lt;legend&gt;User Entry Form&lt;/legend&gt;
          &lt;ol&gt;
              &lt;li&gt;
                  @Html.LabelFor(m =&gt; m.Name)
                  @Html.TextBoxFor(m =&gt; m.Name)
                  @Html.ValidationMessageFor(m =&gt; m.Name)
              &lt;/li&gt;
              &lt;li&gt;
                  @Html.LabelFor(m =&gt; m.Emailid)
                  @Html.TextBoxFor(m =&gt; m.Emailid)
                  @Html.ValidationMessageFor(m =&gt; m.Emailid)
              &lt;/li&gt;
  
  
          &lt;/ol&gt;
          &lt;input type="submit" value="Save" /&gt;
  
      &lt;/fieldset&gt;
  
  }
  &lt;/section&gt;
  
  @section Scripts {
      @Scripts.Render("~/bundles/jqueryval")
  }
  </code></pre>
  
  <p>my controller</p>
  
  <pre><code> public class TestController : Controller
      {
  
  
          TestDBContext db = new TestDBContext();
          [HttpGet]
          public ActionResult Index()
          {
              return View();
          }
          [HttpPost]
          public ActionResult Index(TestModel test)
          {
              if (ModelState.IsValid)
              {
                  db.Name = test.Name;
                  db.Emailid = test.Emailid;
                  db.TestModels.Add(test);
                  db.SaveChanges();
  
              }
              return RedirectToAction("review", "Test");
  
  
          }
  
  
  
          public ActionResult review(TestModel test)
          {
              TestModel testmodel = new TestModel();
  
             IEnumerable&lt;SelectListItem&gt; Drp_Names =db.TestModels.Select(x =&gt; new SelectListItem
              {
                  Value = x.Dataid.ToString(),
                  Text = x.Emailid
              });
             ViewBag.Dataid = Drp_Names;
             return View(testmodel);
  
          }
  
      }
  }
  </code></pre>
  
  <p>my model</p>
  
  <pre><code>public class TestModel
      {
          [Key]
          public int Dataid { get; set; }
          public string Name { get; set; }
          public string Emailid { get; set; }
          public int Flag { get; set; }
  
          public IEnumerable&lt;SelectListItem&gt; Drp_Names { get; set; }
      }
      public class TestDBContext : DbContext
      {
          public TestDBContext()
              : base("TestDBContext")
          {
          }
          public DbSet&lt;TestModel&gt; TestModels { get; set; }
          [Key]
          public int Dataid { get; set; }
          public string Name { get; set; }
          public string Emailid { get; set; }
          public int Flag { get; set; }
      }
  </code></pre>
  
  <p>when i click on save i want to save the data and i want it take me to another view to show me the loaded drop down 
  can any body help me out</p>