我需要将aaa.aspx中的一个DropDownList或者TextBox的值,传向bbb.asp
求教具体代码!!!
第一:如何转向asp页面?因为DropDownList需要<form runat=server>,不能直接POST,那最佳方法是什么?
第二:如何把控件或者变量的值,传出去?
代码指导下,谢谢大侠
求教具体代码!!!
第一:如何转向asp页面?因为DropDownList需要<form runat=server>,不能直接POST,那最佳方法是什么?
第二:如何把控件或者变量的值,传出去?
代码指导下,谢谢大侠
请教有没有能给个代码我看看?
如何将aaa.aspx中的一个DropDownList或者TextBox的值,传向bbb.asp处理?
http://****/bbb.asp?para=textbox的值。最好用HttpServerUtility.UrlEncode 编码一下。
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
</head>
<body>
<form id="form1" runat="server" action="bbb.asp">
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" />
</form>
</body>
</html>
或者 <asp:Button ID="Button1" runat="server" Text="Button" PostBackUrl="bbb.asp" />
bbb.asp里面接收
Request.Form("DropDownList1")
Request.Form("TextBox1")
无法提供此类型的页。
说明: 由于已明确禁止所请求的页类型,无法对该类型的页提供服务。扩展名“.asp”可能不正确。 请检查以下的 URL 并确保其拼写正确。
请问何意?如何处理?配置问题?代码如下,求解:
<form id="form1" runat="server">
<asp:SqlDataSource ID="SqlDS1" runat="server"
ConnectionString="<%$ ConnectionStrings:LimaxOAConnectionString %>"
ProviderName="<%$ ConnectionStrings:LimaxOAConnectionString.ProviderName %>">
<SelectParameters>
<asp:Parameter DefaultValue="1" Name="DeptLv" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
<asp:DropDownList ID="DPL1" runat="server" AutoPostBack="True"
DataMember="DefaultView" DataSourceID="SqlDS1" DataTextField="DeptName"
DataValueField="DeptID" EnableTheming="True">
</asp:DropDownList>
<asp:TextBox ID="txt1" runat="server" Width="511px"></asp:TextBox>
<asp:HiddenField ID="HiddenField1" runat="server" />
</form>
<asp:input type="button" value="提交到asp" onclick="subasp()"></asp:input>
<iframe id="iframeSaveForm" name="iframeSaveForm" src="" width="100%" height="0"></iframe>
<script type="text/javascript">
var strFormID = '<%=form1.ClientID%>';
function subasp() {
document.getElementById(strFormID).action = "HumanAddProcessing.asp?Step=2";
document.getElementById(strFormID).target = "iframeSaveForm"; // 隐藏一个iframe作为action
document.getElementById(strFormID).submit();
}
</script>始终无法转向HumanAddProcessing.asp