how to assign value to class object Of TabContainer's Controls

Oct 25 2010 2:35 AM
public void btnAddRecord_Click(object sender, EventArgs e)
    {
        if (TabContainer1.ActiveTabIndex == 0)
        {

           //string txtSlider = Convert.ToString(((TextBox)TabPanel1.FindControl("txtSlider")).Text);
            Accessories accessories = new Accessories();
            accessories.txtSlider = (TextBox)TabPanel1.FindControl("txtSlider");
            accessories.ddlCategory = (DropDownList)TabPanel1.FindControl("ddlCategory");
            accessories.ddlQuality = (DropDownList)TabPanel1.FindControl("ddlQuality");
            accessories.ddlItemType = (DropDownList)TabPanel1.FindControl("ddlItemType");
            accessories.ddlPurchaseUnit = (DropDownList)TabPanel1.FindControl("ddlPurchaseUnit");
            accessories.ddlPriceTerm = (DropDownList)TabPanel1.FindControl("ddlPriceTerm");
            accessories.ddlShortName = (DropDownList)TabPanel1.FindControl("ddlShortName");
            accessories.txtItemCode = (TextBox)TabPanel1.FindControl("txtItemCode");
            accessories.txtArticle = (TextBox)TabPanel1.FindControl("txtArticle");
            accessories.txtMake = (TextBox)TabPanel1.FindControl("txtMake");
            accessories.txtDescription = (TextBox)TabPanel1.FindControl("txtDescription");
            accessories.txtConsuptionUnit = (TextBox)TabPanel1.FindControl("txtConsuptionUnit");
            accessories.txtResult = (TextBox)TabPanel1.FindControl("txtResult");
            accessories.txtDesign = (TextBox)TabPanel1.FindControl("txtDesign");
            accessories.txtPrice = (TextBox)TabPanel1.FindControl("txtPrice");
            accessories.txtReorderableLevel = (TextBox)TabPanel1.FindControl("txtReorderableLevel");
            accessories.chkReorderable = (CheckBox)TabPanel1.FindControl("chkReorderable");
            accessories.chkApproved = (CheckBox)TabPanel1.FindControl("chkApproved");
            accessories.chkActive = (CheckBox)TabPanel1.FindControl("chkActive");
            accessories.lblImagePath = (Label)TabPanel1.FindControl("lblImagePath");
            int rows = businessServiceClient.SaveAccessories(accessories);
}
}
This code not working i want to know how to Assign the value of controls of TabContainer  to Class Object

Plz give me Solution if any

Answers (1)