Reload Window from Controller

2 posts, 1 answers
  1. Bob
    Bob avatar
    1 posts
    Member since:
    May 2015

    Posted 06 May 2015 Link to this post


     I am new to Telerik's MVC controls and also to Jquery in general.  I am trying to build a wizard like interface for the attached screen shot using the Telerik window.  I can get the first step to load, but when click either of the buttons to load the new view for step 2, nothing happens.  The controller fires correctly.    It seems like I need to somehow refresh or reload the Telerik window, but I am not sure how to to do this.  Any help would be much appreciated.



        ViewBag.Title = "AddCampaignStep1";
        Layout = "~/Views/Shared/_LayoutModal.cshtml";
        <script type="text/javascript">
            function SaveandExit() {
                var itemId = $('#btnSaveandExit').attr('itemid');
                var url = '@Url.Action("AddCampaignStep1", "AgencyCampaign")';
              var data = { Id:itemId };
              $.post(url, data, function (result) {
                  var id = '#postedFor' + postId;
            function SaveandContinue() {
                var itemId = $('#btnSaveandContinue').attr('itemid');
                var url = '@Url.Action("AddCampaignStep1", "AgencyCampaign")';
                var data = { Id: itemId };
                $.post(url, data, function (result) {
                    var id = '#postedFor' + postId;
    @using (Html.BeginForm())
        <h4 class="modal-title" id="addCampaignModalLabel">Add New Campaign</h4>
            <div class="center">
                <img src="~/Content/img/progress-add_campaign-step1.png">
                <div class="form-group">
                    <label for="inputCampaingName" class="control-label">Campaign Name:</label>
                    <input type="text" name="inputCampaingName" id="inputCampaingName" class="form-control" value="">
                <div class="checkbox">
                        <input type="checkbox" name="inputCampaingEndsNotification" id="inputCampaingEndsNotification"> Email me when campaign ends
        <input id="btnSaveandExit" itemid="0" type="button" onclick="SaveandExit()" class="btn btn-default" value="Save and Exit"/>
        <input id="btnSaveandContinue" itemid="1" type="button" onclick="SaveandContinue()" class="btn btn-primary modal-btn" value="Save and Continue" />


    public ActionResult AddCampaignStep1(int id)
           return View("AddCampaignStep2");   //this line fires with the correct id

  2. Answer
    Alex Gyoshev
    Alex Gyoshev avatar
    2515 posts

    Posted 08 May 2015 Link to this post

    Hello Bob,

    You can call the window refresh method to refresh its content. This will trigger a request to the partial view that the window shows. If this is not what you need, please elaborate.

    Alex Gyoshev

    See What's Next in App Development. Register for TelerikNEXT.

Back to Top