Results 1 to 4 of 4

Thread: How to do URL rewrite using ScriptManager?

  1. #1
    Join Date
    Jun 2011
    Posts
    109

    How to do URL rewrite using ScriptManager?

    I have set up the URL rewriting also using the WCF service. This service is called by Javascript code, so I am using the Scriptreference parameter of ScriptManager to have javascript entry points created. But my problem is that the scriptreference is not working with URL Rewrite enabled on FireFox and Safari, while it’s working with Internet Explorer and Chrome. Before I was using the scriptreference property to load all scripts in compositescript group but none of the scripts were found.

  2. #2
    Join Date
    May 2009
    Posts
    511

    re: How to do URL rewrite using ScriptManager?

    It seems that you have some problem related to the root path. After putting the correct root path your problem will be solved. Try the following code :
    Code:
    <ajax:ScriptManager ID="scriptManager" runat="server" ScriptPath="/" >
     <Services>
     <ajax:ServiceReference Path="~/Services/ProductService.asmx"/>
     </Services>
     <Scripts>
     <ajax:ScriptReference Path="~/Catalog/Scripts/ProductControl.js"/>
     </Scripts>
    </ajax:ScriptManager>
    After putting this code your, they will they are resolving to the http://localhost/mysite/products/ser...ctservice.asmx

  3. #3
    Join Date
    May 2009
    Posts
    637

    re: How to do URL rewrite using ScriptManager?

    I think you must have note done any code in code behind part. As soon as you will do coding behind, all your Java scripts would be found .No matter what browser you use.
    In Code behind do the following coding:
    Code:
    PageLoad Method.  
    scriptManager.Services.Add("put your dynamic path here");
    scriptManager.Scripts.Add("put the path here");
    After this your actual page will occur with different URL for example URL http://localhost/mysite/product.aspx?id=99 will appear as http://localhost/mysite/products/99.aspx

  4. #4
    Join Date
    May 2009
    Posts
    527

    re: How to do URL rewrite using ScriptManager?

    I think you should try moving the script out of the script manager. You can do this by calling Javascripts via “script” tag. This will solve the problem. By moving out the script from script manager will help you to easy path. Also specify the scriptreference parameter via codebehind in the PageLoadMethod section because it is very important else you will get some other scripting issues. Hope this advice of mine help you solve your problem forvever.

Similar Threads

  1. Why completely rewrite Virtual DJ 8?
    By Chellappan in forum Windows Software
    Replies: 4
    Last Post: 17-01-2012, 11:51 PM
  2. Need help with url rewrite on my website
    By Dakshayani in forum Software Development
    Replies: 5
    Last Post: 29-06-2011, 03:25 AM
  3. Can URL Rewrite convince certain requirements?
    By Gajadhar in forum Technology & Internet
    Replies: 4
    Last Post: 20-06-2011, 10:59 PM
  4. Classic ASP’s URL Rewrite
    By Camdra in forum Software Development
    Replies: 4
    Last Post: 18-06-2011, 10:11 PM
  5. How to rewrite a disc
    By Tionontati in forum Windows Software
    Replies: 6
    Last Post: 30-05-2010, 12:03 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,860,627.83670 seconds with 17 queries