Page 26 - DCAP312_WEB_TECHNOLOGIES_II
P. 26
Web Technologies-II
Notes Custom Control Syntax
There are two different kinds of custom controls. On the one hand there are the controls that
ship with .NET, and on the other hand you can create your own custom controls. Using custom
server controls is the best way to encapsulate common programmatic functionality.
Just specify elements as you did with HTML elements, but add a tag prefix, which is an alias for
the fully qualified namespace of the control. Again you must include the runat=server attribute.
If you want to get programmatic access to the control, just add an Id attribute.
You can include properties for each server control to characterize its behavior. For example,
you can set the maximum length of a TextBox. Those properties might have sub properties; you
know this principle from HTML. Now you have the ability to specify, for example, the size and
type of the font you use (font-size and font-type).
The last attribute is dedicated to event binding. This can be used to bind the control to a specific
event. If you implement your own method MyClick, this method will be executed when the
corresponding button is clicked if you use the server control event binding shown in the slide.
Data Binding Expression
You can create bindings between server controls and data sources. The data binding expression
is enclosed by the character sequences <%# and %>. The data binding model provided by ASP.
NET is hierarchical. That means you can create bindings between server control properties and
superior data sources.
Server-side Object Tags
If you need to create an instance of an object on the server, use server-side object tags. When
the page is compiled, an instance of the specified object is created. To specify the object use the
identifier attribute. You can declare (and instantiate) .NET objects using class as the identifier,
and COM objects using either progid or classid.
Server-side Include Directives
With server-side include directives you can include raw contents of a file anywhere in your ASP.
NET file. Specify the type of the path to filename with the pathtype attribute. Use either File,
when specifying a relative path, or Virtual, when using a full virtual path.
Server-side Comments
To prevent server code from executing, use these character sequences to comment it out. You
can comment out full blocks not just single lines.
Prepare a list to show all the languages used in .NET environment.
Online Banking Solution Benefits after ASP.NET MVC
Replaces Ruby on Rails, Linux
waala created its MoneyTracker online personal finance management solution using Ruby
on Rails development tools for deployment on a Linux operating system, Apache Web
Jserver, and MySQL stack. When the company found that its banking and credit union
customers, who use MoneyTracker to give users a richer online banking experience, were
more comfortable with the Microsoft Application Platform, Jwaala rewrote its application
Contd...
20 LOVELY PROFESSIONAL UNIVERSITY