|
Accessing user controls from the code-behind
|
Total Hit (2845) |
When you add a user control to an ASP.NET page, Visual Studio .NET does not add a control declaration as it does when you add standard ASP.NET web controls. The result is that you can't directly access the user control from the code-behind and programmatically change its properties and call its meth
....Read More |
Rating
|
|
|
|
Creating a scrollable DataGrid
|
Total Hit (2923) |
When you create a DataGrid, it would be often good to specify its height, and have the DataGrid show a scrollbar if the content is longer than the given height. This would allow to make up a fixed layout that doesn't get messed up if there are a few or a lot of lines/records to show. The DataGrid co
....Read More |
Rating
|
|
|
Hiding controls defined within templates to some users
|
Total Hit (2703) |
It happens frequently that you want to hide some input controls or links if the current user is not logged in (it runs with the anonymous account), or if the logged user is not a member of a specific group. For example, you may want to hide the Edit/Delete buttons to users that are not Administrator
....Read More |
Rating
|
|
|
Implementing a two-way sorting for the DataGrid control
|
Total Hit (2691) |
DataGrid's sorting functionality is not automatic, the control takes care of "just" rendering the column headers as hyperlinks, and gives you the ability to handle the click on those links, by means of the SortCommand event. Then you manually sort the records (by means of a new DataView from an exis
....Read More |
Rating
|
|
|
Moving the focus on a control when the page loads
|
Total Hit (2613) |
ASP.NET doesn't provide a built-in method for giving a control the input focus when the page loads. In fact, you can assign the TabIndex properties to controls on a page, but you can't use this property to set the initial focus on a control of your choice.
The following procedure provides you wit
....Read More |
Rating
|
|
|
Showing a graphical checkmark on DataGrid's boolean columns
|
Total Hit (2710) |
While working with template-based controls such as the Repeater, DataList or DataGrid, it often happens that you don't want to show just plain text as it is retrieved from the data source, but want to interpret the data and represent it in other ways. For example, you may want to show a graphical ch
....Read More |
Rating
|
|
|
|
|
|
|
|
|
|
|
|
|
Injecting Client-Side Script from an ASP.NET Server Control
|
Total Hit (1229) |
While, technically, all of an ASP.NET server control's functionality can be performed on the server-side, often the usability of a server control can be greatly enhanced by adding client-side script. In this article we'll examine two means by which server controls can emit client-side script. We'll
....Read More |
Rating
|
|
|
Using the TreeView IE Web Control
|
Total Hit (1233) |
Learn about the TreeView Web control and how to start using it in your ASP.NET Web applications. In addition to the standard ASP.NET Web controls (like the TextBox, DropDownList, DataGrid, DataList and so on) Microsoft has released an additional set of Web controls designed to take advantage of feat
....Read More |
Rating
|
|
|
Displaying XML Data in the Internet Explorer TreeView Control
|
Total Hit (1087) |
You have to tip your hat to Microsoft when it comes to the amount of free developer resources they have made available for us ASP.NET developers. First, there was the Web Matrix Project, a free GUI/RAD tool designed specifically for creating ASP.NET Web pages. Then the ASP.NET team provided the comp
....Read More |
Rating
|
|
|
|
|
|
Using the CustomValidator Control
|
Total Hit (2803) |
One annoying task that most every developer has had to face in the past is form validation. Since forms are an integral part of dynamic, data-driven Web sites, it is essential that a user's query into a form fit the specified guidelines. For example, in a Web site like Amazon.com where users are ent
....Read More |
Rating
|
|
|
|
Adding controls to PlaceHolders dynamically
|
Total Hit (1057) |
A very powerful and flexible way to program sites in ASP.NET is to one .aspx which contains a PlaceHolder control for each area of your screen. You then dynamically fill these controls during each hit of your page. This code will get you started. Notice the "FindControl" method with which you identi
....Read More |
Rating
|
|
|
Simple Login Control
|
Total Hit (1134) |
This control can be used to validate a user's login. This control is compiled as a library and can be used with any ASP .Net application.
|
Rating
|
|
|
Finding the Control ID
|
Total Hit (1012) |
How do you find the control ID of the control that made the Postback? Here you go...
|
Rating
|
|
|
|
HOW TO: Close Browser Window From Button Web Control
|
Total Hit (842) |
Generally we want to perform tasks like closing browser window from client side JavaScript itself. However, there might be cases when we should perform some another processing - may be logging or usage tracking - when user explicitly closes the application. This How To will tell you how to code serv
....Read More |
Rating
|
|