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 %>" />
Re: Call & display SQLDataSource variable.
Re: Call & display SQLDataSource variable.
Handle the SqlDataSource's selecting or selected event.
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.
Re: Call & display SQLDataSource variable.
So if it's from the dropdownlist why don't you just display what's selected in the dropdown?
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.
Re: Call & display SQLDataSource variable.
You aren't explaining your problem very well. What do you have now and what do you want?
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.
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