Url Routing in ASP.NET 3.5 breaks AJAX

Hello I created custom URL routing in ASP.NET 3.5 
(http://blogs.msdn.com/b/mikeormond/archive/2008/05/14/using-asp-net-routing-independent-of-mvc.aspx), 
but my AJAX code is giving me error now: 'Sys' is undefined. When I remove 
the routing, AJAX works fine. I am using standard Microsoft AJAX libraries. 
Please help!

0
Utf
5/28/2010 2:40:06 PM
dotnet.framework 137 articles. 0 followers. Follow

3 Replies
1451 Views

Similar Articles

[PageSpeed] 42

this happens when you have wildcarding in place
one way to solve this to add a constraint to your routes so they only work 
for .aspx , ... files  - something like this :

  RouteValueDictionary constraints =  new RouteValueDictionary( new { Page = 
@".*\.aspx*$" } );
  Route rt = new Route( "{Page}" , RouteHandler );
  rt.Constraints = constraints;
  routes.Add( "RouteHandler" , rt );


"Dmitri Vaganov" <DmitriVaganov@discussions.microsoft.com> wrote in message 
news:3AEB12F3-1C34-401B-B605-63B062FAF341@microsoft.com...
> Hello I created custom URL routing in ASP.NET 3.5
> (http://blogs.msdn.com/b/mikeormond/archive/2008/05/14/using-asp-net-routing-independent-of-mvc.aspx),
> but my AJAX code is giving me error now: 'Sys' is undefined. When I remove
> the routing, AJAX works fine. I am using standard Microsoft AJAX 
> libraries.
> Please help!
> 


0
gerry
5/28/2010 3:56:42 PM
Thanks for your help, Gerry. When I add the constraint, the Routing stops 
redirecting to the page that I specified. When I remove constraint it works 
fine.

Here is my routing code:

RouteValueDictionary constraints = new RouteValueDictionary(new
            {
                Page =
                    @".*\.aspx*$"
            });
            Route rt = new Route("{Page}", new 
CustomRouteHandler("~/WelcomePage.aspx"));
            rt.Constraints = constraints;
            routes.Add("RouteHandler", rt);

Here is CustomRouteHandler:

public class CustomRouteHandler : IRouteHandler
    {
        public CustomRouteHandler(string virtualPath)
        {
            this.VirtualPath = virtualPath;
        }

        public string VirtualPath { get; private set; }

        public IHttpHandler GetHttpHandler(RequestContext
              requestContext)
        {
            foreach (var urlParm in requestContext.RouteData.Values)
            {
                requestContext.HttpContext.Items[urlParm.Key] = urlParm.Value;
            }
            var page = BuildManager.CreateInstanceFromVirtualPath
                 (VirtualPath, typeof(Page)) as IHttpHandler;

            return page;
        }
    }

"gerry" wrote:

> this happens when you have wildcarding in place
> one way to solve this to add a constraint to your routes so they only work 
> for .aspx , ... files  - something like this :
> 
>   RouteValueDictionary constraints =  new RouteValueDictionary( new { Page = 
> @".*\.aspx*$" } );
>   Route rt = new Route( "{Page}" , RouteHandler );
>   rt.Constraints = constraints;
>   routes.Add( "RouteHandler" , rt );
> 
> 
> "Dmitri Vaganov" <DmitriVaganov@discussions.microsoft.com> wrote in message 
> news:3AEB12F3-1C34-401B-B605-63B062FAF341@microsoft.com...
> > Hello I created custom URL routing in ASP.NET 3.5
> > (http://blogs.msdn.com/b/mikeormond/archive/2008/05/14/using-asp-net-routing-independent-of-mvc.aspx),
> > but my AJAX code is giving me error now: 'Sys' is undefined. When I remove
> > the routing, AJAX works fine. I am using standard Microsoft AJAX 
> > libraries.
> > Please help!
> > 
> 
> 
> .
> 
0
Utf
6/1/2010 6:50:01 PM
Gerry, I added a custom constraint class to catch the pages with "." in the 
name. That fixed the issue. Thanks for all your help!!!

"gerry" wrote:

> this happens when you have wildcarding in place
> one way to solve this to add a constraint to your routes so they only work 
> for .aspx , ... files  - something like this :
> 
>   RouteValueDictionary constraints =  new RouteValueDictionary( new { Page = 
> @".*\.aspx*$" } );
>   Route rt = new Route( "{Page}" , RouteHandler );
>   rt.Constraints = constraints;
>   routes.Add( "RouteHandler" , rt );
> 
> 
> "Dmitri Vaganov" <DmitriVaganov@discussions.microsoft.com> wrote in message 
> news:3AEB12F3-1C34-401B-B605-63B062FAF341@microsoft.com...
> > Hello I created custom URL routing in ASP.NET 3.5
> > (http://blogs.msdn.com/b/mikeormond/archive/2008/05/14/using-asp-net-routing-independent-of-mvc.aspx),
> > but my AJAX code is giving me error now: 'Sys' is undefined. When I remove
> > the routing, AJAX works fine. I am using standard Microsoft AJAX 
> > libraries.
> > Please help!
> > 
> 
> 
> .
> 
0
Utf
6/1/2010 7:32:01 PM
Reply:

Similar Artilces:

How To Track Clicks from your MS Word Resume using a URL shortener
Like many people with a technical background, I have lots of links in my resume to companies I have worked for and projects I have completed. When I send out a resume I would like to know whether people click on the links in the resume, but normally I can only get stats for sites I control (using Google Analytics Campaign Tracking). By using a URL shortening service I can embed links that are specific to the resume that I sent, and I can track every click on that link from that specific resume. The only problem here is that creating those links is time consuming, especially if yo...

hyperlinks in a spreadsheet keep breaking
I have a list with about 380 records which I use with filters on at the top of the column. One column refers to filenames which I have tried to replace with hyperlinks - I set the links up then after eg filtering, and moving around the sheet, and perhaps closing & reopening the book, the links fail to work again, the error message is "address not valid". How can I ensure the links keep working ? I am working on a network. I think I'd try creating the hyperlinks using the worksheet function: =hyperlink(). Say your filename is in A2, then put this in B2: =hyperlink("...

Multi file XSD schema won't compile in C#.net 2.0 program
I am having difficulty referencing a multiple file XSD schema in a .Net 2005 program. The schema files are shown below in their entirety. As soon as these files are included in my project, I get the following error compiling the program: Unable to convert input xml file content to a DataSet. The ‘http://www.mydomain.com/MySchemas/BuildingBlocks/Address/v1.0:PostalCodeID’ element is not declared. These schemas validate in XML Spy, and also in .NET 2005 with the XML Spy add-in loaded, so I don’t understand what the problem is. If I change the “xsd:import namespace” declaration in ...

Something odd with 1.3...
I've a client who picked up on this one: when he opens his Store Operations POS by double clicking on his desktop icon, the logon box appears as normal. When he fills in his User details and clicks Okay, the box disappears and he's left looking at the Windows desktop while the POS is minimized on the taskbar. When he clicks on the minimized app, it won't restore. When he right-clicks on the app and selects Restore from the menu, it won't restore. Only when he right-clicks and selects Maximize from the menu will his fullscreen POS appear. It started in the last few day...

Inserting a URL
Hi, I was wondering if Great Plains supports inserting a link into one of the records so the user will be able to look up an Invoice in GP and find a link that will point to some other type of info. So when the user pulls up Invoice Number 123 there will also be a link/URL in one of the fields to http://www.InvoiceInfo123.com Thanks, Andy Andrew, It depends. The italic i icon let's you add links to some records. You may be able to use the Extender product as well. I haven't had time to play with it. The Notes area can be used to attach files or links to files such as Wo...

.net Framework versions
I am installed GP 9.0 on a machine running an ATI video card that has a driver set requiring .Net framework 2.0. MS GP reports it needs Framework 1.1 to be installed. Will MS GP run correctly with only 2.0 framework installed, or does it need both? Is there a conflict if both are installed on the same system? Thank you, ~Nathan~ I don't know about 2.0 only. It runs fine with 1.1, 2.0 and 3.0 beta all on the same machine. Mark (DynamicAccounting.net) ND Wilder wrote: > I am installed GP 9.0 on a machine running an ATI video card that has a > driver set requiring .Net framew...

.Net Web App (client) / Web Service XML (server) HTTP Post
I think I have confused myself with reading all the articles on XML so I am hoping someone can point me in the direction for each piece of the project I am trying to develop. 1st Step - I need to have a Web app that will create an XML stream and send it to a Web Services on our Web server 2nd Step - Need to create a Web Service that will accept the XML Stream - then "process" it, then send an XML Stream back 3rd Step - We the same app that was created in step 1, I need to be able to read the new XML stream coming from the Web Service in Step 2. If someone could point me to the c...

CREDIT REPAIR KIT #3
Order your Credit Repair Kit at: http://creditfixzone.com/ Before you spend hundreds or even thousands of dollars on a credit repair service, we recommend you try our Credit Repair Kit first. The information provided in this kit are the same techniques used by professionals. You will be surprised how easy it is to repair your credit yourself. With a little time and patience you will be able to achieve the same results that you would normally pay thousands for a professional to do. Credit repair is not magic. Many companies out there will bilk you out of your hard earned money, only to use ...

url
how can I send a url in a message in outlook 2000 no way to use the "send to" function?? "Wolfman" <Wolfman@discussions.microsoft.com> wrote in message news:741252C1-4C9B-46DC-A3E6-337D4255A7C1@microsoft.com... > csull, > > Create a new Message and then in the body literally type the url out. > > eg. > > http://www.microsoft.com > > -- > Regards, > Ash. What happens if you try IE's File, Send link to menu? Mailto burl (http://www.slipstick.com/addins/gallery/index.htm#mailto) sends links, not the attachments. -- Diane Po...

Converting files #3
I have several pub files that I need to conver to pdf. Can this be done, and if so how? Hi Charlie (anonymous@discussions.microsoft.com) in the newsgroups you posted: || I have several pub files that I need to conver to pdf. Can this be || done, and if so how? Check out the following link: http://www.mvps.org/publisher/sharing.html -- Brian Kvalheim Microsoft Office Publisher MVP Official Publisher MVP Site: http://www.kvalheim.org This posting is provided "AS IS" with no warranties, and confers no rights. By using Acrobat or one of the other programs. "Charlie"...

Internet Orders #3
Is there still a way to download internet orders in RMS. I saw the functionality when I first installed the product, but am unable to find it now. Where do you put the server info at for the POS to download the internet orders? I have a web firm that is making a web store for me, and I have a copy of a XML Yahoo receipt. I jsut cannot figure out where to tell RMS to download the orders from. Thanks for the help, Nick http://www.newestech.com They have an add-in called Web Integrator that will download web sales in the Yahoo Stores DTD format and load them into the RMS Database cor...

How to set different URLs to IE for nevigating to different sites
I want to open a IE window through a program Then I will open a perticular site say "http://www.yahoo.com" in the same IE window through the same program Then after some time say delay of 1 min I want to open other site say "http://hotmail.com" in the same window throug same program Could you please tell me how to do this Thanks Shr You can use IEs object model to automate it. What you are asking is exposed thru its object model. -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com "Shri" <anonymous@discussions.microsoft.com> wrote in message news:D244A9C8-...

2003 recipient policy for exchange 5.5
Can a recipient policy created on 2003 to purge mail in the deleted items folder also be used for exchange 5.5 in the same site? John Stimpson On Sun, 26 Feb 2006 22:16:19 -0500, "John Stimpson" <johnstimpson@tupperware.com> wrote: >Can a recipient policy created on 2003 to purge mail in the deleted items >folder also be used for exchange 5.5 in the same site? > >John Stimpson > I would say not. There is the Mailbox Manager feature in 5.5. Are you able to use that or did you just want something with a single interface? ...

Autocomplete #3
When I write in the address of the person that I am sending to Outlook would suggest names, like autocompleting it. I have checked the box that says, suggest names when completing to, cc, ccc, and it still does not work. Does anyone have any suggeestions?? You confused me. You said it autocompletes, then you said it doesn't. What happened in between? -- Russ Valentine [MVP-Outlook] "Allison" <anonymous@discussions.microsoft.com> wrote in message news:2bb201c3afba$931aa280$a601280a@phx.gbl... > When I write in the address of the person that I am > sending to O...

Printing #3
How do I print a month calendar page to 3 3/4 x 6 3/4 DayRunner Paper from Outlook 200? Thanks, M ...

Mailbox Resources #3
Hi All Can anybody out there help me with a little problem I have? I'm running Exchange 5.5 on a NT4 Server. Under the Private Information Store and under Mailbox Resources it lists the mailboxes. The problem is that there are some old ones in there. If I double click on them I get the following message "No mapping between account names and Security IDs was Done" Does anybody know how I can delete these old mailboxes Cheers Stuart sounds like they are hidden, and the NT accounts are gone...in your Exchange Admin program, go to "View", and select "Hidden re...

Sending a link chops URL's with Outlook 2007!?#
Whenever I "send link" from a browser, using Outlook 2007, it not only uses plain text formatting, but also chops long URL's with a newline. I want my emails sent with HTML formatting. And if I reply to a plain text email containing a long URL, this gets chopped too! I find this most annoying, as do the message recipients. Is there a way to fix this, or should I just use a better email client like Outlook Express or Thunderbird? Thanks for your help. Outlook does it because the line length for plain text is 76 char (tools, options, mail format tab, international button...

New Computer #3
How do I move my settings, emails, address book, etc... to my new computer. I'm mostly concerned with Outlook because it's the program I use most often. I have an older computer running WIN2K Pro. I purchased a new Dell computer with Windows XP Pro also with Office 2003. Again how do I make my new Outlook have all the information and settings that my old computer has. I do have both computers connected on my home network and they can see each other. But I'm not sure what to copy over. Any help would be very helpful. Thank You, Paul The file you need to copy and re-use up ...

URL problem?
When I hit start and go to internet, the timer comes on and then goes off without opening up the web page. When I go to tools and click on the accounts tab, click on general, the explorer address is gray, locked and set for mozilla. I just want to get to internet explorer like I used to! Help! I am the administrator of this computer! Linda I would suggest posting to group, that is relevant for your operating system. Linda wrote: > When I hit start and go to internet, the timer comes on > and then goes off without opening up the web page. When > I go to tools and click...

CRM 3.0
I recently moved all of our data from Goldmine 6.0 (approximately 7000 contacts) to CRM 1.2, then upgraded to CRM 3.0. I used a 45 day license of Scribe to perform the import. I moved all of the data to Accounts (for companies) and Contacts. Included in this data was a large number of prosective clients & companies that really should have been brought into CRM as Leads. Here's my question... I know that you cannot convert Accounts or Contacts back to Leads, but could I somehow export the Accounts and Contacts that should have been Leads to a file, delete them in CRM, then impor...

Ignore deductions linked to Direct Deposit to calc Net Pay
When an employee has a deduction linked to direct deposit and another deduction that is a percentage of net pay (ie. garnishment of wages), the amount of the second deduction is less than it should be because the direct deposit deduction is reducing 'net pay.' Since the direct deposit deduction really IS net pay, other deductions should be based on the net pay before deductions linked to Direct deposit. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree&qu...

Unable to add Outlook 2003 LDAP connection to Exchange 5.5 Server
Exchange 5.5 SP4 Running on Win2K SP4 Outlook 2003 Recently, when a user tries to add an LDAP address book to their OL2K3 client, they receive the following pop-up: Title: Microsoft Office Outlook Message: "There was an error locating one of the items needed to completed this operation. It might have been deleted." Buttons: OK We have two Exchange servers with the same configurations. This only happens to users with a mailbox on the one server. Using OL2K3, I am able to successfully configure the LDAP to one Exchange server, and with that same OL2K3 client, get the pop-up wh...

Pivot Tables #3
Has anyone encountered the issue below? Upon "PivotTable" refresh, an error message occurs "The Pivot Table Field Name is not valid. To create a Pivot Tbale report, you must use the data that is organized as a list with the labeled columns. If you are changing the name of the Pivot Table field, you must type a new name for the field. Basically, the Pivot Table feature stops working at this point. Andrew Do you have any blank cells in the heading row? That would cause that error message to appear. Andrew Seto wrote: > Has anyone encountered the issue below? > &g...

Exporting users calenders in Exchange 5.5 using Exmerge
Was wondering if there is a way to export only user's calendars on an Exchange 5.5 server using Exmerge. The version of Exmerge that seems to work with 5.5 doesn't do calendar export...( this is our backup plan before running the DST TZMOVE stuff that is giving us a rainbow of results on our test environment. Thanks for any help here... -- On Mon, 26 Feb 2007 12:53:02 -0500, "Thinkpad21" <thinkpad21@yahoo.com> wrote: >Was wondering if there is a way to export only user's calendars on an >Exchange 5.5 server using Exmerge. > >The version of Ex...

HTTPS OFXServer URL
Hi, I'm using MSMoney 2005 and the following problem occurs: i'm trying to do an Account Update. I'm using fiddler to lookup the URL that MSMoney 2005 is trying to access. When i begin the update, MSMoney 2005 tries to access the OFXServer's URL, but the request is HTTP. It should be HTTPS! So, fiddler returns the Http 504 code. How can i force MSMoney 2005 to access the correct URL (with HTTPS) instead of HTTP? Regards, Marco. In microsoft.public.money, marco.a.mendonca@gmail.com wrote: > > >I'm using MSMoney 2005 and the following problem occurs: i'm tryi...