Hi Shawn,
are you sure you want to do this on postback? This way the user would need
for the page to be reloaded before the button appears at the new position.
Depending on the user's internet connection this might take a while...
Anyway, if you want to set a server web control's properties on postback,
you must do so in Page_Load(), not Page_Init(), because object properties
are all reset to their initial values *after* Page_Init() if the object's
EnabledViewState property is set to true.
HTH,
Axel Dahmen
----------------
"Shawn" <> schrieb im Newsbeitrag
news:#...
> I am trying to find a way to move a button control to a location where the
> mouse is clicked. I got all the code in to find the coordinates and
populate
> a hidden control with the values, but when I try to move the button on
> postback, it moves, but to a specific place on the form everytime. Here is
> where I am doing the move...
>
> Protected Sub Page_Init(ByVal sender As Object, ByVal e As
System.EventArgs)
> Handles Me.Init
> btnLoc.Style("Position") = "Absolute"
>
> btnLoc.Style("Top") = "25px"
>
> btnLoc.Style("Left") = "100px"
>
> End Sub
>
> Any ideas???
>
>
|