Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="AV2._Default" %>
- <asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
- <div class="jumbotron">
- <h1>Internet Techonology</h1>
- </div>
- <div class ="row">
- <div class="col-md-12 text-center">
- <div class="m-3">
- Изберете град
- <br/>
- <asp:ListBox ID="ListaGradovi" runat="server">
- <asp:ListItem Value="0">Скопје</asp:ListItem>
- <asp:ListItem Value="50">Велес</asp:ListItem>
- <asp:ListItem Value="200">Охрид</asp:ListItem>
- </asp:ListBox>
- </div>
- <div class="m-3">
- <asp:Button ID="PrikaziGrad" runat="server" Text="Прикажи град" OnClick="PrikaziGrad_Click" />
- </div>
- <div class="m-3">
- Селектираниот град е : <asp:Label ID="SelektiranGrad" runat="server" Text="none"></asp:Label>
- </div>
- <div class="m-3">
- Оддалеченоста од Скопје е : <asp:Label ID="Oddalecenost" runat="server" Text="none"></asp:Label>
- </div>
- </div>
- </div>
- </asp:Content>
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- namespace AV2
- {
- public partial class _Default : Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- }
- protected void PrikaziGrad_Click(object sender, EventArgs e)
- {
- ListItem selectedItem = ListaGradovi.SelectedItem;
- SelektiranGrad.Text = selectedItem.Text;
- Oddalecenost.Text = selectedItem.Value;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement