![]() |
|
|
Creating a Dynamic Data-Driven User Interface (Part 3)
This article is the third installment of a four-part series that examines how to build a data-driven web applications that offers dynamic
user interfaces. Over the past two articles we created a sample web application that allows for numerous law firms to log in to the site and
manage their clientele. The application's data model contains a
Part 1 examined the scope of the project and created the data model, while
Part 2 showed how to allow customers (law firms) to define their custom client
attributes. In this installment we create the web pages for managing clients. This includes two pages: one page to create new clients and manage
their fixed attributes, and a second page to manage their custom attributes. Read on to learn more!
Creating a Dynamic Data-Driven User Interface (Part 2) This article is the second installment of a four-part series that examines how to build a data-driven web applications that offers dynamic user interfaces. Over the course of this article series we will build a complete and functional web application with a dynamic, data-driven user interface. Specifically, the demo application is a fictional website used by numerous law firms to manage their clientele.
The application uses both a fixed and dynamic data model for law firms to manage their clients. The
Part 1 examined the scope of the project and created the data model.
In this installment we create the web pages used by the law firms to define the custom client attributes. Read on to learn more!
Creating a Dynamic Data-Driven User Interface (Part 1) Most data-driven web applications have a fixed data model and user interface. What I mean by "fixed" it that the data it needs to be captured is known in advance. Consequently, the database's tables are created before a single line of code is written and the application's user interfaces are dictated by this pre-determined data model. While most applications work with a fixed data model there are scenarios where the parts of the data model need to be defined by the end user. Such applications are more difficult to create because both the data model and user interface need to be flexible enough to allow the user to specify the information to be captured.
Imagine that you were creating a web application to be used by small law firms for managing their clientele. You would need a database table
to capture information about each client. This table would have columns for each attribute of a client, such as:
This article is the first in a four-part series of articles examine how to build a data model and user interface to allow for such dynamic, data-driven
websites. In this installment we look at how to capture such dynamic, end user-defined information in the database. Read on to learn more!
Creating a Databound Label Control ASP.NET includes a number of data source and data Web controls that make it remarkably easy to work with data from a web page. For example, to display the results of a database query simply add and configure a SqlDataSource control and then bind that to a GridView, ListView, or some other data Web control. There's no need to write any source code; the data source controls allow declarative access to data. For more information on working with data in ASP.NET see my Accessing and Updating Data in ASP.NET article series and Working with Data tutorials. The GridView and ListView controls are great for displaying a set of records, while the DetailsView and FormView controls are ideal for displaying information about a single record. There are times where we only need to display a single column from a single record. While you can certainly use the DetailsView or FormView controls for this, it would be easier to use a Label Web control. However, the Label control does not natively support data binding. As a result, to display a database needed in a Label Web control you need to write code (or put the Label in a FormView templates or a DetailsView TemplateField).
The good news is that the .NET Framework offers appropriate base classes that we can extend to build a databound Label Web control.
This article shows how to create and use such a control. The control, which I named DataboundLabel, and its complete source code is available for
download at the end of this article, along with a demo of the control in use. Read on to learn more!
Displaying a Message in Response to Some Action and Then Hiding It on Subsequent Postbacks
ASP.NET web pages commonly display messages in response to user actions. For instance, a typical CRUD
(Create, Read, Update, Delete) web page might display the message, "Record deleted" immediately after deleting a record and the message "Record updated"
immediately after updating a record. Likewise, there would be messages displayed for inserting a new record and messages displayed in the event of an error.
Such messages are typically displayed using a single Label Web control. This control may be located at the top of the page and have its
The problem with this approach is that the Label's
There are two simple and straightforward techniques at our disposal for implementing such functionality. This article examines these two approaches
and includes a working demo available for download that highlights both approaches. Read on to learn more!
Helping Visitors Search Your Site By Creating an OpenSearch Provider One of the nicest features of modern browsers like Mozilla Firefox and Microsoft Internet Explorer is the search bar in the upper right corner. With this tool you can quickly search any number of websites without having to first visit their search page.
This functionality is most commonly used to search the Internet using search engines like Google or Live.com. I recently was reading
Scott Hanselman's blog and found an
interesting entry on how to let your visitors add your website to their search bar. In a nutshell, you need to provide information on how to search
you site in an XML file according to the OpenSearch standard. Next, reference this file in the
Using this technology you can create a custom search provider for your website that your visitors can add to their browser search bar. Once added,
users can search your website directly from their browser search bar, just like they can search Google or other search engines from the same interface.
This article shows how to create an XML file that conforms to the OpenSearch standard and how to link to it from pages in your website.
Read on to learn more!
Examining ASP.NET 2.0's Membership, Roles, and Profile - Part 12
Several of the earlier installments in this article series examined how to apply authorization rules in order to prohibit particular users, roles,
or classes of users from accessing particular resources. For instance, Part 2
showed how to define URL-based authorization rules in
The URL-based authorization, LoginView control, and programmatic techniques can be used in tandem to ensure that a user does not visit a page or
perform some operation if she is not authorized. But what if you forget to implement one of these safeguards? For example, imagine that you have a web
page that includes a button that, when clicked, perform some task that is only intended for administrators. You could put this button in a LoginView
control or you could use programmatic techniques to ensure that only users in the appropriate role (say,
To reduce the likelihood of such security mishaps, the .NET Framework includes capabilities for declaratively asserting permissions (via attributes) on
methods and classes. In a nutshell, you can add such attributes to ASP.NET pages, their code-behind classes, and your business logic and data access layers.
With these attributes in place, your visitors will be barred from performing unauthorized actions, regardless of whether there are any security holes in the
user interface. Read on to learn more!
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
![]() |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||