Thanks for the response, but the value for the EnableViewState was already
set to true. What else can I check?
"Raj" <> wrote in message
news:E9C66067-8EB5-4D7B-966F-...
> Set the EnableViewState="true" attribute for the drop down list.
>
> raj
>
> "JD" wrote:
>
>> I want to capture values from dropdown lists and pass values as
>> parameters
>> to stored procedure. I select a value in the dropdown list, when I click
>> the
>> Submit Button the value disappears in the dropdown list and no value is
>> passed. I have tried using the ddl.selecteditem.value or text. I
>> continue
>> to get no values.
>>
>> If I use text boxes, everything works, but I need to restrict selections
>> to
>> a specified list.
>> I'm new to web forms; I have no problem in Windows Forms.
>>
>> Here is code. What is wrong and where can I find the answer? Thanks.
>>
>> Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As
>> System.EventArgs) Handles btnSubmit.Click
>> Dim ConnStr As String = "packet size=4096;integrated security=SSPI;data
>> source=(local);persist security info=False;initial catalog=SSNew1"
>>
>> Dim Cn As New SqlClient.SqlConnection(ConnStr)
>>
>> Dim cmdGetAccessData As New SqlClient.SqlCommand
>>
>> cmdGetAccessData.Connection = Cn
>>
>> cmdGetAccessData.CommandType = CommandType.StoredProcedure
>>
>> cmdGetAccessData.CommandText = "usp_GetDataforAccess"
>>
>> Dim param1 As New SqlClient.SqlParameter("@Drainage",
>> ddDrainage.SelectedItem.Text)
>>
>> Dim param2 As New SqlClient.SqlParameter("@Region",
>> ddRegion.SelectedItem.Text)
>>
>> Dim param3 As New SqlClient.SqlParameter("@SurveyYear", txtYear.Text)
>>
>> param1.Value = Me.ddDrainage.SelectedItem.Text
>>
>> cmdGetAccessData.Parameters.Add(param1)
>>
>> cmdGetAccessData.Parameters.Add(param2)
>>
>> cmdGetAccessData.Parameters.Add(param3)
>>
>> cmdGetAccessData.Connection.Open()
>>
>> cmdGetAccessData.ExecuteNonQuery()
>>
>> End Sub
>>
>>
>>
|