dropdownlist 中有3个选项:
分别为:        <asp:DropDownList ID="DropDownList1" runat="server" Width="152px" AutoPostBack="True">
            <asp:ListItem Value="0">未处理</asp:ListItem>
            <asp:ListItem Value="1">通过</asp:ListItem>
            <asp:ListItem Value="2">驳回</asp:ListItem>
        </asp:DropDownList>
当选择驳回时候,才弹出thickbox。thickbox内嵌的是网页default2.aspx<a href="Default2.aspx?keepThis=true&TB_iframe=true&height=250&width=400" title="add a caption to title attribute / or leave blank" class="thickbox">例子1</a>问一下,怎样实现这个功能,小弟刚刚学会用thickbox,没有一点头绪

解决方案 »

  1.   

    你可以使用Ajax+jQuery试试
    去这里看看,有详细用法
    http://hi.baidu.com/zhanghongweiyang/blog/item/b8ae5b8d04bbd71bb21bbae0.html
      

  2.   


    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (DropDownList1.SelectedValue == "2")
            {           
                ClientScript.RegisterStartupScript(GetType(), "show", "$(document).ready(function(){ tb_show('add a caption to title attribute / or leave blank','Default2.aspx?keepThis=true&TB_iframe=true&height=250&width=400',false);});", true);
            }        
        }
      

  3.   

    Sandy945问一下,如果这种情况出现在ContentPage中,应该怎么解决?
      

  4.   

    ContentPage 是说 母板页么?  我没试过,应该没问题吧 ~   因为不涉及到 ID 的问题, 只是调用 thickbox.js 的一个方法。你遇到问题了么
      

  5.   

    page load中加上if not Page.IsPostBack then
    DropDownList1.attriabutes.add("onchange","selectOption();");
    end if
    页面加上js函数
    function selectOption()
    {
      var objId = '<%= DropDownList1.ClientID %>';
      var temp = document.getElementById(objId).value;  if (temp == '2')
      {
        //调用tb_show函数,如5楼所写的
      }
    }