title: How can I save the data when I return to my action and retrieve it?
body: <p>I have a class and create an instance and fill a property in my index but when I push the submit button in my view and return again to my index action the property of my class is null.</p>
  
  <p>How can I save the data when I return to my action and retrieve it? Is it possible?</p>
  
  <p>I used <code>viewbag</code> and <code>viewdata</code> in my index and fill theme but when returned to index action again all of theme were null :(</p>
  
  <pre><code>public class myclass
  {
      public string tp { get; set; }
  }
  
  public class HomeController : Controller
  {
      //
      // GET: /Home/
      myclass myc = new myclass();
      public ActionResult Index()
      {
          myc.tp = "abc";
          return View(myc);
      }
  }
  </code></pre>
  
  <p>View:</p>
  
  <pre><code> @model MvcApplication2.Controllers.myclass
   @{
    Layout = null;
    }
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
   &lt;head&gt;
       &lt;title&gt;Index&lt;/title&gt;
   &lt;/head&gt;
   &lt;body&gt;
  
       @using (Html.BeginForm())
       {
          &lt;input id="Submit1" type="submit" value="submit" /&gt;
       }
  
   &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>