. NET implementation of no client linkage menu (no refresh)

Source: Internet
Author: User
Tags net split client visual studio
Menu | client | linkage Menu | refresh | no Refresh | menu | client | linkage Menu | refresh | no refresh

<%@ 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>
Summary description of the 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)
{
Place user code here to initialize page

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"] + ",";

}

}

Code generated #region the Web forms Designer
Override protected void OnInit (EventArgs e)
{
//
CodeGen: The call is asp.net Web window



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.