I would like someone to explain how I can pass a drop down list from the presentation layer to the controller using the Model View Controller Design Pattern from Microsoft in order to bind enum values to it?
I have a gridview with 3 nested dropdownlists in one cell on edit like this:To get the exact fields when the user clicks on edit I used the following code(yes it's messy)
[Code]....
The BLLOnderhoud is a class and the getReserveInfo is used to get the Model - Brand(merk) Information.Since the dropdownlists are nested in the gridview I can't call them directly and they can't call any of my functions.And this is the problem, when I change the dropdownfield Model the Auto field wich is the last dropdown(in the picture is a typo) should be binded like in the following code:
[Code]....
But the dropdownlist onDataBound event can't call any of my functions that are in my class.So my question is how can the onDataBound event of the second dropbox trigger a function? The only thing that the function has to do is to bind the 3rd dropdownlist
I have an application that allows admins to add types such as document types and training types that are in seperate tables with a foreign key in a transaction table.
When structuring my class I decided to go with an abstract-like pattern (without the factory methods though). So I have a Type abstract class that defines my Save, Delete, and GetList methods. I have a training type class that inherits this class. The thing is all types have 3 main properties - defined in the abstract base - but have different source tables and thus different store procedures in my DbCommand object. So basically I repeat setting up the same parameters on all the derived classes. I would like to implement the common stuff in the base but I am getting thrown off by the difference in data sources.
I m using the following code to bind dropdownlist using ADO.NET
Code: Protected Sub HeadsData() Dim conn As SqlConnection Dim cmd As SqlCommand Dim reader As SqlDataReader Dim constr As String = ConfigurationManager.ConnectionStrings("ams").ConnectionString conn = New SqlConnection(constr) cmd = New SqlCommand("Select HeadId,HeadName from Heads Order By HeadName", conn) conn.Open() reader = cmd.ExecuteReader() While reader.Read cmbType.DataSource = reader cmbType.DataTextField = "HeadName" cmbType.DataValueField = "HeadId" cmbType.DataBind() End While End Sub
I have 5 records in Heads table, but when i run the project it misses the first record and shows the remaining 4 in dropdownlist. Is there anything worng with this code ?
binding values with dropdownlist.i have one dropdownlist name,dropdowndiagnosticcategory..i have made one function bind_category() for binding the category values.The code for binding the values with dropdownlist is as under,here
private void bind_category() { string s = "Data Source=LAB1-40;Initial Catalog=MNSDaignosticCenter;Integrated Security=True"; SqlConnection con = new SqlConnection(s); con.Open(); SqlCommand cmd = new SqlCommand [code]...