|
| |
|
|
Avick
Posts: 181 From: Ireland Status: offline
|
Expression (Drop-Down List) - 2/2/2007 7:47:52
Hi Everyone. First off, I installed Expression Web on my system about 2 weeks ago and I have to say I am having a ball with it. Anyone thinking of switching from FrontPage to EW should go for it. Now down to my problem. I am filling a Drop-Down List from my SQL database and it works well. All the data is where and how its supposed to be. The problem is, I can't get it to pass the data to another page and filter the records based on the selection in the drop-Down List. I have achieved this when I put a GRIDVIEW on the first page and a DETAILSVIEW on the second page. I got everything to work perfect. You click an Item on the Gridview (Page1) and the details of that item displays on Detailsview (Page2) What I want to do is get rid of the Gridview and replace it with a drop down list. When you sellect the item, page2 will open with the details view filtered to the correct record. Phewww. I think thats all.
_____________________________
Alan http://www.newebirl.net
|
|
|
|
dpf
Posts: 7121 Joined: 11/12/2003 From: India-napolis Status: offline
|
RE: Expression (Drop-Down List) - 2/2/2007 8:05:51
quote:
I have achieved this when I put a GRIDVIEW on the first page and a DETAILSVIEW on the second page. I got everything to work perfect. You click an Item on the Gridview (Page1) and the details of that item displays on Detailsview (Page2) THAT SOUNDS LIKE asp.net terminology - is that what Expressions is using?
_____________________________
Dan
|
|
|
|
Avick
Posts: 181 From: Ireland Status: offline
|
RE: Expression (Drop-Down List) - 2/2/2007 10:48:36
That’s Right !! ASP.net 2.0 to be precise. I’m a fan of the ASP.net way of doing things. I tried my hand at php but its not my cup of tea.
_____________________________
Alan http://www.newebirl.net
|
|
|
|
mar0364
Posts: 3081 Joined: 4/5/2002 From: Florida, US Status: offline
|
RE: Expression (Drop-Down List) - 2/2/2007 17:47:45
The following code does what your takling about all on the same page. Take a look at the code it may help you solve your problem. If you have the pubs database running on you server you should be able to run the code.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Page Language="VB" %>
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled 1</title>
</head>
<body>
<form id="form1" runat="server">
<asp:DropDownList runat="server" id="DropDownList1" AutoPostBack="True">
<asp:ListItem>CA</asp:ListItem>
<asp:ListItem>UT</asp:ListItem>
<asp:ListItem>IN</asp:ListItem>
</asp:DropDownList>
<br />
<asp:GridView runat="server" id="GridView1" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" DataKeyNames="au_id">
<Columns>
<asp:boundfield ReadOnly="True" DataField="au_id" SortExpression="au_id" HeaderText="au_id">
</asp:boundfield>
<asp:boundfield DataField="au_lname" SortExpression="au_lname" HeaderText="au_lname">
</asp:boundfield>
<asp:boundfield DataField="au_fname" SortExpression="au_fname" HeaderText="au_fname">
</asp:boundfield>
<asp:boundfield DataField="city" SortExpression="city" HeaderText="city">
</asp:boundfield>
<asp:boundfield DataField="state" SortExpression="state" HeaderText="state">
</asp:boundfield>
</Columns>
</asp:GridView>
<asp:SqlDataSource runat="server" ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:Pubs %>" SelectCommand="SELECT [au_id], [au_lname], [au_fname], [city], [state] FROM [authors] WHERE ([state] = @state)">
<SelectParameters>
<asp:controlparameter PropertyName="SelectedValue" Type="String" DefaultValue="ca" Name="state" ControlID="DropDownList1" />
</SelectParameters>
</asp:SqlDataSource>
</form>
</body>
</html>
_____________________________
Easy Web “Stay committed to your decisions, but stay flexible in your approach.”
|
|
|
|
Avick
Posts: 181 From: Ireland Status: offline
|
RE: Expression (Drop-Down List) - 2/2/2007 18:34:26
Thanks Mar0364 but I wanted to display the information on another page and fill the list box with the data from the same table. I'm beginning to think this can't be done as I have searched everywhere for the answer to no avail. I am looking at putting 3 Dropdown box's in the side bar of one page and each will go to there respective page when a selection is made.
_____________________________
Alan http://www.newebirl.net
|
|
|
|
mar0364
Posts: 3081 Joined: 4/5/2002 From: Florida, US Status: offline
|
RE: Expression (Drop-Down List) - 2/3/2007 13:36:07
I'm sure there is a way to do it. You need to figure it out. Good luck. Rich
_____________________________
Easy Web “Stay committed to your decisions, but stay flexible in your approach.”
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|