2012年3月10日土曜日

Running a javascript function without a RegisterStartupScript()

Saurabhj,

You could place your label inside an update panel. Then on the onclick event of your button, you could change the text and visibility properties of your label. That should give you the same effect as a div\layer, I think.


Hey vgiambattista,

After an entire day of trying out stuff, the closest I got to what I had planned to achieve was by using a panel inside an UpdatePanel and then toggling its visibility.

But the downside of this method as compared to the DHTML layer method is that I cannot change the position of the panel depending on screensize - which I was doing using javascript.

So, the only hack I can think of right now is putting a Panel inside a Layer.
On the button click I will change the label text and visibility and I'll connect the Button's OnClientClick property to a javascript method which centes the layer on the screen.

Unless someone could help me with a better (non hack) approach.
Thanks :)

- Saurabh

Saurabhj,

I think that's actually a good solution, and not a hack. I've done the same thing with placing a wizard inside and update panel, then placing the update panel inside an absolutely positioned div tag so I can make the div tag draggable.

There are Atlas extensions in the new toolkit for making panels draggable and/or visible which would probably be more pure, and you might try one of them. But if you get it to work and it performs well, that should be good enough, IMHO.


Hey vgiambattista,

Thanks for backing up this method.
I think I will go ahead with this. :)

I do have the new toolkit, but I'm far into the project to go and include the toolkits now.
Might do an upgrade after everything is done though.

Thanks again !

- Saurabh

0 件のコメント:

コメントを投稿