Data transmission between asp.net file upload and refresh and asp.net page and iframe

Source: Internet
Author: User

How can we implement asynchronous file refresh? At present, there are many articles on the Internet to solve this problem, but a lot of javascript will be used. Due to my low coding skills, so there is no such reason as HD, but iframe seems to be used in the solution, which makes me feel awkward, so I will talk about how to use this method to refresh.

First, an actual page usually contains A large amount of content. For the moment, we divide it into two regions: A and B. The A region is the content region. We can use updatepanel to Implement Asynchronous refresh, area B is the upload area. We use div to have ifame placeholder. The specific upload function can be implemented on the C page. When you click the button to refresh Area B, we can pass a value to Page C to update the content. Similarly, when we click the button to delete or save the content, we can also get the content on Page C, this basically satisfies the feeling of no refresh.


In fact, this method cannot be called asynchronous refresh, because we only use iframe to implement partial page refresh to satisfy the need for refreshing the page.


If this is done, transferring the value between the asp.net page and iframe will become another problem. In fact, if you know this problem, it will be relatively simple, but you do not know it, it will be a little difficult to start.
There may also be a lot of solutions on the Internet to process the value transfer. I use javascript to obtain the control and obtain the value contained in it.


This is to obtain iframe f1 and the img control in Page C.
Var objFrame = document. getElementById ("f1 ");
Var objPicture = objframe.content1_doc ument. 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.doc ument. getElementById ("")


This is the 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 method has been successfully used in the project. In fact, if the main difficulty of this method is no longer the implementation of specific functions, it is because the layout of pages is adapted in multiple browsers. Of course, the javascript I provide is applicable to 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.