Tutorials to .com

Tutorials to .com » Dotnet » Control-and-components » Introduced with a free data display / entry / update / delete function in asp.net control

Introduced with a free data display / entry / update / delete function in asp.net control

Print View , by: iSee ,Total views: 12 ,Word Count: 3148 ,Date: Wed, 20 May 2009 Time: 10:04 PM

I can not say it better than the datagrid, because there are many deep-seated datagrid things we can explore, but I can use it more than the datagrid, but also practical, because it has been easy to achieve the following functions, at the same time, it is completely free, non - required to be registered, there is no limitation of function.

1, through the attribute data table display
2, client-side data sorting
3, various types of formatting fields show
4, all data tables built-in data easily add, update, delete function
5, the support provided by the password field and use 32-bit MD5 encoding
6, add, update the image field, links to documents automatically upload field
7, can upload pictures automatically generated thumbnails
8, add, update automatically when data generated client authentication (null authentication, verify the maximum number of characters, to verify a digital format, date format validation, email verification)
9, automatic date / time field using the date picker (javascript), Automatic numerical figures practical field selector
10, a built-field generation process images directly show the image field
11, can be custom built detailed View Page
12, has entered the filter parameters to prevent injection attacks sqlserver
13, to prevent the non-submission of this page
14, automatic paging technology, which reduces the amount of query data return
15, provided the total value of the built-in function fields
16, data table directly export EXCEL format
17, add a record to specify the use of HTML editors out
18, directly to the operation SQLSERVER
19, support for stored procedures
20, double-header show
21, sub-table shows the
22, built the inquiry
23, for each click on a column generation events
24, the right mouse button function
25, 21 kinds of built-in practical style
26, the first line can be generated directly Checkbox or Radio
27, a variety of data tables display mode (data sheets, thumbnails, statements)

More features can not describe. The following is a simple application of the control Description:

One used for the first time
1. DTABLE.DLL files to copy to the project's bin directory
2. As with other third-party control, in the custom to add the control toolbox
3. To the control and drag it to the appropriate location of the page
4. To re-generate some items, you can find that you can now visit the northwind database of employee data sheet
5. If you develop the machines have permission to aspnet user access northwind database, then your page on the default of data showing that the employees table, otherwise it will prompt you do not have permission to access the database.

Second, you need to immediately show the data table
1, DTABLE display control data table is set up to rely on attributes. Under normal circumstances, it has some of the properties of the default value. If you feel that it is not shown in the results you need, then please change the attributes related to access to the results you need.
2, first of all, you need to specify three attributes, so as to immediately display your data sheets.
a) the database connection string attribute DataConnectString.
Use settings such as:
DTable1.DataConnectString = "data source = localhost; integrated security = sspi; initial catalog = mydatabase";
Of course, you can pre-package to link to other forms of string or a global variable. Such as:
DTable1. DataConnectString = Include.datastr;

b) the name of the data in table TableName.
Use settings such as:
DTable1.TableName = "user_tb";

c) data query List_SqlText list
Use settings such as:
DTable1.List_SqlText = "select * from user_tb";

3, OK, if you Page_load events in the definition of the above three properties, then you can regenerate immediately after the definition of your data table list, and automatically give you the definition of DTABLE table style staggered line, TITLE style and page the columns, rows, such as the first serial number.
4, you can now double-click the link to the first column, you can immediately see why the field trip information. Of course, this is the default DTABLE allows the results of a detailed view, you can also shut down, or their own definition of need in the detailed view of the field and the field shows the name of ... ... the type conversion as well as field and so on.

Third, immediately have a record to update, add, delete, function without the need for the preparation of other code. You need to do is set up more than three attributes.
1. To allow the built-in update feature: AE_EnableEdit
Settings: DTable1. AE_EnableEdit = true;

a) how to use the built-in update feature?
When the built-in update feature to allow the future, data will appear automatically list data "update button", that is, you click the button to update the list to enter the state.
b) How do I change the data to update the appearance of the button?
By setting the property: AE_EditButton_Htm to define the style of the Update button. For example, the update button for a picture edit.gif as follows:
DTable1. AE_EditButton_Htm = "<img src=images/edit.gif border=0>"
c) how to define fields that need to be updated?
By default, records updated interface will list all the fields of the table. Property can be updated through an interface displayed fields: AE_FieldList, such as:
DTable1. AE_FieldList = "id, name, age, sex"
At this point, update the interface on the list only name, age, gender, provided that three changes in the data field.
d) update the interface record any difference between the two?
DTABLE in the record to update the interface to provide a large number of easy-to-use features to enhance the effectiveness of data entry and the entry speed. For example: It automatically provides the date of the date field selector (click to open selector), the provision of automatic numerical field calculator (double-click open the calculator). Moreover, DTABLE automatically generate the number of client, date, the largest number of characters, the test does not allow null value.
e) update on the safety record
DTABLE built to prevent the function of cross-page submission, namely: the system only to the physical page to update the data, from any other page, even if the site pages from the data submitted to update the prohibition. At the same time, DTABLE also provided the anti-repeat function, you can not use the refresh function to repeatedly submit data.
f) How to limit the conditions for updates?
You can set the attribute to update the data meet certain rules must be data. For further information, please see the back of record updates and add advanced applications.
2. To allow the built-in delete function: AE_EnableDelete
Settings: DTable1. AE_EnableDelete = true;
a) how to use the built-in delete function?
When you allow the built-in delete function, the data sheet will automatically add a button to delete.
b) How do I change the delete button style?
By setting an attribute to define the appearance of the Delete button: AE_DeleteButton_Html such as:
DTable1. AE_DeleteButton_Html = "<img src=images/delete.gif border=0>"
c) how to ensure that the deletion of the security features?
Update records with the same built-in, DTABLE banned cross-page submission to delete a command. It also provides other restrictions to prohibit illegal deleted. Please record the details of updates, add, delete articles of advanced applications.
3. To allow records to add: AE_EnableAddNew
Settings: DTable1. AE_EnableAddNew = true;
a) how to add the state to enter the record?
By visiting the current page + parameters to add the interface to access records. Of course, the premise is: you have to add functionality to allow record. Such as:
The link attached to the back of the above-mentioned parameters:? Addnew = true to add the interface into the record. If you do not add functionality to allow record will not be added into the recording interface, but direct access to the data list display.
b) how to add the definition of the field records?
As the definition of the field when the record is more like: AE_FieldList, such as:
DTable1. AE_FieldList = "id, name, age, sex"
Add and update records with an attribute used to define the needs of the field show.
c) how to add the definition to ensure that the safety record?
Updated with the records.
d) DTABLE add the record of the difference between the two?
Updated with the records.

Fourth, the definition of their own data table shows the 1, the definition of different types of data display
a) Boolean field
Boolean field in SQLSERVER for bit type, allowed values are 1 and 0. If we want to show the data tables Boolean fields, then the system may display the default true and false. DTABLE provides a definition of this attribute boolean conversion: List_FormatBoolReplace_No For example: we want a query select id, name, age, sex, current salaries, recent photograph, certificates from user_tb the picture to return to record words Boolean the words "gender" with "M" and "female", you can set the attribute DTable1. List_FormatBoolReplace_No = "3 | M | F" can be.
Of course, the query can also set up a direct replacement.
b) to preserve the image of the field path
By setting an attribute to tell DTABLE, a field belonging to save the picture path of the field, DTABLE will automatically use the path to a picture to label. Such as: DTable1.List_UrlImage_No = "| 6 |";
Of course, if there are multiple such fields can be set directly: DTable1. List_UrlImage_No = "| 6 | 7 |";
Please note: This number refers to the number of data columns list the serial number is displayed, and the first column of the query will not be displayed (as a unique identifier to use).
c) the monetary field
Through two simple monetary field attribute display:
List_FormatCur_No the definition of the need for currency format as the field sequence, the same field to allow the display of multiple currencies, set up, such as: DTable. List_FormatCur_No = "| 4 | 6 | 7"; namely: the first field are 4,6,7 monetary field, by currency format.
Another definition of the currency attribute prefix displayed: List_FormatCur_str, the RMB is set to: DTable1. List_FormatCur_str = "¥"; dollars should be on how to set up I do not have to repeat it, right?
d) built-in binary image field
DTABLE allow direct images show the built-in binary fields. But it is not automatically started to show, you'll need the following operation to the normal display:
1. The definition of the binary images of the listed fields: Test_ImgFieldName namely: DTable1. Test_ImgFieldName = "diploma picture";
2. The definition of binary images for viewing the file name field. The file name is the system will automatically generate a document. If your current directory is only one page will be used directly to view binary image field, you can not define this attribute. Because it has a default definition. This property is Test_ShowImg_FileName, you can define a file name: DTable1. Test_ShowImg_FileName = "showimg.aspx";
3. To generate the file. By visiting: the path of the current page + parameters to generate the page immediately. Such as: access
showimg.aspx to generate http://localhost/test/test.aspx?MakeShowImgFile=True the document.
If you listed the definition of the Chinese, you may need to use the editor to open showimg.aspx, to which the listing is incorrect to correct you.
4. The above three steps are usually needed only once. Finally, you define a property to tell which field is DTABLE binary image field: List_Image_No such as:
DTable1. List_Image_No = "| 5 | 9 | 12 |"; namely: the first column 5,9,12 fields are binary images. By then, the data table automatically uses the label to achieve this: <img src=showimg.aspx?id=xxx>

The following are the controls in the data entry, update, delete in the application of a simple note:

First, enter the data add, update the status

1, add the interface to enter data

By visiting the current page + parameters to add the state to enter the data. For example, the name of the current page: showdtable.aspx, then add the interface to enter the path should be http://yoursite/aspnetapplication/showdtable.aspx?addnew=true
You can hyperlink, image link, button actions to access the page.
Of course, the premise is that you must be allowed to add data: DTable1.AE_EnableAddNew = true;

2, to enter data to update the interface

Interface to enter data to update a number of ways.

1) through the built-in update button to enter the updated interface
To open the built-in update button, it is necessary to set an attribute: DTable1. AE_EnableEdit = true;
The attribute is defined: to allow the built-in update feature records. At this time will automatically show the data tables records updated to add links by clicking on the link to enter the record to update the interface.
Related attributes:

2) through an external link into the records of the custom interface update. You need to set an attribute: AE_showED_button definition of the attributes to allow the built-in update feature, it automatically displays the link to enter the Update button interface. In order to show the default.
When you decide to achieve through their own access to update the definition of interface, you can define the attributes to false. It should be noted that: If from the outside to enter the updated interface, the parameters must be given the link: furl = xxxxx. Such as:
meditid and furl parameters is necessary. Defined Meditid record ID, furl update the definition of the interface into the path of the source of the page. You can Page.Request.CurrentExecutionFilePath to obtain the current path.

Second, the interface to add custom records

1, the definition of the need to add records in the field

By default, DTABLE will all field data sheets as required for the field to add. It provides an attribute to define the field you really need, and through re-definition of the field names to hide the true details of the data table.
DTable1. AE_FieldList = "id, yourname as name, yousex as gender, yourage as age";
The adoption of such a setup, data sheets will show the name, gender, age 3 months to provide input fields. ID as the ID field, we must first place, it will be wrong.

2, to understand interface DTABLE added in the record which properties are available.

1) DTABLE field on the string will automatically limit the maximum number of characters, space character test

2) DTABLE Boolean field on the automatic use of radio buttons. If the Boolean field allows null value, the default is shown as not selected.

3) DTABLE of the date, time, use the date field selector automatically prohibit the entry of the keyboard. Although DTABLE date does not allow keyboard input through the character, but will still be detected at the time of submission of the legality of the date field.

4) DTABLE values, money automatically use the calculator input fields, text controls by double-clicking to open the calculator, at the same time to allow keyboard entry. Will be submitted to test whether the characters entered as a legitimate figure. Need to pay attention to is: Numerical Verification of the client to allow only two decimal values greater than two decimal values are considered illegal.

5) DTABLE address for the record and link link picture picture of the field to provide a document file upload feature immediately, and be able to file name, file path is saved to the relevant field; they can even generate thumbnails; not the limit type field the number.
For example: the staff table the first five records of the academic staff to prove the pictures, the first record of the six staff training certificate picture, we can custom attributes: Dtable.AE_Upfiles_No = "| 5 | 6 |";
This attribute tells DTABLE, No. 5,6 out as a file upload. Add the interface into the record, the first 5,6-position auto-show paper out control, and can automatically upload pictures to submit.
Related attributes:
AE_Upfile_AutoReName: uploaded files automatically be renamed. The default is true, namely: to allow automatic re-named
AE_UpFilesFd: From the definition of the document need to preserve the path, specify a relative path. For example:. / Images or .. / images / abcde
Need to make sure that: Your site must be the existence of the folder.
AE_Miniature_Fd: the definition of the path stored thumbnails. If the definition of the attributes, DTABLE on Dtable.AE_Upfiles_No think you all as defined in the file upload field will need to generate thumbnails! !
AE_Miniature_width: the maximum width of generated thumbnails, and specify the maximum height of the thumbnail. Integer attribute category
AE_Miniature_height: maximum height of generated thumbnails, and specify the maximum width of thumbnails. Integer type attribute

6) DTABLE can directly upload files to the built-in binary image field, and no quantitative restrictions.

.Net Control and components Articles

Can't Find What You're Looking For?

Rating: Not yet rated


No comments posted.