Skip to content

Asp.net MVC ReactJs.net : loading Index.cshtml as a Partial View #351

@vgcoder

Description

@vgcoder

Asp.net MVC ReactJs.net : loading Index.cshtml as a Partial View:
HTML loads fine but when I look at chrome developer's tool React tab, nothing loads. looks like react has not initialized properly and that's why react component controls do not show onClick/onChange behavior.
We have MVC website and we want only Data-entry/form submission part to be handled using React.
When I load Index.cshtml as View everything works.
Steps I have already tried:

  1. Using Server Side rendering (Adding jsx file to ReactConfig.cs)
  2. Using Asp.net minification and bundling using babblebundle in BundleConfig.cs.
    I assumed may be issue is that it is not precompiled and serving it using Ajax's $(#div).html('<Index.cshtml>') not able to understand jsx.
    I am using server side rendering for initial load

@Scripts.Render("~/bundles/main")
@Html.React("MyForm", new
{
initialData = Model.Form,
validationUrl = Url.Action("GetValidation"),
submitUrl = Url.Action("SaveForm")
})
Layout.cshtml contains navigation panel/header/footer which are using mix of Jquery/Kendui controls

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions