Agidoxoppof
New Member
i have an ascx page having design and code behind. i want to call that page in each wizardstep of wizard control in aspx page with different ID name.but due to change in the id of ascx page in aspx page for every wizardstep i need to write the same code with different ID's of ascx page.in register.aspx page :\[code\] <i><asp:WizardStep ID="WizardStep2" runat="server" Title="schooling"> <div class="content"> <addr:addr ID="address_acx" runat="server"/> //calling usercontrol with Id "address_ascx" </div></i></asp:WizardStep>\[/code\]and in code behind a function to get values :\[code\]public string[] getASCXvalues(){ string school_name = null, sid = null, section = null; CheckBox chk = (CheckBox)address_acx.ID .FindControl("chk_school"); TextBox txt_school = (TextBox)address_acx.FindControl("txt_school"); if (chk.Checked || address_acx.schoolnames <= 1) { school_name = txt_school.Text; sid = BAL.Class1.getmaxid() + 1; int val = Convert.ToInt32(sid.Substring(1, 6)) + 1; sid = sid.Substring(0, 1) + val.ToString().PadLeft(6, '0'); } else { school_name = address_acx.selectedschollname; sid = address_acx.selectedschoolcode; } CheckBox chk_sec = (CheckBox)address_acx.FindControl("chk_section"); TextBox txt_sec = (TextBox)address_acx.FindControl("txt_section"); if (chk_sec.Checked || address_acx.sectioncount <= 1) { section = txt_sec.Text; } else { section = address_acx.selectedsec; } string[] a = new string[10]; a[0] = address_acx.selectedyear; a[1] = address_acx.selectedmandal; a[2] = address_acx.selectedvillage; a[3] = school_name; a[4] = sid; a[5] = section; return a; }\[/code\]now the problem is in next wizard step i have to re write the above function with another ID of the ascx page.