How to use user control multiple times on single page(Asp.net C#)
<p>I'm making one user control.
This user control is for to display advertisment from database.
Just we have to pass the place id and it will fetch the record from database and display on specific page.
It's working perfectly but when im draging this user control multiple time on same page then it doesn't work perfectly.
Means im passing different different place id for each usercontrol but both usercontrol takes only one place id and display same content in both usercontrol</p>

<p>Here is the code im using</p>

<pre><code>public partial class Advertisment : System.Web.UI.UserControl
{

    static int _Advertismentid;
    #region Get Set Property
    public int Placeid
    {
        get
        {
            return _Advertismentid;
        }
        set
        {
            _Advertismentid = value;
        }
    }
    #endregion


    #region Load Advertisment Funtion
    public void FnLoadAdvetsiment()
    {

        DataTable dt = new cls_Advertisements().FnGetAdvertsimentContent(Convert.ToInt32(Placeid));
        int i = 0;
        DataView dv = new DataView();
        if (dt.Rows.Count &gt; Convert.ToInt32(Session["rowno"]))
        {
            i = Convert.ToInt32(Session["rowno"]);
            ltrAdvertisment.Text = (dt.Rows[i]["Content"].ToString());
            AdTimer.Interval = Convert.ToInt32(dt.Rows[i]["Timer"].ToString());
            Session["rowno"] = Convert.ToInt32(Session["rowno"]) + 1;
        }
        else
        {
            Session["rowno"] = i = 0;
            ltrAdvertisment.Text = dt.Rows[i]["Content"].ToString();
            AdTimer.Interval = Convert.ToInt32(dt.Rows[i]["Timer"].ToString());
        }

    }


    #endregion



    #region Page Load Event
    protected void Page_Load(object sender, EventArgs e)
    {

            if (!IsPostBack)
            {
                FnLoadAdvetsiment();
                if (Session["rowno"] == null)
                {
                    Session["rowno"] = 0;
                }

            }




    }
    #endregion

    #region Timer Tick Event
    protected void Timer1_Tick(object sender, EventArgs e)
    {

        FnLoadAdvetsiment();

    }
    #endregion
}
</code></pre>

<p>Thanks&amp;Regards,
Manish Pandey</p>
