FathiAlqadasi FathiAlqadasi -3 years ago 171
ASP.NET (C#) Question

jQuery div dialog open in the same page

I used jQuery div dialog to show new user page as show in picture


But when I press save button the new userpage is opening in the same page as show in the picture



<ul class="menu" style="margin-left:10px; background-color:transparent; width:100%;">
<input type="button" ID="btnNew" value="Add New" style="background-color:transparent; border:0;" runat="server" />


btnNew.Attributes.Add("onClick", "ShowEntityEditor('NewUser.aspx','userID',0,'New User',300,650);")

JavaScript: (placed in the master page)

function ShowEntityEditor(url, pname, entityID, txttitle, h, w) {
var _editWindowDiv;
_editWindowDiv = $("#_editWindowDiv").dialog({
autoOpen: false,
height: h,
width: w,
position: 'center',
title: txttitle
_editWindowDiv.load(url + "?" + pname + "=" + entityID, function () {
$("#cancelButtoon").click(function () {
return false;

Answer Source

in the newUser.aspx page use the following code to prevent the page form being submitted. submit newUser.aspx will close the dialog and redirect to the page.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download