datagrid中绑定了一组dropdownlist。
<asp:datagrid id="dgrdList" AutoGenerateColumns="False" BorderStyle="Outset" CellPadding="1" CellSpacing="2" runat="server">
<ItemStyle Wrap="False" BackColor="White"></ItemStyle>
<HeaderStyle Font-Bold="True" Wrap="False" BorderColor="#ffffff" BackColor="#8080FF"></HeaderStyle>
<Columns>
<asp:TemplateColumn HeaderText="">
<HeaderStyle Wrap="False" HorizontalAlign="Center"></HeaderStyle>
<ItemStyle Wrap="False" HorizontalAlign="Left"></ItemStyle>
<ItemTemplate>
<asp:DropDownList id="dropAddressList" Runat="server" Font-Size="12" DataSource="<%# Container.DataItem.AddressListC%>">
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>
本来,在<asp:DropDownList id="dropAddressList"></asp:DropDownList>加上AutoPostBack=true,就可以实现每一次SelectChange带来的画面提交。但是现在我只需要对一组dropdownlist中某一个进行提交,其他的不需要。

解决方案 »

  1.   

    所以我在代码里面加上了有AutoPostBack时生成的javascript代码,希望可以主动调用。
    <script language="javascript">
    <!--
    function __doPostBack(eventTarget, eventArgument) {
    var theform;
    if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
    theform = document.forms["Form1"];
    }
    else {
    theform = document.Form1;
    } theform.__EVENTTARGET.value = eventTarget.split("&").join(":");
    theform.__EVENTARGUMENT.value = eventArgument;
    theform.submit();
    }
    // -->
    </script>
    结果发现,我只要把
    <input type="hidden" name="__EVENTTARGET" value="" />
    <input type="hidden" name="__EVENTARGUMENT" value="" />
    加到.aspx里面,执行的时候就会发生编译错误。而不加的话,又提示找不到__EVENTTARGET这个对象。到底是怎么回事情呢???
      

  2.   

    我需要通过提交的信息在.aspx.vb进行处理
    所以不能够用__dopostback('','')
      

  3.   

    可以在后台判断条件在提交呀
    Page.RegisterStartupScript("postback", "<SCRIPT language='javascript'>__doPostBack('你要提交的dropdownlist','');</SCRIPT>")
      

  4.   

    在页面中我没有试过,在控件中我到是可以做的,你只要
    Implements IPostBackEventHandler不过你试试吧
     Protected Overloads Overrides Sub RaisePostBackEvent(ByVal sourceControl As System.Web.UI.IPostBackEventHandler, ByVal eventArgument As String)    End Sub
      

  5.   

    to zjf_dl(加盐的黑咖啡)
    到后台了不就是已经提交了吗
      

  6.   

    to rickjelly2004(rick & jelly)  Protected Overloads Overrides Sub RaisePostBackEvent(ByVal sourceControl As System.Web.UI.IPostBackEventHandler, ByVal eventArgument As String)    End Sub这样的处理,首先要有ByVal sourceControl As System.Web.UI.IPostBackEventHandler这么一个参数的传递,那这个怎么从页面上提交到服务器端呢
      

  7.   

    如果要通过提交的信息在后台进行处理
    POST之后可以在SELECT事件里写呀