Atitit.ui control---implementation of drop-down menu selection control select html
1. Call & model implementation 1
2. - ----select.jsp------ 1
1. Implementation of calling & model
Proj.vod2
< %
List li=new ArrayList();
Map m=new HashMap ();
m.put("lab","love");
m.put("v","1");
li.add(m);
DropDownList DropDownList1=new DropDownList();
DropDownList1.DataSource = li;
DropDownList1.DataValueField = "v";
DropDownList1.DataTextField = "lab";
DropDownList1.DataBind( );
session.setAttribute("ddl1",DropDownList1);
%>
Author:: 老Wow's Claw Attilax Ailong, EMAIL:1466519819@qq.com
2. -----select.jsp------
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" %>
<%@page import="java.io.File"%>
<% @page import="java.util.ArrayList"%>
<%@page import="java.util.HashMap"%>
<%@page import= "java.util.List"%>
<%@page import="java.util.Map"%> import="System.Web.UI.WebControls.DropDownList"%>
<%@page import="com.attilax.core"%>
>
<%
DropDownList ddl= (DropDownList) session.getAttribute(request.getParameter("DropDownListId") );
List li=ddl.DataSource;
%>
<%= core.toJsonStrO88(ddl)%>
<%
for (Object object : li) {
Map m=(Map) object;
%>
<% } %>
Problems with drop-down list data binding in ASP.NET. _Baidu knows.htm