Home > Net >  ASP.Net how to implement a picture TAB, click generate code background can obtain the primary key of
ASP.Net how to implement a picture TAB, click generate code background can obtain the primary key of

Time:05-12



As shown in figure:

Select gift box is I use the.net DataList control, image background binding address

But when I click on the "generate code" button, the background was unable to obtain information to the primary key of the selected image, to keep the information of the selected in the database

Please the great god guide!!!!!!

(at the front desk to get the pictures selected primary key information, and then spread through Ajax to background to save, but this way don't feel safe, so have not been used)

CodePudding user response:

How it's not safe for the MVC has always been like this

CodePudding user response:

Pictures DataList binding to bind Id, when I was at the front desk through the Jquery get the selected Id, and then save the Ajax to the background, total feel very strange, it is easy to be cracked

CodePudding user response:

The Internet for hours, like this outside the DataList button, the selected Id, also nothing important good method, most of them are inside or add a checkbox radiobutton, then take the selected the cycle, not suitable for

CodePudding user response:

Don't want to use ajax with Hidden, JS selected for Hidden assignment, multiple use commas, form is submitted, and obtain the Hidden

CodePudding user response:

reference 4 floor nan peony reply:
don't want to use ajax with Hidden, JS selected for Hidden assignment, multiple use commas, form is submitted, and obtain the Hidden

Essential difference

CodePudding user response:

The
refer to the original poster cxy_ violet response:


As shown in figure:

Select gift box is I use the.net DataList control, image background binding address

But when I click on the "generate code" button, the background was unable to obtain information to the primary key of the selected image, to keep the information of the selected in the database

Please the great god guide!!!!!!

(at the front desk to get the pictures selected primary key information, and then spread through Ajax to background to save, but this way don't feel safe, so have not been used)


First you have to understand, the back-end data to the front so it's not the back-end data security thing to focus on the
Second selection do you think of the front-end id not safe??????
So you don't have security, because you don't trust at the front to get things
The user to select what you F12 changed ID that is in itself the user directly, to get any information if you don't trust that this project can't you do any web project is to do so, the most is what front coming back end do validation

CodePudding user response:

reference 5 floor hui1202 reply:
Quote: refer to 4th floor nan peony reply:
don't want to use ajax with Hidden, JS selected for Hidden assignment, multiple use commas, form is submitted, and obtain the Hidden

Essential difference didn't


6th floor you trying to say is I want to say, but I carefully thought for a moment, this method is a long time ago webform, maybe somebody else's
  • Related