|
-
Apr 21st, 2008, 08:04 AM
#1
Thread Starter
Hyperactive Member
Call & display SQLDataSource variable.
I would like to call and display the selection that is being used as my SQLDataSource
What is the command that will display it and give me some formating control?
Code:
<b>Defensive Boxscore - Select Team:</b>
<asp:DropDownList ID="DropDownList2" DataSourceID="SqlDataSource4" AutoPostBack="true"
DataTextField="defense" runat="server" />
<asp:SqlDataSource ID="SqlDataSource4" runat="server" SelectCommand="SELECT DISTINCT [defense] FROM [cfb_boxscores] ORDER BY [Defense]"
ConnectionString="<%$ ConnectionStrings:ConnectionString1 %>" />
Last edited by ggodwin; Apr 21st, 2008 at 09:03 AM.
Reason: better sybject
-
Apr 22nd, 2008, 07:45 AM
#2
Thread Starter
Hyperactive Member
Re: Call & display SQLDataSource variable.
-
Apr 22nd, 2008, 08:31 AM
#3
Re: Call & display SQLDataSource variable.
Handle the SqlDataSource's selecting or selected event.
-
Apr 22nd, 2008, 08:43 AM
#4
Thread Starter
Hyperactive Member
Re: Call & display SQLDataSource variable.
Basically the selected event.
I just want to be able to display what the user selects to make it clear what they are looking at.
-
Apr 22nd, 2008, 09:51 AM
#5
Re: Call & display SQLDataSource variable.
So if it's from the dropdownlist why don't you just display what's selected in the dropdown?
-
Apr 22nd, 2008, 10:11 AM
#6
Thread Starter
Hyperactive Member
Re: Call & display SQLDataSource variable.
I am doing that now.
But I would like to put some text above my gridview to explain what is being viewed.
-
Apr 22nd, 2008, 02:57 PM
#7
Re: Call & display SQLDataSource variable.
You aren't explaining your problem very well. What do you have now and what do you want?
-
Apr 22nd, 2008, 03:36 PM
#8
Thread Starter
Hyperactive Member
Re: Call & display SQLDataSource variable.
I Just want to be able to show what the current value is that the user selected.
http://visualboxscore.com/boxscores/NCAA_football.aspx
On the above web link you will see the user choices.
They may choose Example:
Michigan.
Just above the grid I want to display this Name "Michigan".
Keep in mind the page you are seeing is not my final one. This is just a pilot while I learn this stuff. I thought it would be a simple command that I could put in.
-
Apr 23rd, 2008, 02:10 AM
#9
Re: Call & display SQLDataSource variable.
Right. Have a label sitting somewhere above the grid, and in the page load event, if it is a postback, read the value in the dropdownlist. Then put that into the label. You can even concatenate a string for it.
Label1.Text = "You are currently viewing: " + DropDownList1.SelectedItem.Value
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|