[Dnsmail-cvs] projeler/00listepanel CheckBoxListAutoPostBack.aspx, NONE, 1.1 ListBoxAutoPostBack.as
Brought to you by:
ethem
From: Ethem E. <et...@us...> - 2006-06-12 07:16:48
|
Update of /cvsroot/dnsmail/projeler/00listepanel In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv28156/projeler/00listepanel Added Files: CheckBoxListAutoPostBack.aspx ListBoxAutoPostBack.aspx PanelMultiPage.aspx Log Message: Listbox Checkbox Panel --- NEW FILE: CheckBoxListAutoPostBack.aspx --- <%@ Page Language="C#"%> <script Runat="Server"> void chklFavoriteFoods_SelectedIndexChanged( object s, EventArgs e ) { string strList = String.Empty; foreach (ListItem itmFood in chklFavoriteFoods.Items) if ( itmFood.Selected ) strList += "<li>" + itmFood.Text; lblFoodList.Text = strList; } </Script> <html> <head><title>CheckBoxListAutoPostBack.aspx</title></head> <body bgcolor="#cc33ff" style="font-size: medium; color: maroon; font-family: 'Comic Sans MS'"> <form Runat="Server"> <asp:CheckBoxList ID="chklFavoriteFoods" AutoPostBack="True" OnSelectedIndexChanged="chklFavoriteFoods_SelectedIndexChanged" Runat="Server" BackColor="#FF80FF" BorderColor="Yellow" ForeColor="Maroon" BorderStyle="Inset" Font-Bold="True" Font-Italic="True" Font-Names="Comic Sans MS" Font-Overline="False" Font-Size="Medium" Font-Underline="True"> <asp:ListItem Text="müzik" /> <asp:ListItem Text="sinema" Selected="True"/> <asp:ListItem Text="resim"/> <asp:ListItem Text="kitaplar"/> <asp:ListItem Text="spor"/> <asp:ListItem Text="gezmek"/> <asp:ListItem Text="araba kullanmak"/> <asp:ListItem Text="tiyatro"/> <asp:ListItem Text="müzik"/> </asp:CheckBoxList> <hr> ÝÞTE FAVORÝLERÝM: <asp:Label ID="lblFoodList" Runat="Server" BackColor="Orchid" ForeColor="Brown" Font-Bold="True" Font-Italic="True" Font-Names="Comic Sans MS" /> </form> </body> </html> --- NEW FILE: PanelMultiPage.aspx --- <%@ Page Language="C#"%> <script runat="server" backcolor="LightSeaGreen" font-bold="true" font-italic="false"> void Page_Load( Object s, EventArgs e ) { if (! IsPostBack ) { ViewState[ "CurrentPage" ] = 1; } } void btnNextPage_Click( object s, EventArgs e ) { Panel pnlPanel; string strPanelName; // Hide Previous Panel strPanelName = "pnlForm" + ViewState[ "CurrentPage" ]; pnlPanel = (Panel)FindControl( strPanelName ); pnlPanel.Visible = false; // Show Current Panel int currentPage = (int)ViewState["CurrentPage"]; currentPage+=1; ViewState["CurrentPage"] = currentPage; strPanelName = "pnlForm" + ViewState[ "CurrentPage" ]; pnlPanel = (Panel)FindControl( strPanelName ); pnlPanel.Visible = true; } void btnPrevPage_Click( object s, EventArgs e ) { Panel pnlPanel; string strPanelName; // Hide Current Panel strPanelName = "pnlForm" + ViewState[ "CurrentPage" ]; pnlPanel = (Panel)FindControl( strPanelName ); pnlPanel.Visible = false; // Show Previous Panel int currentPage = (int)ViewState["CurrentPage"]; currentPage-=1; ViewState["CurrentPage"] = currentPage; strPanelName = "pnlForm" + ViewState[ "CurrentPage" ]; pnlPanel = (Panel)FindControl( strPanelName ); pnlPanel.Visible = true; } void btnFinish_Click( object s, EventArgs e ) { pnlForm3.Visible = false; pnlForm4.Visible = true; lblSummary.Text = "<h2>ÝÞTE YAZDIKLARINIZ:</h2>"; lblSummary.Text += "<li> ADINIZ : " + txtFirstname.Text; lblSummary.Text += "<li> SOYADINIZ : " + txtLastname.Text; lblSummary.Text += "<li> FAVORÝ RENGÝNÝZ : " + txtFavColor.Text; lblSummary.Text += "<li> FAVORÝ YEMEÐÝNÝZ : " + radlFavPhilosopher.SelectedItem.Text; } </Script> <html> <head><title>PanelMultiPage.aspx</title></head> <body> <form Runat="Server"> <asp:Panel ID="pnlForm1" Runat="Server" BackColor="LightSeaGreen" Font-Bold="true" Font-Italic="true" Font-Size="Medium"> <h3>Sayfa <%=ViewState[ "CurrentPage" ]%> / 3</h3> <hr> ADINIZ: <asp:TextBox ID="txtFirstname" Runat="Server" /> <p backcolor="LightSeaGreen"> SOYADINIZ: <asp:TextBox ID="txtLastname" Runat="Server" /> <hr> <asp:Button Text="Sonraki Sayfa >>" OnClick="btnNextPage_Click" Runat="Server" /> </asp:Panel> <asp:Panel ID="pnlForm2" Runat="Server" Visible="False" BackColor="LightSeaGreen"> <h3>Sayfa <%=ViewState[ "CurrentPage" ]%> / 3</h3> <hr> FAVORÝ RENGÝNÝZ: <asp:TextBox ID="txtFavColor" Runat="Server" /> <hr> <asp:Button Text="<< Önceki Sayfa" OnClick="btnPrevPage_Click" Runat="Server" /> <asp:Button Text="Sonraki Sayfa >>" OnClick="btnNextPage_Click" Runat="Server" /> </asp:Panel> <asp:Panel ID="pnlForm3" Runat="Server" Visible="False" BackColor="LightSeaGreen"> <h3>Sayfa <%=ViewState[ "CurrentPage" ]%> / 3</h3> <hr> FAVORÝ YEMEÐÝNÝZ: <asp:RadioButtonList ID="radlFavPhilosopher" Runat="Server"> <asp:ListItem Text="Kebap" Selected="True"/> <asp:ListItem Text="Pizza" /> <asp:ListItem Text="Hamburger" /> </asp:RadioButtonList> <hr> <asp:Button Text="<< Önceki Sayfa" OnClick="btnPrevPage_Click" Runat="Server" /> <asp:Button Text="Sonuç" OnClick="btnFinish_Click" Runat="Server" /> </asp:Panel> <asp:Panel ID="pnlForm4" Runat="Server" Visible="False"> <asp:Label ID="lblSummary" Runat="Server"/> </asp:Panel> </form> </body> </html> --- NEW FILE: ListBoxAutoPostBack.aspx --- <%@ Page Language="C#"%> <script Runat="Server"> string strBackGroundColor = "white"; void lstColors_SelectedIndexChanged( object s, EventArgs e ) { strBackGroundColor = lstColors.SelectedItem.Text; } </Script> <html> <head><title>ListboxAutoPostBack.aspx</title></head> <body bgcolor="<%=strBackGroundColor%>"> <form Runat="Server"> <asp:ListBox ID="lstColors" AutoPostBack="True" OnSelectedIndexChanged="lstColors_SelectedIndexChanged" Runat="Server" Height="256px" Width="128px" Font-Bold="True" Font-Italic="True" Font-Names="Comic Sans MS" Font-Size="Large" > <asp:ListItem text="Red" /> <asp:ListItem text="Green" /> <asp:ListItem text="Blue" /> <asp:ListItem text="Pink" /> <asp:ListItem text="Yellow" /> <asp:ListItem text="Black" /> <asp:ListItem text="Maroon" /> </asp:ListBox> </form> </body> </html> |