1

on my jquery file in MVC application I need to render the user control in the header when user clicks button in that page . At the same time I need to pass parameters to partial view using jquery. Code sample given below.

<html lang="en" <% = ClientStyle.GetMicrodataNamespaces() %>>
    <% Html.RenderPartial("Slideshows/Head"); %>

    <body class="ss-msnbc">
        <div id="header">
            <div class="container">
                <% Html.RenderPartial("Slideshows/Logo"); %>
                <div id="slideshow-title">
                    <h2><%=Model.Title%></h2>
                </div>
                <ul id="tabs">
                    <% Html.RenderPartialForEach("Slideshows/TabNavigator", Model.TabNavigators); %>
                </ul>
            </div>
        </div>
        <div id="bantop">
            <div class="container">
                <div id="slide-nav">
                    <ul id="next-prev">                
                        **<li class="btn prev-dis"><a id="prevslide" href="#" title="Previous">&nbsp;</a></li>
                        <li class="btn next-dis"><a id="nextslide" href="#" title="Next">&nbsp;</a></li>**
                    </ul>
                    <% foreach(var slideNavigator in Model.SlideNavigators) { %>
                        <ul class="slide-numbers" style="display:none;" id="navigator_<%=slideNavigator.TabIndex%>">
                            <% Html.RenderPartial("Slideshows/SlideNavigator", slideNavigator); %>
                        </ul>
                    <% } %>
                </div>
                    <% Html.RenderPartial("Slideshows/RelatedLinks", Model); %>
            </div>
        </div>
</body>
<html>

If I click the Prevslide button, it should render the slideshows\Head user control.This has to be implemented in Jquery.

1 Answer 1

1

You can use JQuery get,

$.get('controler/action',{parameter1:value1,parameter2:value2},function(data){
 $('#header').html(data);
});

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.