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.