- About
- Expression web tabbed menus
- Expression Web Forum
- Expression web resources
- CSS Intro
- Build Expression Web Template 1
- Build Expression Web template 2
- Build Expression Web Template 3
- Style horizontal Navigation with CSS
- Style vertical menu with CSS
- Style the main content area
- Style the footer
- Centre a page
- .style1
- Build Expression Web DWT Tutorial
- Graphic Template example
- Free Expression Web Templates
- Add RSS to Expression Web
- Expression web forms
- Contact
- RSS feeds
- 10 Tips
- Page includes
- Insert flash in expression web
- Expression web dropdown menu
- Point and click easy drop-down menu's
- Table Based Layouts
- ASP.NET Ad Rotator
- Display Data
- Search database using a text box
- Transparent Text
- Bold text - Formatting
- Date and time
- Who are you
Search an access database
Searching an access database in expression web is actually quite easy to do. The process requires you to have asp.net v2 provided by your host.
Create a new aspx page and save it. (give it any name you like - in my case i called it textsearch.aspx.
From the toolbox task pane, select, drag and drop an asp.net text box control onto your page.
Next, select, drag and drop an asp.net button and place it next to the text box.
Finally, select, drag and drop a data list control from the asp.net data control toolbox and place it directly under the text box and button. You will be asked to create a data source by the data list control. Navigate to you database and select the fields that you will want to display.
When you have selected your data source, you need to click the next button.
You will be presented with the Configure select statement dialogue box. Select the database table that holds the data that you want your users to see, and select the items you want to display from that table.
Make sure you check the show only unique records box and then click on the where button to create a where clause.
How you proceed from here, depends on how your database is set up. My database has a table for pet details and within that are records showing quite a bit of info. However, i want to only show part of the database and in this case i want to show, animal shelter, location, county, contact name and telephone number. Why? Well my search box allows users to type in a location and the results of pet shelters in that location will be shown.
So in the where clause, select the column that is relevant to the search. In my case its location.
Make sure the operator is set to equals (=) and then click on the source dropdown and select control (a asp.net text box is a control) then from the parameter properties control ID dropdown select textbox1. (this is the default name of the control. If you have more than 1 text box control you will see textbox1, textbox2 and so on. You can change the names of the controls if you wish)
When you have selected the textbox1 control click on the add button to add the where clause.
So briefly, we are saying that we want to see the results for location when the location is equal to the contents of the text box.
Nearly done.
Really all that remains now is to make the button do some thing.
What we want is when a user types some text into the textbox and hits the button, the button needs to send that information somewhere. In this case it needs to send the info back to the page that the textbox and button are on.
So click on the button and then under the Tag Properties task pane, scroll through the options until you get to the behavior section, find postback url. if you click this a small button will show allowing you to click and navigate to the page you need. (this will be the page you are currently working on - so the button posts back to the same page)
Click save and test it in your browser.
You can change the text on the button by clicking on it and changing the text, again in the Tag Properties task pane.
You can control the look of the data display in the data list control by clicking on it and then clicking the small grey arrow on the right side of the control. Here you can edit the template, and or format how the results are displayed.
A using data in expression web tutorial is here.
Discuss this in our expression web forum?
RSS
Our forum feed can be found here
Reader not listed? Click here for more options
Expression Web Help RSS
Expression Web Help. Tips and Tricks and tutorials Get our feed now