Skip to main content

ASPxClientHiddenField Class

Represents a client-side equivalent of the ASPxHiddenField control.

Declaration

declare class ASPxClientHiddenField extends ASPxClientControl

Remarks

The ASPxClientHiddenField object serves as a client-side equivalent of the ASPxHiddenField control. In addition to the inherited common fucntionality, the ASPxClientHiddenField object provides the means to manipulate its values on the client side (such as the ASPxClientHiddenField.Add and ASPxClientHiddenField.Remove, ASPxClientHiddenField.Get and ASPxClientHiddenField.Set, ASPxClientHiddenField.Contains, ASPxClientHiddenField.Clear).

Example

The following part of the ASPxHiddenField online demo illustrates how to manipulate the ASPxHiddenField items collection on the client and server side by using the ASPxClientHiddenField.Get, ASPxClientHiddenField.Set, ASPxHiddenField.Item property etc.

...
var viewsCount = 3;
function ShowPrevPage(){
    ChangeActiveViewIndex(-1); 
}
function ShowNextPage(){
    ChangeActiveViewIndex(1);
}
function ChangeActiveViewIndex(changeIndex){
    hfAnswers.Set("questionIndex", GetQuestionIndex() + changeIndex);
    cpVoting.PerformCallback();
}
function GetQuestionIndex(){
    return hfAnswers.Get("questionIndex");
}
function IsPreviewPage(){
    return GetQuestionIndex() == (viewsCount - 1);
}
function OnSeasonChanged(s, e){
    hfAnswers.Set("month", 0);
    hfAnswers.Set("season", s.GetSelectedIndex());
}
function OnMonthChanged(s, e){
    hfAnswers.Set("month", s.GetSelectedIndex());
}
...
<script runat="server">
...
     private void LoadPreview() {
         int seasonIndex = (int)hfAnswers["season"];
         int monthIndex = (int)hfAnswers["month"];
         lblSelectedSeason.Text = seasons[seasonIndex];
         lblSelectedMonth.Text = months[seasonIndex][monthIndex];
     }
...
 </script>

...
 <dxhf:ASPxHiddenField runat="server" ClientInstanceName="hfAnswers" ID="hfAnswers">
 </dxhf:ASPxHiddenField>
...

Inheritance

See Also