0
<asp:RadioButtonList ID="lstTrip" runat="server" AutoPostBack="True" RepeatDirection="Horizontal" Font-Names="Arial" Font-Size="Small" onselectedindexchanged="lstTrip_SelectedIndexChanged">
<asp:ListItem Selected="True" Value="OneWay">One Way</asp:ListItem>
<asp:ListItem Value="RoundTrip">Round Trip</asp:ListItem>
<asp:ListItem Value="MultiCity">Multi City</asp:ListItem>

if (lstTrip.SelectedValue.ToLower() == "roundtrip")
{
    //Change the selected multiview index 
    MultiView1.ActiveViewIndex = 1;
} 
else 
{
    MultiView1.ActiveViewIndex = 0;
}

i have given my asp code and .cs code.First i was having only two view which is one way and round trip, now i want to add one more view for multicity button,so how i wil disaplay that view from my .cs code, what changes i have to make in my given .cs code.PLZZZ HELP

Naveen31
  • 29
  • 1
  • 1
  • 12

2 Answers2

1

write it in page load

    protected void Page_Load(object sender, EventArgs e)
{

      if (!IsPostBack)
        {
            MultiView1.ActiveViewIndex = 1;  //index of the view1

           }
}
Sajad Karuthedath
  • 14,987
  • 4
  • 32
  • 49
0

Change your .cs code to the following and try.

if (lstTrip.SelectedValue.ToLower() == "roundtrip")
{
   //Change the selected multiview index 
MultiView1.ActiveViewIndex = 1;
} 
else if(lstTrip.SelectedValue.ToLower() == "multicity")
{
    MultiView1.ActiveViewIndex = 2;
}
else 
{
    MultiView1.ActiveViewIndex = 0;
}
Gurunadh
  • 453
  • 2
  • 10
  • 24