SHARE
TWEET

Untitled

a guest Dec 7th, 2018 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="Webprog.WebForm1" %>
  2.  
  3. <!DOCTYPE html>
  4.  
  5. <html xmlns="http://www.w3.org/1999/xhtml">
  6. <head runat="server">
  7.     <title></title>
  8. </head>
  9. <body>
  10.     <form id="form1" runat="server">
  11.     <div>
  12.    
  13.     </div>
  14.         <asp:Label ID="Label1" runat="server" Text="Ime"></asp:Label>
  15.         <p>
  16.             <asp:TextBox ID="TextBox1" runat="server" OnTextChanged="TextBox1_TextChanged" style="margin-left: 0px"></asp:TextBox>
  17.         </p>
  18.         <asp:Label ID="Label2" runat="server" Text="Prezime"></asp:Label>
  19.         <p>
  20.             <asp:TextBox ID="TextBox2" runat="server" style="margin-bottom: 2px"></asp:TextBox>
  21.         </p>
  22.         <asp:Button ID="Button1" runat="server" Height="48px" OnClick="Button1_Click" Text="Submit" Width="129px" />
  23.         <p>
  24.             <asp:Label ID="Label3" runat="server" Text="Label"></asp:Label>
  25.         </p>
  26.         <asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChanged">
  27.             <asp:ListItem>Bora Stankovic</asp:ListItem>
  28.             <asp:ListItem>Franc Kafka</asp:ListItem>
  29.             <asp:ListItem>Milos Crnjanski</asp:ListItem>
  30.         </asp:RadioButtonList>
  31.         <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
  32.             <asp:ListItem>Dela</asp:ListItem>
  33.             <asp:ListItem>Necista krv</asp:ListItem>
  34.             <asp:ListItem>Uvela ruza</asp:ListItem>
  35.             <asp:ListItem>Bozji ljudi</asp:ListItem>
  36.         </asp:DropDownList>
  37.         <asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList2_SelectedIndexChanged">
  38.             <asp:ListItem>Dela</asp:ListItem>
  39.             <asp:ListItem>Odustani!</asp:ListItem>
  40.             <asp:ListItem>Prometej</asp:ListItem>
  41.             <asp:ListItem>Mala basna</asp:ListItem>
  42.         </asp:DropDownList>
  43.         <asp:DropDownList ID="DropDownList3" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList3_SelectedIndexChanged">
  44.             <asp:ListItem>Dela</asp:ListItem>
  45.             <asp:ListItem>Seobe</asp:ListItem>
  46.             <asp:ListItem>Dnevnik o Carnojevicu</asp:ListItem>
  47.             <asp:ListItem>Roman o Londonu</asp:ListItem>
  48.         </asp:DropDownList>
  49.         <p>
  50.             <asp:Label ID="Label4" runat="server" Text="Label"></asp:Label>
  51.         </p>
  52.     </form>
  53. </body>
  54. </html>
  55. //////////////
  56. /////////////////
  57. //////////////////
  58. using System;
  59. using System.Collections.Generic;
  60. using System.Linq;
  61. using System.Web;
  62. using System.Web.UI;
  63. using System.Web.UI.WebControls;
  64.  
  65. namespace Webprog
  66. {
  67.     public partial class WebForm1 : System.Web.UI.Page
  68.     {
  69.         protected void Page_Load(object sender, EventArgs e)
  70.         {
  71.             DropDownList1.Visible = false;
  72.             DropDownList2.Visible = false;
  73.             DropDownList3.Visible = false;
  74.         }
  75.  
  76.         protected void TextBox1_TextChanged(object sender, EventArgs e)
  77.         {
  78.  
  79.         }
  80.  
  81.         protected void Button1_Click(object sender, EventArgs e)
  82.         {
  83.             Label3.Text = "Zdravo, " + TextBox1.Text + " " + TextBox2.Text;
  84.         }
  85.  
  86.         protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
  87.         {
  88.             string x = RadioButtonList1.SelectedItem.Value;
  89.             if (x == "Bora Stankovic") DropDownList1.Visible = true;
  90.             if (x == "Franc Kafka") DropDownList2.Visible = true;
  91.             if (x == "Milos Crnjanski") DropDownList3.Visible = true;
  92.         }
  93.  
  94.         protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
  95.         {
  96.             Label4.Text = "Moja omiljena lektira je delo " + DropDownList1.SelectedValue + "  koje je napisao " + RadioButtonList1.SelectedItem.Value;
  97.         }
  98.  
  99.         protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
  100.         {
  101.             Label4.Text = "Moja omiljena lektira je delo " + DropDownList2.SelectedValue + "  koje je napisao " + RadioButtonList1.SelectedItem.Value;
  102.         }
  103.  
  104.         protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e)
  105.         {
  106.             Label4.Text = "Moja omiljena lektira je delo " + DropDownList3.SelectedValue + "  koje je napisao " + RadioButtonList1.SelectedItem.Value;
  107.         }
  108.     }
  109. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top