本帖最后由 koalacsdn 于 2010-07-01 18:21:02 编辑

解决方案 »

  1.   

    怎么写了那么多啊?一个简单的联动,几行代码就能搞定了。。你baidu一下吗,有很多的联动的事例啊
      

  2.   


    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="help._Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title></title>
        <style type="text/css">
            .sty_Table
            {
                width: 600px;
                height: 54px;
                top:30px;
                left:30px;
            }
                    
            .sty_Tdi
            {
                 width:20px;
                 height:20px;
            }
            
            .sty_Title
            {
                text-align:center;
                height:20px;
                font-family:Verdana;
                font-size:14px;
                font-weight:bold
            }
            
            .sty_TdLeft
            {
                 width:60px;
                 height:20px;
                 text-align:left;
                 
                 font-family:Verdana;
                 font-size:10pt;
                 font-weight:bold;
            }
            
            .sty_Td
            {
                 width:90px;
                 text-align:right;
                 
                 font-family:Verdana;
                 font-size:10pt;
                 font-weight:bold;
            }
            
            .sty_Td2
            {
                 width:150px;
                 height:20px;
                 text-align:right;
                 
                 font-family:Verdana;
                 font-size:10pt;
                 font-weight:bold;
            }
                    
            .sty_Tdm
            {
                 width:50px;
                 height:20px;
                 text-align:right;
                 
                 font-family:Verdana;
                 font-size:10pt;
                 font-weight:bold;
            }
            
            .sty_Td1_5
            {
                 width:100px;
                 height:20px;
                 text-align:right;
                 
                 font-family:Verdana;
                 font-size:10pt;
                 font-weight:bold;
            }
            
            .sty_TdLineTable
            {
                 width:260px;
                 height:160px;
                 background-color:Black;
            }
            
            .sty_Td3
            {
                 width:300px;
                 height:20px;
                 text-align:right;
                 
                 font-family:Verdana;
                 font-size:10pt;
                 font-weight:bold;
            }
            
            .sty_Mini
            {
                width:30px;
                height:20px;
                text-align:center;
                height:20px;
                font-family:Verdana;
                font-size:14px;
                font-weight:bold
            }
            .style6
            {
                width: 90px;
                text-align: right;
                font-family: Verdana;
                font-size: 10pt;
                font-weight: bold;
            }
            .style7
            {
                width: 7px;
                text-align: right;
                font-family: Verdana;
                font-size: 10pt;
                font-weight: bold;
            }
            .style8
            {
                width: 214px;
                text-align: right;
                font-family: Verdana;
                font-size: 10pt;
                font-weight: bold;
            }
            #form1
            {
                width: 646px;
            }
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
          </asp:ScriptManager>
          <asp:UpdatePanel ID="UpdatePanel1" runat="server">
           <ContentTemplate>
        <table class="sty_Table">
            <tr>
                <td class="sty_Td2">
                    &nbsp;</td>
                <td class="sty_Td2">
                    &nbsp;</td>
                <td class="sty_Td2">
                    &nbsp;</td>
                <td class="sty_Td2">
                    &nbsp;</td>
                <td class="style7">
                    &nbsp;</td>
                <td class="style8">
                    &nbsp;</td>
                <td class="sty_Td">
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style6">
                    标准选择</td>
                <td class="style6">
                    <span>
                    <asp:DropDownList ID="ddlStandardSel" runat="server" AutoPostBack="True" 
                        CssClass="sty_DdlCommon2" onselectedindexchanged="ddlStandardSel_SelectedIndexChanged" 
                        >
                        <asp:ListItem>国际单位</asp:ListItem>
                        <asp:ListItem>英制单位</asp:ListItem>
                    </asp:DropDownList>
                    </span>
                </td>
                <td class="style6">
                    理论长度</td>
                <td class="sty_Td">
                <asp:TextBox ID="txtPmh" runat="server" AutoCompleteType="Disabled" 
                    AutoPostBack="True" CssClass="sty_TxtHot" ontextchanged="txtPmh_TextChanged" 
                        Width="77px"></asp:TextBox>
                </td>
                <td class="style7" rowspan="2">
            <span>
            <asp:DropDownList ID="ddlHotPressureUnits" runat="server" 
                AutoPostBack="True" CssClass="sty_DdlHot" 
                onselectedindexchanged="ddlHotPressureUnits_SelectedIndexChanged">
                <asp:ListItem>米</asp:ListItem>
                <asp:ListItem>毫米</asp:ListItem>
            </asp:DropDownList>
            </span>
                </td>
                <td class="style8">
                    热侧法兰标准</td>
                <td class="sty_Td">
            <span>
            <asp:DropDownList ID="ddlFlSth" runat="server" 
                AutoPostBack="True" CssClass="sty_DdlHot3" 
                onselectedindexchanged="ddlFlSth_SelectedIndexChanged">
            </asp:DropDownList>
            </span>
                </td>
            </tr>
            <tr>
                <td class="style6">
                    &nbsp;</td>
                <td class="style6">
                    &nbsp;</td>
                <td class="style6">
                    实际<span>长度</span></td>
                <td class="style6">
            <span>
            <asp:DropDownList ID="ddlPh" runat="server" 
                AutoPostBack="True" CssClass="sty_DdlHot" 
                OnDataBound="ddlPh_SelectedIndexChanged" 
                OnSelectedIndexChanged="ddlPh_SelectedIndexChanged" Width="80px">
            </asp:DropDownList>
                    </span>
                </td>
                <td class="style8">
                    &nbsp;</td>
                <td class="style6">
                    &nbsp;</td>
            </tr>
        </table>
    </ContentTemplate>
        </asp:UpdatePanel>
        </form>
        <p>
            国际单位:米;毫米。</p>
        <p>
            英制单位:英尺;英寸。</p>
        <p>
            实际长度:0.6,0.8,1,1.2,1.4,1.5(米)</p>
        <p>
            法兰标准:当实际长度小于等于1米时:a,b,c/当实际长度大于1米并且小于等于1.2米时:d,e,f/当实际长度大于1.2米:g,h,i</p>
        <p>
            实际长度与理论长度的关系:</p>
        <p>
            当理论长度小于0.6米时,实际长度为0.6米,当在0.6-1.5的范围内时,向上取最近的值(比如理论长度为0.9时,实际长度为1),大于1.5米时取1.5米</p>
        <p>
            说明:要求无刷新联动(包括textboxt和下拉框)</p>
    </body>
    </html>如上是一种偷懒的方法,还有就是手写ajax相关代码了。
      

  3.   

      <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
        <div>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                   <asp:DropDownList ID="ddlLB" runat="server" Width="15%" AutoPostBack="True" OnSelectedIndexChanged="ddlLB_SelectedIndexChanged">
                   </asp:DropDownList>
                     <asp:DropDownList ID="ddlChild" runat="server" Width="20%">
                   </asp:DropDownList>
                     </ContentTemplate>
            </asp:UpdatePanel>
            </div> 
     protected void ddlLB_SelectedIndexChanged(object sender, EventArgs e)
        {
            if(this.ddlLB.SelectedValue!=null)
            {
                
            }
        }
      

  4.   

    2,3楼的哥们,这样是不行的,实际情况中这个页面还有许多控件呢,顺序也不是这样的,基本上是每个控件都单独放在一个updatepanle里了.