title: Error with radiobuttons on ASP.NET
body: <p>Why does the below code show me an error? Please correct this:</p>
  
  <pre><code>    protected void Button1_Click(object sender, EventArgs e)
  {
      if (RadioButtonList1.SelectedIndex='0') 
      {
          Response.Redirect("page1.aspx");
      }
      else if (RadioButtonList1.SelectedIndex='1') 
      {
          Response.Redirect("page2.aspx");
      }
      else if (RadioButtonList1.SelectedIndex='2') 
      {
          Response.Redirect("page3.aspx");
      }
  }
  </code></pre>
  
  <p>My design code is:</p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml" &gt;
  &lt;head runat="server"&gt;
      &lt;title&gt;Untitled Page&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form id="form1" runat="server"&gt;
      &lt;div&gt;
          &lt;asp:RadioButtonList ID="RadioButtonList1" runat="server"&gt;
              &lt;asp:ListItem&gt;item1&lt;/asp:ListItem&gt;
              &lt;asp:ListItem&gt;item2&lt;/asp:ListItem&gt;
              &lt;asp:ListItem&gt;item3&lt;/asp:ListItem&gt;
          &lt;/asp:RadioButtonList&gt;&lt;/div&gt;
          &lt;asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>