4

I am having a hard time finding a good answer for this question, but what is the difference between a static and a dynamic control in an ASP.NET webforms application.

Does having a dropdown list declared in html, but databound in code behind deem it a dynamic or static control?

TopBanana9000
  • 818
  • 2
  • 14
  • 32
  • Dynamic controls must be dealt with differently than static controls, especially in regards to viewstate. – TopBanana9000 May 12 '16 at 14:19
  • It is not easy to deal with dynamic controls. Because dynamic controls lose their state at postback. You have to write more codes if u wish to make the controls stay in the page – Beingnin Jan 30 '21 at 03:36

1 Answers1

4

Web Form has only 3 kind of controls - Server Control, User Control and Custom Server Control.

You can use all three types of controls in following two scenarios -

Static - You add a control inside ASPX at compile time.

Dynamic - You render a control from code behind at run time. It is not easy especially if you are new to Web Form.

Does having a dropdown list declared in html, but databound in code behind deem it a dynamic or static control?

It is a static way of using a control, since you declare the control inside ASPX at compile time.

Win
  • 61,100
  • 13
  • 102
  • 181