DotnetSparrow
DotnetSparrow

Reputation: 27996

ajax toolkit error

I am using this code in asp.net 4.0:

 panel = $('#<%= Panel1.ClientID %>')
 panelBounds = CommonToolkitScripts.getBounds(panel); // error here

where panel1 is asp.net panel

and getting this error

Microsoft JScript runtime error: Sys.ArgumentException: Value must be a DOM element. Parameter name: element

How to fix this? also, Is there any alternative of getbounds in jquery to hold height width X and Y location?

Upvotes: 1

Views: 347

Answers (1)

Jamie Treworgy
Jamie Treworgy

Reputation: 24334

$('xxx') returns a jQuery object, not a DOM object. To get a DOM ref just use:

panel = document.getElementById('<%= Panel1.ClientID %>');

Use .positon, .width, .height in jQuery.

Upvotes: 1

Related Questions