Validation Control, WebResourse.axd and not writing a custom httphandler :)

Last post 05-08-2008 2:48 PM by dima7g. 2 replies.

Sort Posts:

  • Validation Control, WebResourse.axd and not writing a custom httphandler :)

    05-02-2008, 5:02 AM
    • Loading...
    • dima7g
    • Joined on 05-02-2008, 4:46 AM
    • Posts 2
     Hi guys,

     Please help with the following question, which I hope to resolve without significant overhead coding :)

    Here's the thing... APS.NET 2.0 adds a script link to WebResource.axd for its validation controls. This is fine in most cases, but in my case it breaks something...

    What's getting rendered is something like this:

    <script type="text/javascript" src="/WebResource.axd?d=tdUW58k95YwCRfXXR7kcbKlJRha30AUy_DuBO1JUE_E1&t=633411363624561351/>
    
    but this breaks in my case because I need an absolute path, not relative... (this is for a Facebook app in case you're wondering)...
     
    So, what I really need is to add a tilde (~) like this:

    <script type="text/javascript" src="~/WebResource.axd?d=tdUW58k95YwCRfXXR7kcbKlJRha30AUy_DuBO1JUE_E1&t=633411363624561351/>

    ------------------------------------^

     

    Any easy way to make it happen?

  • Re: Validation Control, WebResourse.axd and not writing a custom httphandler :)

    05-08-2008, 3:55 AM

    Hi dima7g,

    You can append HTTP_HOST to the src Url using Request.ServerVariables["HTTP_HOST"].

     

    Zhao Ji Ma
    Sincerely,
    Microsoft Online Community Support

    “Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
  • Re: Validation Control, WebResourse.axd and not writing a custom httphandler :)

    05-08-2008, 2:48 PM
    • Loading...
    • dima7g
    • Joined on 05-02-2008, 4:46 AM
    • Posts 2

    Zhao, I'm not sure I understand.... I am not producing this url - it's produced by ASP.NET as part of the validation control.  How can I append anything to what the validation control is producing?

Page 1 of 1 (3 items)
Microsoft Communities
Page view counter