I have two pages.
The parent: /Main/Home.aspx
The child modal: /Main/MoveJob.aspx
The modal window is a simple form with a Submit button. The parent opens modal window. When the modal window’s submit button is pressed, the browsers URL is incorrectly redirected to the modal window’s URL.
Parent’s Code is as follows:
<!-- Define the HTML table, with rows, columns, and data -->
<
table
class
=
"jobsGrid"
>
<
thead
>
<
tr
>
<
th
data-field
=
"title"
>Job #</
th
>
<
th
data-field
=
"Type"
>Type of Project</
th
>
<
th
data-field
=
"Desc"
>Description</
th
>
<
th
data-field
=
"Brand"
>Brand</
th
>
<
th
data-field
=
"Milestone"
>Next Milestone</
th
>
<
th
data-field
=
"Location"
>Job Location</
th
>
<
th
data-field
=
"Sub"
>Submitter</
th
>
<
th
data-field
=
"move"
></
th
>
</
tr
>
</
thead
>
<
tbody
>
<
asp:Repeater
ID
=
"Repeater1"
runat
=
"server"
>
<
ItemTemplate
>
<
tr
>
<
td
><%# Eval("JobID")%></
td
>
<
td
><%# Eval("JobTypeName")%></
td
>
<
td
><
a
href
=
"#"
><%# Eval("JobName")%></
a
></
td
>
<
td
><%# Eval("BrandName")%></
td
>
<
td
>coming soon</
td
>
<
td
><%# Eval("LocationName")%></
td
>
<
td
><%# Eval("SubmitterName")%></
td
>
<
td
><
a
href
=
"javaScript:;"
data-url
=
"../Main/MoveJob.aspx"
title
=
"Move Job"
class
=
"moveLink"
data-id
=
"<%# Eval("
JobID")%>">Move</
a
></
td
>
</
tr
>
</
ItemTemplate
>
</
asp:Repeater
>
</
tbody
>
</
table
>
<
div
class
=
"moveWindow"
>
</
div
>
<
script
type
=
"text/javascript"
>
function refreshGrid() {
//alert("I will try to refresh the grid");
var grid = $(".jobsGrid").data("kendoGrid");
grid.refresh();
}
//MOVE WINDOW
$(document).ready(function () {
$(".jobsGrid").kendoGrid();
$(".moveLink").click(function () {
var id = $(this).data("id");
var href = $(this).data("url") + "?jobId=" + id;
var title = $(this).attr("title");
var myWin = $(".moveWindow");
if (!myWin.data("kendoWindow")) {
// window not yet initialized
myWin.kendoWindow({
width: "auto",
height: "auto",
modal: true,
resizable: true,
title: title,
content: href
});
} else {
// reopening window
myWin.data("kendoWindow")
.content("Loading...") // add loading message
.center()
.refresh(href) // request the URL via AJAX
.open(); // open the window
}
return false;
});
});
</
script
>