title: Sending a postback programmatically
body: <p>I've built a custom web control for picking date. It consists of 3 dropdownlists. In their selectedIndexChanged event i check for the date like this.</p>
  
  <pre><code>    protected void SelectedIndexChanged(object sender, EventArgs e)
  {
      DropDownList ddList = sender as DropDownList;
      if (ddlDays.SelectedIndex &gt; 0 &amp;&amp; ddlMonths.SelectedIndex &gt; 0 &amp;&amp; ddlYears.SelectedIndex &gt; 0)
      {
          int day = ddlDays.SelectedIndex;
          int month = ddlMonths.SelectedIndex;
          int year = int.Parse(ddlMonths.SelectedValue);
          try
          {
              DateTime date = new DateTime(year, month, day);
          }
          catch
          {
  
              if (OnDateNotValid != null)
                  OnDateNotValid("Entered date is not valid");
              //Here I want to invoke PosBack on the page where I use this control
          }
      }
  }
  </code></pre>
  
  <p>I actually get the warning label text to change to the error description but as there's no postback in the form the label does not show. here are some consideration:
  1. I've put AutoPostBack property of the dropdownlists to false because reloading the page each time after changing the itemindex is frasturating.
  2. I tried putting a button on the control and calling its onbuttonclick event but it did not work.</p>
  
  <p>Now,I need to send a postback to the page if my control discovers that the date is not valid.</p>
  
  <p>P.S. When I put a break point at the beginneg of SelectedIndexChganged method and change the index of any of the dropdownlists the debugger does not stop at that breakpoint. I've assigned all the dropdownlist SelectedIndexChanged event to this method.</p>