[CLOSED] Using ~ In Urls

  1. #1

    [CLOSED] Using ~ In Urls

    Hello,

    Can you advise me on how is best to handle using ~ in Url properties?


    I notice that some Url properties in the Coolite source also have an UrlProxy which is actually used, and makes use of ResolveUrl allowing the use of ~/.


    I am wanting to do the same with HttpProxy for Stores but cannot get it to work. I can't specify "/myurl" because the website may be in a Virtual Directory and I don't want to use "myurl".


    Thanks,
    Richard


    Edit: I should say i'm using an MVC app and so could use <% Html.ActionLink() %> to insert my links but im not quite sure how i should do this.
  2. #2

    RE: [CLOSED] Using ~ In Urls

    Does the following work for you...

    Example


    Url='<% Html.ActionLink() %>' AutoDataBind="true"

    Geoffrey McGill
    Founder
  3. #3

    RE: [CLOSED] Using ~ In Urls

    Nope.

    Here is my sample:


    <ext:HttpProxy Url='<% Html.ActionLink(new { controller = "Jobs", action = "Data" }) %>' AutoDataBind="true" Method="GET" />

    which outputs this in the page:


    proxy:new Ext.data.HttpProxy({url:"<% Html.ActionLink(new { controller = \"Jobs\", action = \"Data\" }) %>",method:"GET"})
  4. #4

    RE: [CLOSED] Using ~ In Urls

    A further update:

    If I do:


    <ext:HttpProxy Url='<%# Url.OpsDataStore() %>' AutoDataBind="true" Method="GET" />

    Which is basically an extension function to UrlHelper then no Url is put into the ext proxy object on the page:


    proxy:new Ext.data.HttpProxy({method:"GET"})

    This is how I have been doing databindings with ext:HiddenField components (<%# instead of <%).


  5. #5

    RE: [CLOSED] Using ~ In Urls

    Hi,

    I confirm that under ASP.MVC the AutoDataBind is not work. Not sure why. We will investigate it. At this moment I can suggest to set required properties at code-behind. We will try to fix it soon
  6. #6

    RE: [CLOSED] Using ~ In Urls

    Thank you for the reply. Do you have any hints as to where the problem may lie such that I could do some debugging myself?

    We are planning to release our software within the next few weeks and so it is critical that I can get this working. Unfortunately I cannot set the paths in code-behind because depending on different install locations at different customers the Urls will be different.
  7. #7

    RE: [CLOSED] Using ~ In Urls

    Hi,

    I am not sure where the problem yet. In usual ASP.NET application all works fine.

    Why you can't set property in code-behind? Just set value depends from current user, use the same function which you try in <%# block

      protected void Page_Load(object sender, EventArgs e)
      {
            ((HttpProxy)Store1.Proxy[0]).Url = Url.OpsDataStore();
      }
  8. #8

    RE: [CLOSED] Using ~ In Urls

    Ah yes my fault sorry - I was thinking code-behind as in the markup for some reason. I will try your suggestion and let you know how that goes.
  9. #9

    RE: [CLOSED] Using ~ In Urls

    I can confirm that that solution works in the interim.

    Thank you.

Similar Threads

  1. Replies: 5
    Last Post: Jul 25, 2011, 6:14 PM
  2. [CLOSED] Resolving ASP.NET urls
    By Justin_Wignall in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 20, 2009, 5:18 AM

Posting Permissions