asp.net mvc - MVC invoking default page when opening a different page? -


I have a simple MVC (RC1) app set up, and I see some strange behavior. The Home / Index page list shows a list of items using the view. Here is the Home Controller Code:

  View the Function Index () Data ("result") = In context from m My Table Return View () End Function  

There is only one listview on the Home / Index.aspx page, and the code behind it is:

  Private sub page_load (same object as the object, IV.V. MyListView.DataSource = ViewData ("Result") as the system MyListView.DataBind () End Sub  

Home / Index It works fine while navigating on. However, I have found another scene and the controller is called the form. Here's the FormController:

  Function Index () Return View () and Function  

No code behind the form / index.spacks - Again, just one stub.

I see the problem is that when I try to navigate to the form / index, then "I do not have an object reference set for an object instance . "Why is it so behind the code behind home / index.aspx.vb? I have to navigate away from that page Trying - Why is this code running behind? If I wrap the code like this:

  If the data is not ("result"), then MyListView.DataSource = ViewData ("Result") MyListView.DataBind () End if  

Everything works correctly, but it does not seem that I should have done something, I'm missing something ?

Update: For the request, here form / index. The contents of Espacks are:

  & lt;% @ page title = "" language = "vb" masterpagesfile = "~ / view / share / site.master" auto eventWireUp = "false" codebahind = "Index.exx.vb" inheritance = "provider feedback. Index"%> & Lt; Asp: Content ID = "Content1" content placeholder id = "main content" run = "server" & gt; & Lt; H3 & gt; Enter provider feedback & lt; / H3 & gt; & Lt; Form method = "post" action = "/ form / createNew" & gt; & Lt;% = Html.TextBox ("Member")%> & Lt; Input type = "submit" value = "submit" /> & Lt; / Form & gt; & Lt; / ASP: Content & gt;  

Is that correct?

  Inheritance = "ProviderFeedback.Index"  

This form should not be. Indexes?


Comments