ASP.NET

1. ASP.NET Introduction 2. Comp of .Net Framework 3.5 3. Sys.Req for VS 2008 4. ASP.NET Envrmnt Setup 5. VS2010 Ultimate Sys.Req 6. Installing VS 2010 7. VS 2012 Sys.Req 8. Installing VS Exp 2012 9. Start the VS 2008 10. Application Life Cycle 11. Page Life Cycle 12. Page Life Cycle Events 13. ASP.NET Example 14. Event Handling 15. Default Events 16. Server Side 17. Request Object 18. Response Object 19. Server Controls 20. Server Controls Properties 21. Server Controls Methods 22. HTML Server Controls 23. Client Side 24. ASP.NET Basic Controls 25. TextBox Control 26. CheckBox Controls 27. RadioButton Controls 28. ListBox Control 29. HyperLink Control 30. Image Control 31. BulletedList Control 32. ASP.NET Directives 33. Implements Directive 34. Master Type Directive 35. Page Directive 36. PreviousPage Type 37. Managing State 38. Control State 39. Cookies 40. Query Strings 41. Server-Side State 42. Session State 43. Validation Controls 44. Required FieldValidator 45. Range Validator 46. Compare Validator 47. RegularExpressionValidator 48. Custom Validator 49. Validation Summary 50. Data Source Control 51. AdRotator Control 52. Calendar Control 53. Calendar Control Example 54. Panel Control 55. Panel Control Example 56. Multi Views Control 57. MultiView & View controls 58. MultiView Control Example 59. FileUpload Control 60. FileUpload Control Eg 61. AJAX Control 62. UpdatePanel control 63. UpdateProgress Control 64. Custom Controls 65. Custom Control Eg 66. Personalization 67. Create Simple Profile 68. ADO.NET 69. ADO.NET Objects 70. DataTable 71. DataRow 72. DataColumn 73. Object Example 74. Error Handling 75. Tracing Errors 76. Debugger 77. Security 78. Authentication 79. Authorization 80. LINQ 81. LINQ Query Operators 82. LINQ Example 83. Caching 84. Data Caching 85. Output Caching 86. Object Caching 87. Web Services 88. Create Web Services Eg 89. Web & Machine.config 90. Settings Schema 91. ASP.NET Deployment 92. XCopy Deployment 93. Web Setup Project 94. ASP Interview Part 1 95. ASP Interview Part 2 96. ASP Interview Part 3 97. ASP Interview Part 4 98. ASP Interview Part 5 99. ASP Interview Part 6
Pr.Pg Next Pg

Methods of the Server Controls tutorials

  • The following table provides the methods of the server controls:

 

Method

Description

AddAttributesToRender

Adds HTML attributes and styles that need to be rendered to the specified HtmlTextWriterTag

AddedControl

Called after a child control is added to the Controls collection of the Control object

AddParsedSubObject

Notifies the server control that an element, either XML or HTML, was parsed, and adds the element to the server control's control collection

ApplyStyleSheetSkin

Applies the style properties defined in the page style sheet to the control.

ClearCachedClientID

Infrastructure. Sets the cached ClientID value to null

ClearChildControlState

Deletes the control-state information for the server control's child controls

ClearChildState

Deletes the view-state and control-state information for all the server control's child controls

ClearChildViewState

Deletes the view-state information for all the server control's child controls

CreateChildControls

Used in creating child controls.

CreateControlCollection

Creates a new ControlCollection object to hold the child controls

CreateControlStyle

Creates the style object that is used to implement all style related properties

DataBind

Binds a data source to the server control and all its child controls

DataBind(Boolean)

Binds a data source to the server control and all its child controls with an option to raise the DataBinding event

DataBindChildren

Binds a data source to the server control's child controls.

Dispose

Enables a server control to perform final clean up before it is released from memory

EnsureChildControls

Determines whether the server control contains child controls. If it does not, it creates child controls.

EnsureID

Creates an identifier for controls that do not have an identifier

Equals(Object)

Determines whether the specified Object is equal to the current Object

Finalize

Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.

FindControl(String)

Searches the current naming container for a server control with the specified id parameter

FindControl(String, Int32)

Searches the current naming container for a server control with the specified id and an integer

Focus

Sets input focus to a control.

GetDesignModeState

Gets design-time data for a control

GetType

Gets the Type of the current instance

GetUniqueIDRelativeTo

Returns the prefixed portion of the UniqueID property of the specified control

HasControls

Determines if the server control contains any child controls

HasEvents

Indicates whether events are registered for the control or any child controls.

IsLiteralContent

Determines if the server control holds only literal content

LoadControlState

Restores control-state information

LoadViewState

Restores view-state information

 

MapPathSecure

Retrieves the physical path that a virtual path, either absolute or relative, maps to

MemberwiseClone

Creates a shallow copy of the current object

MergeStyle

Copies any nonblank elements of the specified style to the Web control, but will not overwrite any existing style elements of the control.

OnBubbleEvent

Determines whether the event for the server control is passed up the page's UI server control hierarchy

OnDataBinding

Raises the data binding event

OnInit

Raises the Init event

OnLoad

Raises the Load event

OnPreRender

Raises the PreRender event

OnUnload

Raises the Unload event

OpenFile

Gets a Stream used to read a file

RemovedControl

Called after a child control is removed from the Controls collection of the Control object

Render

Renders the control to the specified HTML writer

RenderBeginTag

Renders the HTML opening tag of the control to the specified writer

RenderChildren

Outputs the content of a server control's children to a provided HtmlTextWriter object, which writes the content to be rendered on the client

RenderContents

Renders the contents of the control to the specified writer

RenderControl(HtmlTextWriter)

Outputs server control content to a provided HtmlTextWriter object and stores tracing information about the control if tracing is enabled

RenderEndTag

Renders the HTML closing tag of the control into the specified writer

ResolveAdapter

Gets the control adapter responsible for rendering the specified control

SaveControlState

Saves any server control state changes that have occurred since the time the page was posted back to the server

SaveViewState

Saves any state that was modified after the TrackViewState method was invoked

SetDesignModeState

Sets design-time data for a control

ToString

Returns a String that represents the current object

TrackViewState

Causes the control to track changes to its view state so they can be stored in the object's view state property

Example:

ListControl.aspx Code:

 

Following simple example shows the use of ASP.NET Server Controls (List Control (ListControl)).

Sam Sir

 

using System;

using System.Collections;

using System.Configuration;

using System.Data;

using System.Linq;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.HtmlControls;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Xml.Linq;

 

public partial class ListControl : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

String[] myStringArray = new String[] { "One", "Two", "Three" };

rptr.DataSource = myStringArray;

rptr.DataBind();

}

}

 

 

 

ListControl.aspx Code:

 

Following simple example shows the use of ASP.NET Server Controls (List Control (ListControl)).

Sam Sir

 

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ListControl.aspx.cs" Inherits="ListControl" %>

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

<title>cbtSAM ASP.NET List Control Example</title>

</head>

<body>

<form id="form1" runat="server">

<div>

<asp:repeater id=rptr runat="server">

<itemtemplate><%# Container.DataItem %><br></itemtemplate>

</asp:repeater>

</div>

</form>

</body>

</html>

Output

 

 

One

Two

Three


Pr.Pg border                                              Next Pg