2013-11-09 5 views
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; 
} 

난 내 ASP 코드와 code.First 내가 하나의 방법 및 왕복 만이보기를 가졌다 .cs을 준, 지금은 추가 할 한 번 더 multicity 버튼보기, 그래서 난 내 .cs 코드에서 해당 뷰 17이 줘야하는 방법, 어떻게 내가 페이지로드에서

답변

0

쓰기를 도와 code.PLZZZ 내 주어진 .cs에서 확인해야 변경

protected void Page_Load(object sender, EventArgs e) 
{ 

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

      } 
} 
+0

도와 주셔서 감사합니다. :) – Naveen31

+0

도와 드리겠습니다. !! :) –

+0

코드에 주석을 달 수 있습니까? 왜 이것이 해결책입니까, 어떻게 작동합니까? – user35443

0

.cs 코드를 다음과 같이 변경하고 시도하십시오.

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; 
}