日期:2014-05-17  浏览次数:20448 次

传值接收的问题
js
JScript code
function PhotoName() {
                window.open("FileUpload.aspx?type=Joins", "self", "top=200,left=200,height=300,width=610,toolbar=no,menubar=no, align=center,scrollbars=no,Resizable=no,location=no,status=no");

  }

C# code
   <form id="form1" runat="server" action="File.ashx">
    <div>
        <asp:Button ID="Button1" runat="server" Text="Button" 
            OnClientClick="PhotoName()"/>   
    </div>
    </form>

单击按钮,js调用PhotoName()方法,打开FileUpload.aspx将type传过去,如何在File.ashx文件中接收该值

------解决方案--------------------
string type= Request.QueryString["type"].ToString();
------解决方案--------------------
在pageload中requst.querystring["type"]
------解决方案--------------------
C# code
string s = context.Request.Form["C1"];//接受表单值post方式
            string type = context.Request.QueryString["type"];//Get方式接收

------解决方案--------------------
+1,context.xxx
探讨

C# code
string s = context.Request.Form["C1"];//接受表单值post方式
string type = context.Request.QueryString["type"];//Get方式接收

------解决方案--------------------
探讨

C# code
string s = context.Request.Form["C1"];//接受表单值post方式
string type = context.Request.QueryString["type"];//Get方式接收