Professional Documents
Culture Documents
– InnerHtml: Enables you to specify content that can include HTML elements to be placed between
the opening and closing tags of the specified control.
– InnerText: Enables you to specify raw text to be placed between the opening and closing tags of
the specified control.
HtmlGenericControl Class
– Using the HtmlGenericControl class, you can get server-side access to the <meta>, <p>, <span>, or
other elements that would otherwise be unreachable.
MANIPULATING PAGES AND SERVER CONTROLS
WITH JAVASCRIPT
• Apply JavaScript directly to the controls on your ASPX
page.
• Using Page.ClientScript.RegisterClientScriptBlock
– The RegisterClientScriptBlock method allows you to place a
JavaScript function at the top of the page.
– RegisterClientScriptBlock(type, key, script, script tag specification)
MANIPULATING PAGES AND SERVER
CONTROLS WITH JAVASCRIPT (CONT..)
• Using Page.ClientScript.RegisterStartupScript
– RegisterStartupScript places the script at the bottom of the ASP.NET
page instead of at the top.
– RegisterStartupScript(type, key, script, script tag specification)
• Using Page.ClientScript.RegisterClientScriptInclude
– You can register the script files on your ASP.NET pages using the
RegisterClientScriptInclude method.
– Page.ClientScript.RegisterClientScriptInclude(type, key, url)
COMPARING A TYPICAL POSTBACK TO A
CALLBACK
• Postback
– A postback occurs when a request is sent from the client to the
server for the same page as the one the user is currently viewing.
– When a postback occurs, the entire page is refreshed.
• Callback
– A callback occurs when a request is sent from the client to the
server for which the page is not refreshed.
– Only a part of it is updated without any flickering occurring on
the browser
COMMON PROPERTIES
• Access Key
– Alt + key.
• Attributes
– Enables you to define additional attributes for a Web server control that are not defined by
a public property.
• Disabled
– Allows you to get or set whether the control is disabled using a Boolean value.
• Visible
– Specifies whether the control is visible on the generated page.