+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Telerik.Sitefinity.Web.UI.PublicControls.JavaScriptEmbedControl

Telerik.Sitefinity.Web.UI.PublicControls.JavaScriptEmbedControl

2 posts, 1 answered
  1. Simone
    Simone avatar
    7 posts
    Registered:
    17 Sep 2014
    17 Sep 2014
    Link to this post

    I have a Sitefinity site that is redirecting to another URL every time a document is not found:
    http://mysite.com/lalala.html --> It redirects to: http://newlocation.mysite.com/lallala.html

    I did a grep in the hard drive and found a Windows temporary cs file that had a reference to the javascript that could be the cause. 

    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\b5c90cf0\69e2fa94\App_Web_96913ee9-5f2f-42c0-986f-7dddeb5cddf6_31_basic.aspx.d63928b6.uuws8j2x.0.cs 

    I am afraid this was embedded in the Sitefinity dll and I cannot find where this javascript is.

    I pasted part of the code,  can someone point to me where in the Sitefinity website I can go to change this script, or anywhere I could find this at all?

    Thanks.

     

        [System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()]
        public class sfpageservice_96913ee9_5f2f_42c0_986f_7dddeb5cddf6_31_basic_aspx : global::System.Web.UI.Page, System.Web.SessionState.IRequiresSessionState, System.Web.IHttpHandler {
            
            
            #line 15 "http://server/SFPageService/96913EE9-5F2F-42C0-986F-7DDDEB5CDDF6_31_Basic.aspx"
            protected global::Telerik.Sitefinity.Web.UI.PublicControls.JavaScriptEmbedControl C002;
            
            #line default
            #line hidden
            
            
            #line 15 "http://server/SFPageService/96913EE9-5F2F-42C0-986F-7DDDEB5CDDF6_31_Basic.aspx"
            protected global::Telerik.Sitefinity.Web.UI.SitefinityPlaceHolder Body;
            
            #line default
            #line hidden
            
            
            #line 14 "http://server/SFPageService/96913EE9-5F2F-42C0-986F-7DDDEB5CDDF6_31_Basic.aspx"
            protected global::System.Web.UI.HtmlControls.HtmlGenericControl PublicWrapper;
            
            #line default
            #line hidden
            
            
            #line 12 "http://server/SFPageService/96913EE9-5F2F-42C0-986F-7DDDEB5CDDF6_31_Basic.aspx"
            protected global::System.Web.UI.HtmlControls.HtmlForm aspnetForm;

     

     

     .....

     

     

     

             [System.Diagnostics.DebuggerNonUserCodeAttribute()]
            private global::Telerik.Sitefinity.Web.UI.PublicControls.JavaScriptEmbedControl @__BuildControlC002() {
                global::Telerik.Sitefinity.Web.UI.PublicControls.JavaScriptEmbedControl @__ctrl;
                
                #line 15 "http://server/SFPageService/96913EE9-5F2F-42C0-986F-7DDDEB5CDDF6_31_Basic.aspx"
                @__ctrl = new global::Telerik.Sitefinity.Web.UI.PublicControls.JavaScriptEmbedControl();
                
                #line default
                #line hidden
                this.C002 = @__ctrl;
                @__ctrl.ApplyStyleSheetSkin(this);
                
                #line 15 "http://server/SFPageService/96913EE9-5F2F-42C0-986F-7DDDEB5CDDF6_31_Basic.aspx"
                @__ctrl.CustomJavaScriptCode = @"function redirect()
    {
      
      var httpURL= ""http://newlocation.mysite.com"" + window.location.pathname + window.location.search;
        var errorIndex =  window.location.search.indexOf(""?aspxerrorpath="")
        if(errorIndex >= 0)
                    httpURL =  ""http://newlocation.mysite.com""  +  window.location.search.substring(window.location.search.substring(errorIndex).indexOf(""="") + 1);                       
        if((window.location.pathname.indexOf(""Action/Edit"") == -1) ||  confirm(""redirecting to "" + httpURL))
                    window.location = httpURL;
        else if(window.location.pathname.indexOf(""Action/Edit"") == -1)
                    window.location = window.location.hostname + ""/404NotFound"";
    }
    redirect();

    ";
                
                #line default
                #line hidden
                
                #line 15 "http://server/SFPageService/96913EE9-5F2F-42C0-986F-7DDDEB5CDDF6_31_Basic.aspx"
                @__ctrl.ID = "C002";
                
                #line default
                #line hidden
                return @__ctrl;
            }


            
     



     

    Answered
  2. Simone
    Simone avatar
    7 posts
    Registered:
    17 Sep 2014
    18 Sep 2014 in reply to Simone
    Link to this post

    I found out the page title (it was embedded in the cs code), and then was able to find the page with the embedded Javascript. Case solved.

2 posts, 1 answered