Click here to Skip to main content
15,890,527 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
i have a multi view in my .aspx page and in this this is my code sample ...

XML
<div id="TransactionTypeDivForCommercial" class="postline" runat="server"   >
                        <p class="postText">Transaction Type Required :</p>
                        <asp:RadioButtonList ID="RbtnTransactionTypeForCommercial" runat="server" RepeatDirection="Horizontal" AutoPostBack="True" OnSelectedIndexChanged="RbtnTransactionTypeForCommercial_SelectedIndexChanged">

                        </asp:RadioButtonList>
                    </div>

                    <div id="TransactionTypeDivForResidential" class="postline" runat="server">
                        <p class="postText">Transaction Type Required :</p>
                        <asp:RadioButtonList ID="RbtnTransactionTypeForResidential" runat="server" RepeatDirection="Horizontal" AutoPostBack="True" OnSelectedIndexChanged="RbtnTransactionTypeForResidential_SelectedIndexChanged">

                        </asp:RadioButtonList>
                    </div>

                    <div id="DivBuyType" class="postline" runat="server">
                        <p class="postText">Buy Type :</p>
                        <asp:CheckBoxList ID="ChlBListBuyType" runat="server" RepeatDirection="Horizontal">

                        </asp:CheckBoxList>
                    </div>






in this i am setting visiblity(true/false) of divs according to my situation in cs file ..
this will working fine ...

but when i am submitting data on server ... i am submitting data of only those controls whose div visiblity is true .... my cs code sample is like this ....



C#
if (TransactionTypeDivForCommercial.Visible == true)
            {

            ObjPostRequirementDetails.TransactionTypeIdReq= RbtnTransactionTypeForCommercial.SelectedValue.ToString();
            }
            else
            {
            ObjPostRequirementDetails.TransactionTypeIdReq=RbtnTransactionTypeForResidential.SelectedValue.ToString();
            }

            if(DivBuyType.Visible==true)
            {
            string s1 = ZrickGlobalClass.ControlLoading.NewMultiListSelection(ChlBListBuyType);
            ObjPostRequirementDetails.BuyTypeIdReq = ZrickGlobalClass.BasicDbOperations.NewSaveMultiListItems(s1).ToString();
            }
            else
            {
                ObjPostRequirementDetails.BuyTypeIdReq = "";
            }





but at this point on checking visiblty it always returns false (although visibliy is set to true in code behind process )....


and on debugging it also shows some type of exception ..


C#
{InnerText = '((System.Web.UI.HtmlControls.HtmlContainerControl)(TransactionTypeDivForCommercial)).InnerText' threw an exception of type 'System.Web.HttpException'}

base = {"Cannot get inner content of TransactionTypeDivForCommercial because the contents are not literal."}
ErrorCode = -2147467259


i am unable to find whats the wrong with my code ... i have a lot of dependancy on this problem ..

any suggestion or help will appreciate ... thnx in advanse
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900