| |

VerySource

 Forgot password?
 Register
Search
View: 668|Reply: 4

asp.net how to add an add button, let it insert data

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-3-12 11:00:02
| Show all posts |Read mode
Formview has its own insert and other functions, but I always find it unsightly. I want to add an "Insert" button to implement new functions, but I don't know how to write, please master.
Reply

Use magic Report

1

Threads

6

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 United States

Post time: 2020-6-11 11:15:01
| Show all posts
Edit the Insert template, delete the add button, add your own picture, set the CommandName property Insert
Reply

Use magic Report

0

Threads

8

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-6-16 12:15:01
| Show all posts
Same
Are you going to add it to VIEW? Or add controls outside?
If you add it inside, just use it
Reply

Use magic Report

0

Threads

15

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-6-17 03:30:01
| Show all posts
I agree with the view upstairs, and formview comes with a choice of use, why not use
  Change the selection to a template, and then you can call the button event inside;
Reply

Use magic Report

0

Threads

15

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-6-17 09:45:01
| Show all posts
FormView event
The FormView control can trigger events that occur when the current record is displayed or changed. Clicking a command control (such as a Button control that is part of the FormView control) also raises an event. The following table describes the events exposed by the FormView control.

PageIndexChanging
Occurs when a page navigation button is clicked, but before the FormView control performs a paging operation. This event is usually used to cancel the paging operation.

PageIndexChanged
Occurs when a page navigation button is clicked, but after the FormView control performs a paging operation. This event is usually used when a user needs to perform a certain task after locating to a different record in the control.

ItemCommand
Occurs when a button in the FormView control is clicked. This event is usually used to perform a task when a button in the control is clicked.

ItemCreated
Occurs after all FormViewRow objects have been created in the FormView control. This event is usually used to modify the value to be displayed in a row before displaying the row.

ItemDeleting
Occurs when you click the Delete button (the button whose CommandName property is set to "Delete"), but before the FormView control deletes the record from the data source. This event is usually used to cancel the delete operation.

ItemDeleted
Occurs when the Delete button is clicked, but after the FormView control deletes the record from the data source. This event is usually used to check the result of the delete operation.

ItemInserting
Occurs when the Insert button (the button whose CommandName property is set to "Insert") is clicked, but before the FormView control inserts the record. This event is usually used to cancel the insert operation.

ItemInserted
Occurs when the Insert button is clicked, but after the FormView control inserts the record. This event is usually used to check the result of the insert operation.

ItemUpdating
Occurs when the Update button (the button whose CommandName property is set to "Update") is clicked, but before the FormView control updates the record. This event is usually used to cancel the update operation.

ItemUpdated
Occurs when the Update button is clicked, but after the FormView control updates the row. This event is usually used to check the result of the update operation.

ModeChanging
Occurs before the FormView control changes mode (change to edit, insert, or read-only mode). This event is usually used to cancel mode changes.

ModeChanged
Occurs after the FormView control changes mode (change to edit, insert, or read-only mode). This event is usually used to perform a task when the FormView control changes mode.

DataBound
This event is inherited from the BaseDataBoundControl control and occurs after the FormView control has finished binding to the data source.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list