Mikayil Abdullayev
Mikayil Abdullayev

Reputation: 12376

JQueryUI absolutely not working with my aspx page

Here's a part of my aspx page:

<span id="drag">This can be dragged </span>
<input id="save" type="button" value="Save" />
<div id="dialog">
</div>

<script src="Scripts/jquery.js" type="text/javascript"></script>
<script src="Scripts/jquery-ui-1.9.0.custom.js" type="text/javascript"></script>
<script src="Scripts/ui.js" type="text/javascript"></script>

And here's my ui.js file:

$('#save').click(function ()
{
  $('#dialog').dialog();
});

$(document).ready(function ()
{
  $('#drag').draggable();
});

And I've linked the css file in my masterpage :

    <link rel="stylesheet" href="CSS\ui-lightness\jquery-ui-1.8.24.custom.css">

If I try this in a plain html file I get both draggable and dialog functionalities to work but neither function works when I try it in my aspx page.Is there a special consideration with ASP.NET?

Upvotes: 1

Views: 174

Answers (4)

ravidev
ravidev

Reputation: 2738

If you are not getting any error in browser's console then u should use "jQuery" instead of "$" symbol

Upvotes: 0

bAN
bAN

Reputation: 13835

What does the rendered HTML look like? Maybe you have a problem with rendered ID of your controls Here's an article about clientId Mode

ClientIDMode can take the following four possible values

  • AutoID - ASP.NET generate IDs as it does in v3.5 and earlier versions.
  • Static - ASP.NET use exactly the same ID given to the server control for its client-side ID.
  • Predictable - ASP.NET try to generate IDs that are guessable from looking at the structure of the page.
  • Inherit - ASP.NET generate a client-side ID for the page or control using the same ClientIDMode as its parent. i.e. the client ID gets inherited from the parent control.

This one can be set in the control directly, in the page or in the webConfig file.

Upvotes: 1

Rui Lima
Rui Lima

Reputation: 7423

are all the files being downloaded? did you check this with fiddler, firebug or developer tools?

Upvotes: 1

You probably loading 2 times the jquery library.

remove this resource :

Upvotes: 1

Related Questions