0

How do I register a JS function to run when a browser window is resized?

I assume it's in the

Page.ClientScript

class methods somewhere, but I am a bit confused.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Matt
  • 25,943
  • 66
  • 198
  • 303

1 Answers1

0

Resizing the browser window requires a client-side script, so it's probably more appropriate to write this directly into .aspx page in a script block, or possibly in a .js file.

That being said, check out this question, you can use a script similar to this: JavaScript window resize event via the Page.ClientScript.RegisterStartupScript method.

Community
  • 1
  • 1
CodingGorilla
  • 19,612
  • 4
  • 45
  • 65