asp.net file upload and refresh with the ASP.net page and the data transmission between the IFRAME _ practical skills

Source: Internet
Author: User
Specific how we implement the file asynchronous refresh, the current online has a lot of articles to solve this problem, but will use a lot of JavaScript, because I am still light coding skills, so there is no HD of the reason why, but in the solution they seem to have used the IFRAME, This gives me an epiphany, so I'm going to talk about using this as a way to refresh.

First of all, a real page is often more content, we temporarily divided it into a, b two areas, a region is the content area, we can use UpdatePanel to achieve asynchronous refresh, b area is the upload area, we use Div has ifame occupy, Which upload the specific function of the implementation we can put into the C page, so when the click of the button to refresh the B area, we can send a value to the C page to update the contents, but also when we click the button to delete or save the content, you can get the content of the C page, so basically satisfied with no refreshing feeling.


In fact, this way is not called asynchronous refresh, because we only use the IFRAME to achieve a partial refresh of the page to meet a sense of no refresh.


If this process, ASP.net page and iframe between the value will become another problem, in fact, this problem if you know, it will be relatively simple, but do not know, it is a bit out of the question.
There may also be a lot of program handling values on the Web, and I'm using JavaScript to get the controls to fetch the values they contain.


This is to get the IFRAME F1, and the IMG control in page C
var objframe = document.getElementById ("F1");
var objpicture = objFrame.contentWindow.document.getElementById ("Imgpicture");

Of course you can also get the control of the parent page in page C to get the value
var Objhid = this.parent.document.getElementById ("")


This is a div containing ifrmae.
<div id= "Iconpicture" >
<iframe id= "F1" style= "width:300px; height:300px "src=" uploadimage.aspx "scrolling=" no "
Frameborder= "0" border= "0" frameborder= "no" ></iframe>
</div>


This implementation I have successfully used in the project, in fact, if the main difficulty is no longer the implementation of specific functions, but the layout of the page in the browser under the adaptation. Of course, the JavaScript I provide is for multiple browsers.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.