Greetings,
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.
View
@{
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;
$(id).html(result);
});
}
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;
$(id).html(result);
});
}
</
script
>
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<
h4
class
=
"modal-title"
id
=
"addCampaignModalLabel"
>Add New Campaign</
h4
>
<
div
class
=
"center"
>
<
img
src
=
"~/Content/img/progress-add_campaign-step1.png"
>
</
div
>
<
fieldset
>
<
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
>
<
div
class
=
"checkbox"
>
<
label
>
<
input
type
=
"checkbox"
name
=
"inputCampaingEndsNotification"
id
=
"inputCampaingEndsNotification"
> Email me when campaign ends
</
label
>
</
div
>
</
fieldset
>
<
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"
/>
}
Controller
public
ActionResult AddCampaignStep1(
int
id)
{
return
View(
"AddCampaignStep2"
);
//this line fires with the correct id
}