Data Binding Functions are used with controls. Eval()- - Eval function is data binding function. - It is only used with the text property of all controls excluding image control, In Image control we use this with "src". Syntax- Text='<%# Eval("column_name")%>' // column same as database. The column will bind to that control.
Image handling can be done by two ways- 1. Using controls. 2. Using code. Using controls- a) Image Control- ImageUrl is the property of Image control. b) ImageButton Control- ImageUrl, PostBackUrl Steps to add image in image control- i. Create a directory in your project. ii. Add an image in that directory. iii. Refresh the solution explorer(In dot net). iv. Now, Go to the properties of Image control> ImageUrl> Click on the dots > Select the image from the dialog box ====================================== File Upload Control- It allows us to Upload Image to a server or store in web form. Drag n Drop File Upload Control from tool box, take a button control beside it[Name it as Upload],Image control. When we browse the file and click on Upload button, the image will be stored in the folder we have created earlier and be shown in the Image control. FileUpload1.SaveAs(Server.MapPath("~") + "//Pho...
Comments
Post a Comment