Hi ,
I am using asp.net ajax client side function like getLocation() , getBounds() and setLocation() . If I use these function on elements which are defined in the markup of page they al work fine . But if any element is created during run time in javascript they are not working . Following is a sample on which I am struggling for some time :-
var tdUser = $get('<% = tdUser.ClientID %>'); --> TD element defined in markup
var tdlocation = Sys.UI.DomElement.getLocation(tdUser);
var tdBounds = Sys.UI.DomElement.getBounds(tdUser);
var tdDiv = document.createElement("div");
var strTable = "<table><tr><td>Create User</td></tr><tr><td>Manage User</td></tr></table>";
tdDiv.innerHTML = strTable; -----------> Till here things are fine
Sys.UI.DomElement.setLocation(tdDiv , tdlocation.x , tdlocation.y-tdBounds.height); --> I want to append this new element tdDiv just below tdUser
Any words on this will be of great help to me . If some can provide me a sample code of how to use these functiosn with dynamically added elements then it will be too good .
Regards
Pawan Mishra
Moving from Asp.Net to WPF and SilverLight .....
.Net 360°