SharePoint - Refresh browser in InfoPath 2010 form

Asked By Ebenezer on 05-Jun-12 10:00 AM
How to Implement  browser refresh in InfoPath 2010 form after reset button is click, something similar like this in asp.net
Page.ClientScript.RegisterStartupScript(this.GetType(), "RefreshPage", "window.location.reload();"); in Infopath 2010
Neha Garg replied to Ebenezer on 05-Jun-12 11:00 AM
Hi....

Use the below javascript to refresh the browser or page of Infopath:

<script language="javascript">
 
function RefreshOnFocus()
 
{
 
   window.location.href = window.location;
 
}
 
  
 
function showInfopathAndRefreshWhenFinished(url)
 
{
 
    window.onfocus = RefreshOnFocus;
 
    editDocumentWithProgID2(url,'InfoPath.Document','SharePoint.OpenXMLDocuments');
 
}
 
</script>
kalpana aparnathi replied to Ebenezer on 05-Jun-12 02:33 PM
hi,

Try with this:

Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "Refreshpage", web.Site.Url));
Ebenezer replied to Neha Garg on 05-Jun-12 02:53 PM
The InfoPath 2010 form is a browser enabled form using VSTA code. Where does the javascript fit, that has been my issue not the script per say. I have nowhere to put the script tag and the script.
Ebenezer replied to kalpana aparnathi on 05-Jun-12 02:55 PM
Hi Kalpana,
The InfoPath2010 form is a browser enabled form using VSTA code, not aspx page. where do I use your code in this regard. Your code needs reference to the System.Web.UI.Page to function