My problems are based on ASP. NET mvc2.0. I have not tested these problems for the moment.
Http://msdn.microsoft.com/zh-cn/downloads/ff393634
Read this articleArticleVery good. The Verification Mode updates the content of the form. The verification is successful first, then submitted to the server, and then the server is verified, which is much more secure,ProgramFlexible and convenient for secondary development. As long as you change the verification rules in the model, the verification rules for the entire site are released.
Assume that the authentication mode of this person is for a table like this in the database.
Create Table
Create Table [ DBO ] . [ T_person ] (
[ Userid ] [ Int ] Not Null Identity ( 1000 , 1 ),
[ Firstname ] [ Nvarchar ] ( 50 ) Null ,
[ Lastname ] [ Nvarchar ] ( 50 ) Null ,
[ Age ] [ Int ] Null ,
[ Email ] [ Nvarchar ] ( 50 ) Null
Constraint [ Pk_t_person ] Primary Key Clustered
(
[ Userid ] ASC
) With (Pad_index = Off , Statistics_norecompute = Off , Ignore_dup_key = Off , Allow_row_locks = On , Allow_page_locks = On ) On [ Primary ]
) On [ Primary ]
If an error occurs while updating the t_person table using the model person data, the update fails.
The reason is: You 'd better design the person, add the userid, and associate the person with the t_person based on the primary key, and then perform the update operation.
Note the following:
If your t_person table has only six fields, and you have set several more fields in person, and then insert the required values into the t_person table, an error will be reported during the update.
The solution is to be diligent and recreate a model to add as many fields as possible in the expected table.