This is a migrated thread and some comments may be shown as answers.

What is OwnerStateBag parameter?

1 Answer 53 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
George
Top achievements
Rank 2
George asked on 27 Feb 2015, 04:57 AM
I am trying to create a Telerik.Web.UI.InputPasswordStrengthSettings object to put some password settings on it  in a C# created password textbox. Creating this object takes a parameter of new InputPasswordStrengthSettings (System.Web.UI.StateBag OwnerStateBag).  The Telerik documentation is quite helpful as usual, it says OwnerStateBag is an owner state bag.

Searching the web for help I discover many Telerik controls take the OwnerStateBag as a parameter on construction.  I am programming in an ASP.NET environment is ASP.NET AJAX in a C# class far down below an aspx file.  Their is a ViewState in the aspx.

What does OwnerStateBag as a parameter mean and where would I get it or how should I make it?   StateBag is an internal interface needing to be created as another object.

Help please,
George


1 Answer, 1 is accepted

Sort by
0
Accepted
Genady Sergeev
Telerik team
answered on 27 Feb 2015, 12:38 PM
Hi George,

You can pass the Page ViewState object to the InputPasswordStrengthSettings constructor.

The constructor basically awaits ViewState object where it can save it settings. Since in your case the InputPasswordStrengthSettings  is used outside of RadControl we cannot pass the control ViewState. Instead, we can initialize it with a StateBag supplied from the page object.

Example:

protected void Page_Load(EventArgs e)
 {
     var b = new RadDateInput();
     var settings = new InputPasswordStrengthSettings(this.ViewState);
 }

I hope that this helps.

Regards,
Genady Sergeev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
George
Top achievements
Rank 2
Answers by
Genady Sergeev
Telerik team
Share this question
or