LittlBUGer
Programmer
Hello. I have an ASP.NET 2.0 webpage which has a custom new user registration area. Some of the parts include choosing a State, County, and Country, of which I've assigned dropdownlists to handle. Unfortunately, after everything has been chosen and the user clicks on the Register button, it doesn't fully register. I'm using a SqlDataSource to do the insert with some ControlParameters. What I need for those dropdownlists is the text, not the value. If I specify something like this:
It works, but Text is the same as SelectedValue, and I want the actual Text of the dropdownlist. So if I change the PropertyType to SelectedItem.Text, it doens't work. Or if I go to the code behind and try to do this:
It doesn't work either. Any ideas on how to make this work? Am I missing something really simple? Thanks.
"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." - Albert Einstein
Code:
<asp:ControlParameter Name="State" Type="String" ControlID="ddState" PropertyName="Text" />
<asp:ControlParameter Name="County" Type="String" ControlID="ddCounty" PropertyName="Text" />
<asp:ControlParameter Name="Country" Type="String" ControlID="ddCountry" PropertyName="Text" />
It works, but Text is the same as SelectedValue, and I want the actual Text of the dropdownlist. So if I change the PropertyType to SelectedItem.Text, it doens't work. Or if I go to the code behind and try to do this:
Code:
DataSource3.InsertParameters.Add("State", ddState.SelectedItem.Text)
DataSource3.InsertParameters.Add("County", ddCounty.SelectedItem.Text)
DataSource3.InsertParameters.Add("Country", ddCountry.SelectedItem.Text)
DataSource3.Insert()
It doesn't work either. Any ideas on how to make this work? Am I missing something really simple? Thanks.
"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." - Albert Einstein