ASP.NET Controls

📘 ASP.NET Controls


🔹 ASP.NET Controls

(the common property of every control is Text)


🔹 Controls and Their Properties / Events

  1. Button → Text

  2. Link Button → Text, PostBackUrl

  3. Hyperlink → Text, NavigateUrl

  4. Image Button → ImageUrl, PostBackUrl


🔹 5) Radio Button List

  • Property → SelectedIndex

  • Used to select one option at a time

Implementation:

[QUIZ]

  • It has index system

  • The first option is assigned 0th position


🔹 6) MultiView

  • Property → ActiveViewIndex (by default -1)

MultiView Control is used to display multiple content in a single page.

Using Control:

  • Drag and drop MultiView control from toolbox

  • By default ActiveViewIndex = -1 (blank memory)

  • Insert required number of View controls

  • Change ActiveViewIndex to 0


🔹 7) DropDownList

  • Event → IndexChanged

We can add data using two methods:


1) Using Controls

  • Select DropDownList Control

  • Click on Mastertag

  • Dialog box opens → Add items

Note: Index starts from 0


2) Using Code

DropDownList1.Items.Add(TextBox1.Text);
  • Items → It is an array (words ending with 's' are considered as array in .NET)

  • Add → Function

Any text written in TextBox1 will be added to DropDownList1


Comments

Popular posts from this blog

Introduction To HTML

Data Binding Functions

Export GridView to Excel