选择显示字体大小

.net中实现无客户端联动菜单

 

<%@ page language="c#" codebehind="webform1.aspx.cs" autoeventwireup="false" inherits="custommanager.company.webform1" %>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en" >
<html>
 <head>
  <title>webform1</title>
  <meta content="microsoft visual studio .net 7.1" name="generator">
  <meta content="c#" name="code_language">
  <meta content="javascript" name="vs_defaultclientscript">
  <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetschema">
  <link href="../css/style.css" type="text/css" rel="stylesheet">
 </head>
 <body ms_positioning="gridlayout">
  <form id="form1" method="post" runat="server">
   <asp:dropdownlist id="dropdownlist1" style="z-index: 101; left: 40px; position: absolute; top: 168px"
    runat="server"></asp:dropdownlist><asp:label id="label1" style="z-index: 102; left: 328px; position: absolute; top: 104px" runat="server">label</asp:label>
   <asp:dropdownlist id="dropdownlist2" style="z-index: 104; left: 40px; position: absolute; top: 264px"
    runat="server"></asp:dropdownlist></form>
<script language="javascript">
var str = document.getelementbyid("label1").innertext;
arr=str.split(",");
a=arr.length
ar=new array()
for (i=0;i<a;i++){
  ar[i]=arr[i].split("-");
}
onecount=ar.length;


function  ld() {
  document.form1.dropdownlist2.length=0
  lid=form1.dropdownlist1.value;      
  for  (i=0;i<onecount;i++)  {
    if  (ar[i][0]  ==  lid) {
   document.form1.dropdownlist2.options.add(new option(ar[i][2],  ar[i][1]));   
    }   
  }  

function showmsg()
{
 alert(document.form1.dropdownlist1.value);
 alert(document.form1.dropdownlist2.value);
}

  </script>
 </body>
</html>

using system;
using system.collections;
using system.componentmodel;
using system.data;
using system.drawing;
using system.web;
using system.web.sessionstate;
using system.web.ui;
using system.web.ui.webcontrols;
using system.web.ui.htmlcontrols;

namespace custommanager.company
{
 /// <summary>
 /// webform1 的摘要说明。
 /// </summary>
 public class webform1 : system.web.ui.page
 {
  protected system.web.ui.webcontrols.dropdownlist dropdownlist1;
  protected system.web.ui.webcontrols.label label1;
  protected system.web.ui.webcontrols.dropdownlist dropdownlist2;
  static protected datatable tb1;
 
  private void page_load(object sender, system.eventargs e)
  {
   // 在此处放置用户代码以初始化页面

   if(!page.ispostback)
   {
    
   }
   dropdownlist1.attributes.add("onchange","ld();");
   string strconn,strsql;
   system.data.sqlclient.sqldataadapter da;
   

   strconn = "server=localhost;database=custom;uid=custom;pwd=a;";
   strsql = "select * from custom.bigcalling;";
   da = new system.data.sqlclient.sqldataadapter(strsql,strconn);
   datatable tb3 = new datatable();
   da.fill(tb3);

   dropdownlist1.datasource = tb3;
   dropdownlist1.datatextfield = "bigcallname";
   dropdownlist1.datavaluefield= "bigcallid";
   dropdownlist1.databind();


   strsql = "select * from custom.smallcalling;";
   da = new system.data.sqlclient.sqldataadapter(strsql,strconn);
   tb1 = new datatable();
   da.fill(tb1);


   label1.text = "";

   foreach(datarow row in tb1.rows)
   {
    label1.text = label1.text  + row["bigcallid"] + "-" +row["smallcallid"] + "-"+row["smallcallname"] + ",";

   }

  }

  #region web 窗体设计器生成的代码
  override protected void oninit(eventargs e)
  {
   //
   // codegen: 该调用是 asp.net web 窗体设计器所必需的。
   //
   initializecomponent();
   base.oninit(e);
  }
  
  /// <summary>
  /// 设计器支持所需的方法 - 不要使用代码编辑器修改
  /// 此方法的内容。
  /// </summary>
  private void initializecomponent()
  {   
   this.load += new system.eventhandler(this.page_load);

  }
  #endregion

  
 }
}


 


关键字 本文所属关键字

相关 与本文相关文章

分类 所有文章关键字导航

源码编程相关

Java   Asp   PHP   .Net   XML   C/C++   CGI   VB   Jsp   J2ee   J2se   J2me   EJB   Servlet   Tomcat   Resin   Struts   Weblogic   Eclipse   ANT   GUI   JMS   Web servise   IDEA   Webphere   Hibernate   Spring   Jboss   Applet   Swing   Socket   Javamail   Perl   Ajax   P2P   安全   模式   框架   测试   开源   游戏

SQL数据库相关

My-SQL   Ms-SQL   Access   DB2   Oracle   Sybase   SQLserver   索引   存储过程   加密   数据库   分页   视图  

手机无线相关

3G   Wap   CDMA   GRPS   GSM   IVR   彩信   短信   无线   增值业务

网页设计制作相关

HTML   CSS   网页配色   网页特效   Javascript   VBscript   Dreamweaver   Frontpage   JS   Web   网站设计

网站建设推广相关

建站经验   网站优化   网站排名   推广   Alexa

操作系统/服务器相关

Windows XP   Windows 2000   Windows 2003   Windows Me   Windows 9.x   Linux   UNIX   注册表   操作系统   服务器   应用服务器

图形图像多媒体相关

Photoshop   Fireworks   Flash   Coreldraw   Illustrator   Freehand   Photoimpact   多媒体   图形图像

标准 网站致力的规范

Valid CSS!

无不良内容,无不良广告,无恶意代码

Valid XHTML 1.0 Transitional

creativecommons