The process of building custom applications and tools that interact with Microsoft SharePoint, including SharePoint Online in Microsoft 365.
Failed getting current site subscription id using context uri: in sharepoint while try to redirect to new page
Failed getting current site subscription id using context uri: in sharepoint while try to redirect to new page
I have an Excel button designed to download an Excel template. When I click the button, it generates the Excel file and redirects to a new page for the download. While this functionality works seamlessly on my testing server, upon deploying to the production server, an error occurs with the message: 'Failed getting the current site subscription ID using context URI.
string _navURL = SPContext.Current.Site.Url + "/_layouts/15/Provider/ShowExcel.aspx?_fileName=" + _filename;
string _navURL = SPContext.Current.Site.Url + "/_layouts/15/Provider/ShowExcel.aspx?_fileName=" + _filename;
string _script = "<script type='text/javascript'>\n" + "window.open('" + _navURL + "');\n" + "</script>\n";
Page.ClientScript.RegisterStartupScript(this.GetType(), "redirect", _script, false);
Microsoft 365 and Office | SharePoint | Development
Microsoft 365 and Office | SharePoint | For business | Windows
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.