Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/31.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
asp.net向导控件_Asp.net - Fatal编程技术网

asp.net向导控件

asp.net向导控件,asp.net,Asp.net,我有一个包含5个步骤的向导控件。 在用户从下拉列表文本框中选择他的值之后,我有一个submit_click事件将所有选择的值插入数据库 这里是我在提交中的内容 try { int result = new objBLL.PostProfile { ProfileId = 1, CasteI

我有一个包含5个步骤的向导控件。 在用户从下拉列表文本框中选择他的值之后,我有一个submit_click事件将所有选择的值插入数据库

这里是我在提交中的内容

try
                {

                    int result = new objBLL.PostProfile
                    {
                        ProfileId = 1,
                        CasteId = Convert.ToInt32(casteDropDown.SelectedValue),
                        MMBId = iMMBID,
                        UserId = UserId,
                        FullName = Full_Name.Text,
                        Gender = genderDropDown.SelectedValue,
                        Age = Convert.ToInt32(Age.Text),
                        Height = HeightDropDown.SelectedValue,
                        Complexion = ComplexionDropDown.SelectedItem.ToString()
 }.Save(Operation.Insert);

public class PostProfile
    {
        PostProfileDAL objProfileDAL = new PostProfileDAL();

        public int ProfileId { get; set; }
        public int CasteId { get; set; }
        public int MMBId { get; set; }
        public Guid UserId { get; set; }
        public string FullName { get; set; }
        public string Gender { get; set; }
        public int Age { get; set; }
        public string Height { get; set; }
        public string Complexion { get; set; }

 public int Save(Operation opr)
        {
            int result = 0;
            SqlParameter[] parms = {
                                      new SqlParameter("@Profile_Id", ProfileId),
                                         new SqlParameter("@Caste_Id", CasteId),
                                         new SqlParameter("@MMB_Id", MMBId),
                                         new SqlParameter("@User_ID", UserId),
                                         new SqlParameter("@Full_Name", FullName),
                                         new SqlParameter("@Gender", Gender),
                                         new SqlParameter("@Age", Age),
                                         new SqlParameter("@Height", Height),
                                         new SqlParameter("@Complexion", Complexion)

                                   };

            try
            {
                if (opr == Operation.Insert)
                {

                    result = DALBASE.SetData("InsertProfileDetails", parms);
}

 catch (Exception ex)
            {
                result = 1;
                throw ex;
            }
这就是我遇到麻烦的地方。 将所有数据发送到.cs文件时,它能够保留所有文本框值,但下拉列表、列表框中的所有选定值都不会保留

例如:对于DropDownlist肤色,如果我在向导控件中选择一个值“VeryFair”, 将其发送到类文件进行保存操作时,肤色下拉列表的值仍然是“请选择一个值”

谢谢你的帮助 谢谢
Sun

检查向导的ViewStateMode属性

应该启用它,而不是继承