Grid View
- Add SQL Datasource client
- Add Grid
- Update the properties of the grid (Skin)
- Set DataSource, set yes to refresh
- Add command field (Select)
- Add Select ImageURL
- Move the select image to the top
- Change Select button type to image
- Find key, set the property to invisible
- Add Delete
- change delete image
- change deleteimage button type to image
- Properties: Change the EmptyDataText to read "There are no records to display." This will display if no records exist.
- Look at all fields. For any fields that contain html tags coming from the database, put
HtmlEncode="false" into the boundfield tag.
Details View
- Add SQL Datasource
- Configure Data source
- Choose "Where"
- Choose unique ID
- Choose =
- Choose Control
- Select the correct control
- make sure to click advanced, this will allow us to create insert, delete, add statements automatically.
- Edit fields in Detail view
- Add Command field for Edit
- Edit - Set button type to button
- Edit - Change buttontext to Update
- Add comand field for Insert
- Insert - Change buttontype to button
- Insert - Change buttontext to Add
- Handle 0 rows - Add EmptyDataTemplate
Adding FckEditor so we can edit large areas of text with the editor
- Go to code view of aspx file
- In page tag at top of page, add the following parameters: ValidateRequest="false" StyleSheetTheme="xyz" Note: Stylesheet theme is optional
Copying and Reusing an existing admin form
- Copy and paste the existing form in Visual Studio
- Rename the new form
- Open up the .aspx file. Change the Inherits value to match the name of your page
- Open up the .aspx.vb file. Change the name of the class to match the name of your page.
- Open the .aspx file in design view
- Go to the initial datasource of the datagrid, click on it to configure the datasource
No comments:
Post a Comment