Ext.Coolite.ThisUrl

  1. #1

    Ext.Coolite.ThisUrl

    Hello,

    Can we get a new optional property added to the Ext:ScriptManager*to override the default generation of the Ext.Coolite.ThisUrl appended to the client script? *You are currently setting the value to the result of*HttpContext.Current.Request.Url*but this does not work welll when you have a URL rewriter in the way :)


    Example:
    
    
    public void Page_Load(object sender, EventArgs e)
    {
    ** *ScriptManager.ThisUrl = "http://www.google.com";
    }

    Cheers,
    Timothy
  2. #2

    RE: Ext.Coolite.ThisUrl

    Hi Timothy,
    How do you want to use the ThisUrl? Now the ThisUrl is used only if no form on Page. Do you have such pages or you want to use ThisUrl in own custom javascript code?

  3. #3

    RE: Ext.Coolite.ThisUrl

    Hmm, from what I've seen Ext.Coolite.ThisUrl is always rendered regardless if a form is available or not.

    I would just like to be able to have a property exposed on the Ext:ScriptManager so I can feed in my own URL rather than the default HttpContext.Current.Request.Url which is currently always getting generated -- it is not a URL rewrite safe value ;)

    Thanks vladimir!

    Cheers,
    Timothy
  4. #4

    RE: Ext.Coolite.ThisUrl




    I second this request. I'm using URL rewriting to deliberately hide the aspx page. I can confirm that at least in 0.6.0, it's always written (irregardless if there's a form or not).
  5. #5

    RE: Ext.Coolite.ThisUrl

    Hello davidhoyt,

    Use the following, make your page inherit from this class instead of System.Web.UI.Page

        public class MyPage : System.Web.UI.Page
        {
            protected override void Render(HtmlTextWriter writer)
            {
                using (StringWriter temp = new StringWriter())
                {
                    using (HtmlTextWriter buffer = new HtmlTextWriter(temp))
                    {
                        base.Render(buffer);
    
                        String result = temp.ToString();
    
                        string thisUrl = String.Format(@"{0}://{1}{2}",
                            Request.Url.Scheme,
                            Request.Url.Host,
                            Request.RawUrl);
    
                        result = Regex.Replace(result,
                            @"Coolite.Ext.ThisUrl='.*?';",
                            String.Format(@"Coolite.Ext.ThisUrl='{0}';",
                                thisUrl
                            )
                        );
                        writer.Write(result);
                    }
                }
            }
        }
    Cheers,
    Timothy
  6. #6

    RE: Ext.Coolite.ThisUrl

    Let me know if you need any help with using url rewriting and Microsoft AJAX. I've got a good (simple solution) :)

    Cheers,
    Timothy
  7. #7

    RE: Ext.Coolite.ThisUrl

    I'm looking into a new solution for the*ScriptManager.ThisUrl property. We will be making some changes.*

    Geoffrey McGill
    Founder
  8. #8

    RE: Ext.Coolite.ThisUrl



    Thanks for your solution, Timothy, but I wouldn't recommend doing that since it's buffering the entire page in memory before doing the search and replace. There are cases where it wouldn't work properly and I'm sure you can see why buffering a large page for every request could be problematic. The correct solution is for the Coolite folks to make it adjustable.

    I suppose that begs the question - could you make that property themeable?
  9. #9

    RE: Ext.Coolite.ThisUrl

    My suggestion was only a work around until Coolite changes the functionality. If your page size is a major concern until they change the functionality, here are some suggestions:

    1. Reduce the size of your page; if it's too large for your server to buffer it's going to be too large for your client to swallow

    2. Use my suggestion to override the Page.Form control and override its internal rendering routines to focus the buffering specifically on the Form control

    Timothy

Similar Threads

  1. Using Coolite GridPanel without Coolite Store
    By r_honey in forum 1.x Help
    Replies: 6
    Last Post: Jan 20, 2009, 7:07 AM
  2. [CLOSED] help files for coolite? (extjs verses coolite)
    By pkellner in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 25, 2008, 12:19 PM

Posting Permissions