SOLVED

ERR_CACHE_MISS error

Iron Contributor

I have Sharepoint 2019 with Kerberos enabled.

On project detail page I add my custom web part which redirect to Power BI report (with Kerberos).

From: https://myserver.mydomain/PWA/Project%20Detail%20Pages/Reports.aspx?ProjUid=aaaaea84-3862-ec11-82f3-...

To: 

https://myreport.mydomain/Reportserver?/report1&ProjUid=aaaaea84-3862-ec11-82f3-005056b4315a

If I come to PDP page with click on it, all work fine - I can press Back from Power BI, and I return to Sharepoint PDP. BUT - If I navigate to PDP page from /PWA/Projects.aspx second time, I have error  ERR_CACHE_MISS if I click Back in redirected Power BI report.

What can I do to prevent this error?

My code is:

public partial class DynTilesWPUserControl : UserControl
{

protected void Page_Load(object sender, EventArgs e)
{
string ProjUid = string.Empty;
try { ProjUid = Request.QueryString["ProjUid"].ToString(); } catch { }
ImageButton img = new ImageButton();
string redirect = string.Empty;
img.ID = "imgb1";
img.ImageUrl = "../../_layouts/15/Images/DYN_TILES/report01.png";
string reportBaseURL = @"https://myreport.mydomain/Reportserver?";
redirect = reportBaseURL + "/report&ProjUid=" + ProjUid;
img.Click += new ImageClickEventHandler((a, b) => Img_Click(a, b, redirect));
pnlMain.Controls.Add(img);
}

private void Img_Click(object sender, ImageClickEventArgs e, string redirect)
{
SPSecurity.RunWithElevatedPrivileges(delegate
{
Response.Redirect(redirect, false);
});
}

Plus some addition:

If I open PDP by click on it the address is (all lower case):

https://myserver.mydomain/pwa/project%20detail%20pages/reports.aspx?projuid=aaaaea84-3862-ec11-82f3-...

But if I open this page second time from /PWA/Projects.aspx

the address is:

https://myserver.mydomain/PWA/Project%20Detail%20Pages/Reports.aspx?ProjUid=aaaaea84-3862-ec11-82f3-....

1 Reply
best response confirmed by Vasily_Zaytsev (Iron Contributor)
Solution

I found solution for this problem, BUT is it sharepoint 2019 bug?
THE SOLUTION:)
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (HttpContext.Current.Request.Url.ToString()!= HttpContext.Current.Request.Url.ToString().ToLower())
{
Response.Redirect(HttpContext.Current.Request.Url.ToString().ToLower(),false);
}
}

1 best response

Accepted Solutions
best response confirmed by Vasily_Zaytsev (Iron Contributor)
Solution

I found solution for this problem, BUT is it sharepoint 2019 bug?
THE SOLUTION:)
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (HttpContext.Current.Request.Url.ToString()!= HttpContext.Current.Request.Url.ToString().ToLower())
{
Response.Redirect(HttpContext.Current.Request.Url.ToString().ToLower(),false);
}
}

View solution in original post