PostBack and function issues

Ronny1971

New Member
Not using jQuery or Javascript as this is a fix of an existing site and it was not designed that way. Well I have gotten to a point where when the DropDownList is selected and does it's postBack I do my logic of setting the textBox readOnly status to true or false. the problem I have now is the the selectValue is not consistant. Wht it show in the selct field is not what is posted back to the page. Say I have None, 5.00, 10.00, 15.00, 20.00 as my choices to choose. I first choose 10.00 and it posts back None then I choose 20.00 it shows 10.00. It posts back the prior select value. the entire site is written from the code behind page. the aspx page is completely written from the .vb page. Everything is written into asp tags. here is the code;\[code\] If Page.IsPostBack Then If product_option_is_required > 0 then myTextBox.ReadOnly= true Else myTextBox.ReadOnly= false End if For Each child_control As Control In productOptions.Controls If TypeOf child_control Is DropDownList Then Dim child_ddl As DropDownList = child_control tempName = products.getProductDependant("product_option_name",product_option_id) tempSelectText = products.getProductSelectDependant("product_option_detail_name",child_ddl.SelectedValue) priceDependant.Text ="here" & child_ddl.ID & " " & child_ddl.SelectedIndex & " " & child_ddl.SelectedValue & " --" & tempSelectText If child_ddl.Text = "None" then myTextBox.ReadOnly = true myTextBox.Text = "If selected above enter name" Else myTextBox.ReadOnly = false myTextBox.Text = "" End if End If next End if\[/code\]
 
Back
Top