User control (ascx) and properties

前端 未结 6 2199
终归单人心
终归单人心 2020-12-29 04:53

The only way I\'ve found to persist property values within a user control is to use the ViewState.

public string Title {
        get { return Convert.ToStrin         


        
6条回答
  •  天涯浪人
    2020-12-29 05:56

    It depends. If you need to property values to be persisted beyond a post-back then you'll either have to use ViewState or Session. Since those controls are re-created on each post back you can't really maintain that state otherwise.

提交回复
热议问题