Muhammed Athil Muhammed Athil -4 years ago 290
ASP.NET (C#) Question

PageMethods.SetPath() not working in routed url with url params

my page name is productdetails.aspx

In global.asax file I added custom routes like this

routes.MapPageRoute("ProductDetails", "ProductDetails/{Language}/{Currency}/{Store}/{ProductId}/{ProductName}", "~/ProductDetails.aspx");

I want to add PageMethods.SetPath Like


Not working

Answer Source

I got the answer my self When we are using PageMethods in routed url we need to take care of the location of path of the page where the code is existed. By using url routing the actual page may be in the root folder and the url be like "". In this case when we are using PageMethods we need to write code for where the code existed in script. Eg:-


Here I give (../) s to go back folder . Scrpt manager take url slases as folders and there may not be such folders.

For demo plz goto the link

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download