Hiddenfield Value Always Blank

1 posts, 0 answers
  1. Dan
    Dan avatar
    4 posts
    Member since:
    Nov 2012

    Posted 17 Jul 2013 Link to this post

    I have a radgrid.  Inside the radgrid I have an edit form template.  Inside the edit form template I have a  hiddenfield and a radtabstrip.  The radtabstrip has the OnTabClick and OnClientTabSelecting events wired up.  When one of the tabs is clicked the hiddenfield is set to true in the javascript function.  When the server code executes on postback the hiddenfield is always blank.  Why is this?  Please help.  By the way this page is not wired up for ajax.

    The markup...

    <EditFormSettings EditFormType="Template" >
        <FormTableItemStyle width="100%"></FormTableItemStyle>
        <FormTableStyle GridLines="None" CellSpacing="0" CellPadding="2"></FormTableStyle>
        <FormStyle Width="100%" backColor="white"></FormStyle>
        <FormTemplate>
            <div runat="server" id="divManageObligation" class="ContentSettings">
                <asp:HiddenField runat="server" ID="hdnManageObligations"/>
            <telerik:RadTabStrip runat="server" ID="rtsManageObligations" MultiPageID="rmpMultiPage" OnClientTabSelecting="OnTabSelecting"
                                    OnTabClick="rtsManageObligations_TabClick"  Width="100%">
                <Tabs>
                    <telerik:RadTab runat="server" Text="<%$ Resources:ui_labels, rtProgramDetails %>" Value="AlwaysLoaded"></telerik:RadTab>
                    <telerik:RadTab runat="server" Text="<%$ Resources:ui_labels, rtObligations %>" ></telerik:RadTab>
                    <telerik:RadTab runat="server" Text="<%$ Resources:ui_labels, rtAssistantshipHistory %>"></telerik:RadTab>
                    <telerik:RadTab runat="server" Text="<%$ Resources:ui_labels, rtRegistrationHistory %>"></telerik:RadTab>
                </Tabs>

    and the javascript....
    function OnTabSelecting(sender, args) {
     
        var editedItemsArray = $find("<%=rgCandidateList.ClientID %>").get_masterTableView().get_editItems(); ;
        var editFormItem = editedItemsArray[0].get_editFormItem();
        var hdnManageObligations = $telerik.findElement(editFormItem, 'hdnManageObligations');
        hdnManageObligations.value = true;
        if (args.get_tab().get_value()) {
            args.get_tab().set_postBack(false);
        }
    }

    ... when I inspect the contents of hdnManageObligations in the browser debugger it is set to "true"...

    ...and the code behind...

        Protected Sub rgCandidateList_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles rgCandidateList.ItemCreated
            Dim editItem As GridEditFormItem
     
    ...some code removed.....
     
            ElseIf TypeOf e.Item Is GridEditFormItem And e.Item.IsInEditMode Then
                editItem = CType(e.Item, GridEditFormItem)
     
                Dim a As HiddenField
                Dim b As String
                a = CType(editItem.FindControl("hdnManageObligations"), HiddenField)
                b = a.value
                If  CType(editItem.FindControl("hdnManageObligations"), HiddenField).Value = "true" Then
                    editItem.FindControl("divManageObligation").Visible = True
                    editItem.FindControl("divDecision").Visible = False
                Else
    ..... rest of code removed.

    the variable "a" in the code snippet above is a valid object of type "Hidden", but a.value is always blank and the sub rtsManageObligations_TabClick is never hit.  I have a break point in the routine.

    Any help in solving why the hidden field is blank  would be appreciated.

    Thanks,
    Dan
Back to Top