What is OwnerStateBag parameter?

2 posts, 1 answers
  1. George
    George avatar
    70 posts
    Member since:
    Oct 2014

    Posted 26 Feb 2015 Link to this post

    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,

  2. Answer
    Genady Sergeev
    Genady Sergeev avatar
    1595 posts

    Posted 27 Feb 2015 Link to this post

    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.


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

    I hope that this helps.

    Genady Sergeev

    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.

  3. DevCraft R3 2016 release webinar banner
Back to Top