views:

48

answers:

1

I would like to trigger the onresize event from my C# code behind. I think this can be done with

Page.clientScript.RegisterScriptBlock(this.getType(), "id", "javascript code");

I have tried element.onresize() but it doesnt seem to work in firefox. What is the correct way to trigger an onresize event similar to the following jQuery?

$("body").trigger("resize");

Using jQuery itself isn't an option.

A: 

use this $(window).resize(); (tested in FF, chrome, IE8)

// old answer, fails in FF document.body.onresize()

y34h
Doesn't exist in firefox. Throws a typeerror
Raynos
Using jQuery isn't an option for me. This needs to work generically all over the websit without relying on jQuery being included.
Raynos