I am just trying to learn MVC and facing some issues.When I am submitting my partial view, I am getting null in Model Blog inside Create Method.
What I
Your class Blog
only contains fields, not properties so the DefaultModelBinder
cannot set their values. Change it add getters/setters
public class Blog
{
public string Name { get; set; }
public string URL { get; set; }
}
Maybe this answer relates to your question: Is there a reason why the default modelbinder doesn't bind to fields?
Pay attention at DefaultModelBinder, ModelBinderContext, ModelMetadata. This explains it all.