Monday, October 8, 2007

Standard steps for creating an administrative form

Grid View

  1. Add SQL Datasource client
  2. Add Grid
  3. Update the properties of the grid (Skin)
  4. Set DataSource, set yes to refresh
  5. Add command field (Select)
  6. Add Select ImageURL
  7. Move the select image to the top
  8. Change Select button type to image
  9. Find key, set the property to invisible
  10. Add Delete
  11. change delete image
  12. change deleteimage button type to image
  13. Properties: Change the EmptyDataText to read "There are no records to display." This will display if no records exist.
  14. Look at all fields. For any fields that contain html tags coming from the database, put
    HtmlEncode="false" into the boundfield tag.

Details View

  1. Add SQL Datasource
  2. Configure Data source
  3. Choose "Where"
  4. Choose unique ID
  5. Choose =
  6. Choose Control
  7. Select the correct control
  8. make sure to click advanced, this will allow us to create insert, delete, add statements automatically.
  9. Edit fields in Detail view
  10. Add Command field for Edit
  11. Edit - Set button type to button
  12. Edit - Change buttontext to Update
  13. Add comand field for Insert
  14. Insert - Change buttontype to button
  15. Insert - Change buttontext to Add
  16. Handle 0 rows - Add EmptyDataTemplate


Adding FckEditor so we can edit large areas of text with the editor

  1. Go to code view of aspx file
  2. 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

  1. Copy and paste the existing form in Visual Studio
  2. Rename the new form
  3. Open up the .aspx file. Change the Inherits value to match the name of your page
  4. Open up the .aspx.vb file. Change the name of the class to match the name of your page.
  5. Open the .aspx file in design view
  6. Go to the initial datasource of the datagrid, click on it to configure the datasource


No comments: