JQuery object expected error when accessing page via url routing.

Posted by Andy Evans on Stack Overflow See other posts from Stack Overflow or by Andy Evans
Published on 2010-05-29T16:25:52Z Indexed on 2010/05/29 16:32 UTC
Read the original article Hit count: 267

In my global.asax I have url routing setup like below:

routes.MapPageRoute("User Logon", "{Vendor}/Logon", "~/Logon.aspx");

In the logon.aspx page, I have a script that "stylizes" the logon button:

<link href="jquery/css/flick/jquery-ui-1.8.1.custom.css" rel="stylesheet" type="text/css" />
<link href="images/style.css" rel="stylesheet" type="text/css" />
<script src="jquery/js/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="jquery/js/jquery-ui-1.8.1.custom.min.js" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $('#<%= ButtonLogon.ClientID %>').button();
    });
</script>

When I access the page us a url (in debug mode) http://localhost/logon.aspx?v=1 the page loads correctly and the jquery button command loads correctly. But then I access the page using the new url route, I get this error.

Microsoft JScript runtime error: Object expected

Anyone have an idea why this occurs?

Thanks.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about jquery-plugins