required field validator and drop down list problem

vks.gautam1

Well-known member
Joined
Oct 10, 2008
Messages
78
Location
Chandigarh, India
Programming Experience
Beginner
1) required field validator-- Im using this control on my page to submit data & no textbox should be blank..It's working.. But the problem is now that when i want to "search" a content and it needs only one textbox field to be filled but now it's gives message not to keep blank other text boxes...any idea

2) DropDownlist-- i have used this to fill the data ..i used three dropdownlist..when i select one item from one list then corresponding item should get selected in other dropdownlist..i used property "Autopostback=true" ..but now every time page get loaded it adding same data on page again and again..

VB.NET:
 Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        Try
            q = "select field1, field2 ,field3 from table1"
            cn = New OleDbConnection("provider=&&&&&&;")
            cn.Open()
            cmd = New OleDbCommand(q, cn)
            Dim dr As OleDbDataReader = cmd.ExecuteReader
            While dr.Read
                dropdownlist1.Items.Add(dr.Item(0))
                dropdownlist2.Items.Add(dr.Item(1))
                dropdownlist3.Items.Add(dr.Item(2))
            End While
           
            dr.Close()
            cn.Close()
            
            
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
       
    End Sub


    Protected Sub DDListCourseName_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        DDropdownlist2.SelectedIndex = Dropdownlist2.SelectedIndex
     
    End Sub
 
2) i have got the solution for it..as it was adding same data on every auto post back event an creating duplicate values...
now i have put a if condition on this...

haven't successive on first one.
 
Back
Top