calling ascx page in aspx with differnt ID names
<p>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.</p>

<p>in register.aspx page :</p>

<pre><code> &lt;i&gt;&lt;asp:WizardStep ID="WizardStep2" runat="server" Title="schooling"&gt;
        &lt;div class="content"&gt;
            &lt;addr:addr ID="address_acx" runat="server"/&gt; //calling usercontrol with Id "address_ascx"          
        &lt;/div&gt;
&lt;/i&gt;
&lt;/asp:WizardStep&gt;
</code></pre>

<p>and in code behind a function to get values :</p>

<pre><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 &lt;= 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 &lt;= 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></pre>

<p>now the problem is in next wizard step i have to re write the above function with another ID of the ascx page.</p>
