R
R
Romanchitoz2019-05-06 13:22:47
.NET
Romanchitoz, 2019-05-06 13:22:47

How to autoload a partial view on a page?

@{
ViewBag.Title = "AdminPanel";
}

Admin Panel

<div>
    @using (Ajax.BeginForm("Groups", new AjaxOptions { UpdateTargetId = "results" , LoadingElementId = "loading" }))
    {
        <input type="submit" class="btn btn-default" value="Groups" />
        
    }

</div>
   
    <div id="results">

    </div>

    <div id="loading" style="display:none; color:green; position:center; font-weight:bold;">
        <p>Идет загрузка данных, ожидайте...</p>
    </div>
</div>


in the view, I made the loading of the partial view on button click, but how can I make the partial view load automatically when the page is refreshed?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question