dll函数public void myfun(string url)
{
    System.Web.HttpContext.Current.Response.Redirect(url);
}

解决方案 »

  1.   

    c#后台代码已经是dll了,源文件就是xxx.aspx.cs,编译后的dll文件就是webpath\bin\projectname.dll
      

  2.   

    Just this???
    我创建了一个test1.aspx和一个test.cs文件,内容如下,现在希望把test1.aspx的内容submit到test.cs中,test.cs处理test1.aspx提交的变量,请问在test1.aspx中的action部分怎样写?在test.cs中如何把处理结果输出成一个aspx页面?请给新手一个帮助吧。
    test1.aspx
    <%@ Page language="c#" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <html>
      <body MS_POSITIONING="GridLayout">

        <form id="Form1" method="post" action=test.dll>
    User Name:<input type=text name=userid value=HRAdmin> Password: <input type=text name=password value=hradmin>
    <br>
    <input type=submit name="Submit" value="Submit">
        </form>

      </body>
    </html>
    test.cs
    using System;
    using System.IO;
    using System.Web;
    using System.Collections;
    using System.Collections.Specialized;
    using System.Data.OracleClient;namespace test
    {
    public class Test
    {
    public Test()
    {
    HttpContext httpconn =HttpContext.Current;

    NameValueCollection allvar= httpconn.Request.Form; string[] arr = allvar.AllKeys; for (int i = 0; i<arr.Length; i++){
    Console.Write ("var" + i + ": "+arr[i]);
    }
    }
    }
    }
      

  3.   

    你为什么要用一个.cs文件呢?如果你要是将参数传递给一个test.aspx文件中,在后台的test.aspx.cs去处理再转到其他的页不就可以了么,何必难为自己呢?!