开发者

how to get return value as dropdownlist and how to assign it to other dropdownlist?

开发者 https://www.devze.com 2023-02-25 01:56 出处:网络
I have two dropdownlist on my webpage i want to fill both of that dropdownlist with a single code written in a separate class file. i want to pass the table name with field name and want to get that d

I have two dropdownlist on my webpage i want to fill both of that dropdownlist with a single code written in a separate class file. i want to pass the table name with field name and want to get that data into my used dropdownli开发者_开发百科st.

my code is as follows

ddl1 = obj.Method("table_Name");

now the following function return the dropdownlist

public dropdownlist Method(string table_NAME)
{
          // code

        return dropdownlist_1;
}

now i want to use this code for filling multiple dropdownlist, by using this i can reduce my code. same code will be use to fill other dropdownlists also.

Please help me as soon as possible.............

Thanks in advance.


Please view if ObjectDataProvider is the class you are looking for. Here is the reference: http://msdn.microsoft.com/en-us/library/system.windows.data.objectdataprovider.aspx


You would need a server side scripting language (such as PHP, Perl, JSP, ASP, Python, and many more). Once you have a language selected, the code for that should be relatively easy. The basic algorithm would be:

  1. Issue an database request to get the data to fill in
  2. Iterate over your results and generate a form option from each one
  3. Concatenate the form options to one another
  4. Insert the resulting menu into your page
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号