Always openes a new page [Resolved]

Posted by Vuyiswamb under ASP.NET on 5/13/2015 | Points: 10 | Views : 1078 | Status : [Member] [MVP] [Administrator] | Replies : 2
Hi Guys

i am opening a popup(asp.net) from a classic asp application like this

 openModalWindow("http://localhost/ImportExport/Property_Addresss.aspx?parValuationID=" + ValuationId + "&Userid=" + '<%=Session("USER_ID")%>' , 'Property Address Edit', 600, 500);


and all my parameters are passed nicely and there is no problem the asp.net application gets opened and my asp.net page has the following html


  

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Property_Addresss.aspx.cs" Inherits="ImportExport.Property_Addresss" %>

<!DOCTYPE html>


<form id="form1" runat="server" target="_self">
<div>
<table border="1" width="100%" class="table">
<!--NAVIGATION BUTTONS-->
<tr class="Notes">
<td colspan="2">
EDIT PROPERTY ADDRESS</td>
</tr>
<tr class="Notes">
<td>
&nbsp;</td>
<td>&nbsp;</td>
</tr>
<!--end OF NAVIGATION BUTTONS-->
<tr class="Notes">
<td>
<p align="right"><b>PROPERTY KEY</b></p></td>
<td>&nbsp;<asp:TextBox runat="server" id="txtpropertykey" class="Number" name="txtpropertykey" size="13" tabindex="55" type="text" Enabled="False" ReadOnly="True" /></td>
</tr>
<tr class="Notes">
<td>
<p align="right">
<b>ADDRESS 1</b></p></td>
<td>
<asp:TextBox runat="server" id="txtADDRESS1" cols="36" name="txtaddress1" rows="3" tabindex="61"></asp:TextBox></td>


</tr>
<tr class="Notes">
<td>
<p align="right">
<b>ADDRESS 2</b></p></td>
<td>
<asp:TextBox runat="server" id="txtaddress2" cols="36" name="txtaddress2" rows="3" tabindex="61"></asp:TextBox></td>
</tr>

<tr class="Notes">
<td>

&nbsp;</td>
<td>
<asp:Button runat="server" ID="btnEdit" class="button" Text="SAVE & CLOSE" style="float: left" OnClick="btnEdit_Click" /></td>


</tr>
<tr class="Notes">
<td>

&nbsp;</td>
<td>
<asp:Label ID="lblerror" runat="server" style="font-weight: 700; color: #FF3300" ></asp:Label>
</td>


</tr>
</table>
</div>
</form>
</body>
</html>


now when i click the Button "btnEdit " this fires a Postback and save the data in the DB but this opens another Page separately

Can

Thank you for posting at Dotnetfunda
[Administrator]



Responses

Posted by: Vuyiswamb on: 5/14/2015 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down

Resolved
to resolve this , i have wrapped the code with an UpdatePanel and used the button as a trigger and it will working nicely now.

Thank you for posting at Dotnetfunda
[Administrator]

Vuyiswamb, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sheonarayan on: 5/13/2015 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
Seems like openModalWindow function has something to do with it. Are you using window.open to open the popup?

See how to use window.open herehttp://www.dotnetfunda.com/forums/show/6934/open-a-new-page-in-new-tabwindow-using-link-button

Also remove the target attribute from the <form> tag.

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Vuyiswamb, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response