tags:

views:

97

answers:

2

Hi,

I have one third party Popup to display message. It has two properties OffsetX and OffsetY. To set its position in browser.

Now i am invoking this Popup on Button Click event. I need this popup just next to my Button and for that i have to set above mentioned OffsetX and OffsetY properties of Popup.

I tried following code on Button's Click Event,

Popup.OffsetX = Button.Style.Item("Top") Popup.OffsetY = Button.Style.Item("Left")

But values of Button.Style.Item("Top") and Button.Style.Item("Left") are always nothing and Popup always appear in Left Bottom corner due to value = nothing.

FYI, I did not set Top and Left from CSS. I just dragged the button from tool box.

Thanks in Advance

+1  A: 

The values of "Top" and "Left", unless explicitly defined in the CSS, won't be defined. Dragging controls onto the designer won't do that as the Top/Left positions can vary depending on the browser, the end users screen resolution (whether elements get re-positioned due to the width of the screen) and a number of other factors.

You'll probably need, from the sounds of it, to use a bit of client side javascript (if possible) to trigger the pop-up being shown and/or setting its Top and Left properties.

Rob
Thanks Rob,I am not sure whether we can invoke the AJAX Popup from JS. FYI my popup is third-party control so i have to access it through DLL. So, if you have any idea than just let me know.Thanks once again for your quick response
A: 

Thanks Rob,

I am not sure whether we can invoke the AJAX Popup from JS. FYI my popup is third-party control so i have to access it through DLL. So, if you have any idea than just let me know.

Thanks once again for your quick response