I have a form which redirects to a new page index.aspx after posting .However instead of opening the new page in a new window,I would like to open it as an ifra开发者_运维技巧me so that it remains in the current window
How do I go about that. The current code is :
<form id="Form2" action="index.aspx" method="post" name="Form2" >
.....
<input type="image" style="border-width: 0px;" src="images/form_ordernow_btn.jpg"
tabindex="129" id="Form1_ImageButton1" name="Form1$ImageButton1" >
I am using asp.net by the way
Put the form into the iframe already. So the postback will open in the same iframe...
@Edit: if the form must be on the same page but cannot be in the iframe at the time of posting, the following solution may work:
- postback to the same(!) page
- insert the iframe into the page on the server
- give the iframe an url according to the postdata i.e. change POST -> GET data
- construct the target page (index.aspx) that way to handle the GET parameters
精彩评论