Button Click Event in ASP.NET C#

Button Click Event in ASP.NET C#

Nikhil Mittal | Coach |

5 лет назад

40,973 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Mudassir Akber
Mudassir Akber - 04.06.2023 06:06

Thank you

Ответить
M K
M K - 20.06.2022 23:52

<asp:Label ID="Label1" runat="server" Text="Ime"></asp:Label>
<asp:TextBox ID="tbIme" runat="server"></asp:TextBox>
<br />
<asp:Label ID="Label2" runat="server" Text="Prezime"></asp:Label>
<asp:TextBox ID="tbPrezime" runat="server"></asp:TextBox>
<br />
<asp:Label ID="Label3" runat="server" Text="E-mail"></asp:Label>
<asp:TextBox ID="tbEmail" runat="server"></asp:TextBox>
<br />
<asp:Label ID="Label5" runat="server" Text="Broj telefona"></asp:Label>
<asp:TextBox ID="tbBroj" runat="server"></asp:TextBox>
<br />
<asp:Button ID="btnUnesi" runat="server" Text="Ubaci" OnClick="btnUnesi_Click" />
<br />
<asp:Label ID="Label4" runat="server" Text="Ubaci broj reda"></asp:Label>
<asp:TextBox ID="tbK" runat="server"></asp:TextBox>
<br />
<asp:Button ID="btnObrisi" runat="server" Text="Obrisi" OnClick="btnObrisi_Click" />
<asp:Button ID="btnIzmeni" runat="server" Text="Izmeni" OnClick="btnIzmeni_Click" />
<br />
<br />
<asp:Label ID="Label6" runat="server" Text="Pretrazi"></asp:Label>
<br />
<asp:Label ID="Label7" runat="server" Text="Ime"></asp:Label>
<asp:TextBox ID="tbSearchIme" runat="server"></asp:TextBox>
<asp:Label ID="Label8" runat="server" Text="Prezime"></asp:Label>
<asp:TextBox ID="tbSearchPrezime" runat="server"></asp:TextBox>
<br />
<asp:Button ID="btnSearch" runat="server" Text="Search" OnClick="btnSearch_Click" />
<br />
<asp:Label ID="lblSearch" runat="server" Text=""></asp:Label>
<br />
<asp:Table ID="t1" runat="server"></asp:Table>

Ответить
M K
M K - 20.06.2022 23:49

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Imenik
{
[Serializable]
public class Imenik
{
private string ime;
private string prezime;
private string email;
private string broj;

public string Ime
{
get
{
return ime;
}

set
{
ime = value;
}
}

public string Prezime
{
get
{
return prezime;
}

set
{
prezime = value;
}
}

public string Email
{
get
{
return email;
}

set
{
email = value;
}
}

public string Broj
{
get
{
return broj;
}

set
{
broj = value;
}
}
}
}

Ответить
M K
M K - 20.06.2022 23:46

using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Grupa2
{
public partial class _Default : Page
{
int n;
protected void Page_Load(object sender, EventArgs e)
{

}

protected void Button1_Click(object sender, EventArgs e)
{
int suma = 0;
double sumaKvadrata = 0;
int sumaParnih = 0;
int sumaPrvihN = 0;
try
{
n = Int32.Parse(TextBox1.Text);
}
catch (Exception ex)
{
TextBox1.Text = "Pogresan unos!";
}
if(CheckBoxList1.Items[0].Selected)
{
for(int i = 0; i < n; i++)
{
suma += i;
}
TextBox2.Text += $"Suma od 1 do {n} je {suma}" +Environment.NewLine;
}
if(CheckBoxList1.Items[1].Selected)
{
for (int i = 0; i < n; i++)
{
sumaKvadrata += Math.Pow(i,2);
}
TextBox2.Text += $"Suma kvadarta od 1 do {n} je {sumaKvadrata}"+Environment.NewLine;
}
if (CheckBoxList1.Items[2].Selected)
{
for (int i = 0; i < n; i++)
{
if(i % 2 == 0)
{
sumaParnih += i;
}
}
TextBox2.Text += $"Suma parnih od 1 do {n} je {sumaParnih}"+Environment.NewLine;
}
if (CheckBoxList1.Items[3].Selected)
{
int j = 0;
int i = 0;
while (j <= n)
{
if(i % 2 == 0)
{
sumaPrvihN += i;
j++;
}
i++;
}
TextBox2.Text += $"Suma prvih {n} je {sumaPrvihN}"+Environment.NewLine;
}
}
}
}

Ответить
Lorfv
Lorfv - 02.06.2022 21:19

thank you friend!

Ответить
Muhammad Afzal
Muhammad Afzal - 10.10.2021 16:16

Everything is disturbing in this video

Ответить
SigmaShorts
SigmaShorts - 13.04.2021 11:52

Good

Ответить
Nikita Khalane
Nikita Khalane - 17.03.2021 16:23

Thank you so much sir you help me to solve my big problem

Ответить
Nairi Areg
Nairi Areg - 15.06.2020 00:06

Cool desktop wp

Ответить