ASP.NET is a development framework for building web pages and web sites with HTML, CSS, JavaScript and server scripting. ASP.NET supports three different development models: Web Pages, MVC (Model View Controller), and Web Forms.
Wednesday, January 14, 2009
BulletedList Example in Web Application
HTML Code:
OutPut:
C# Source Code:
protected void Page_Load(object sender, EventArgs e)
{
if(! Page.IsPostBack)
Label1.Text = "Page is loaded first time.";
else
Label1.Text = "PostBack operation performed by clicking the link button";
}
Adding Items in ListBox
OutPut:
HTML Code:
C# Source Code:
int HiddenValue;
protected void Button1_Click(object sender, EventArgs e)
{
HiddenValue = Convert.ToInt32(HiddenField1.Value.ToString());
ListBox1.Items.Add("Item " + HiddenValue.ToString());
Label4.Text = HiddenValue.ToString();
HiddenValue = HiddenValue + 1;
HiddenField1.Value = HiddenValue.ToString();
}
protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
{
TextBox1.Text = ListBox1.SelectedItem.Text.ToString();
}
HTML Code:
C# Source Code:
int HiddenValue;
protected void Button1_Click(object sender, EventArgs e)
{
HiddenValue = Convert.ToInt32(HiddenField1.Value.ToString());
ListBox1.Items.Add("Item " + HiddenValue.ToString());
Label4.Text = HiddenValue.ToString();
HiddenValue = HiddenValue + 1;
HiddenField1.Value = HiddenValue.ToString();
}
protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
{
TextBox1.Text = ListBox1.SelectedItem.Text.ToString();
}
TextBox Example in Web Application
OutPut:
HTML Code:
C# Code:
protected void Button1_Click(object sender, EventArgs e)
{
TextBox1.Text = "You have clicked the button";
TextBox4.Text = "This is a multi line textbox. This is a multi line textbox. This is a multi line textbox. This is a multi line textbox. ";
TextBox3.Text = TextBox2.Text;
}
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
TextBox1.Text = "The Text is changed.";
}
HTML Code:
C# Code:
protected void Button1_Click(object sender, EventArgs e)
{
TextBox1.Text = "You have clicked the button";
TextBox4.Text = "This is a multi line textbox. This is a multi line textbox. This is a multi line textbox. This is a multi line textbox. ";
TextBox3.Text = TextBox2.Text;
}
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
TextBox1.Text = "The Text is changed.";
}
Subscribe to:
Posts (Atom)
Using Authorization with Swagger in ASP.NET Core
Create Solution like below LoginModel.cs using System.ComponentModel.DataAnnotations; namespace UsingAuthorizationWithSwagger.Models { ...
-
Output: using Microsoft.VisualBasic; using System; using System.Collections; using System.Collections.Generic; using S...
-
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.D...
-
<?xml version="1.0" encoding="utf-8"?> <Report xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting...