C#private void Button1_Click(object sender, System.EventArgs e)
{
  Response.Redirect("http://localhost/index.aspx?Button=1", true);
}private void Button2_Click(object sender, System.EventArgs e)
{
  Response.Redirect("http://localhost/index.aspx?Button=2", true);
}

解决方案 »

  1.   

    js:
    <script language=javascript>
    function button1_onClick()
    {
    window.location="http://localhost/index.aspx?Button=1";
    }
    function button2_onClick()
    {
    window.location="http://localhost/index.aspx?Button=2";
    }
      

  2.   

    asp文件中的超级联接。需要直接写上类似“http://localhost/index.aspx?Button=1”
      

  3.   

    button=1,是什么意思?button的id号?还是左键按下?
      

  4.   

    不知道你指的点两个按钮指向不同的页面是什么意思?
    button和hyperlink的区别只是button要提交表单的数据
    而提交表单数据的页面由form的action属性定死拉
    用上面大家的方法只能在第二个页面接收到button参数
    form里面的其它变量都不会有了。
    如果不需要提交表单,那就直接用hyperlink就可以了
      

  5.   

    我的意思是将两步合为一步:1.超级联接http://localhost/index.aspx  2.点击该页面中的button1,即执行button1_click().
    想将两步合为一步,作为超级联接。应该怎么写?
      

  6.   

    用linkbutton控件
    属性url="index.aspx";
      

  7.   


    private void Button1_Click(object sender, System.EventArgs e)
    {
      Response.Redirect(string.Format("http://localhost/index.aspx?Button=(0)", ButtonID), true);
    }
      

  8.   

    刚刚写错了一点:
    private void Button1_Click(object sender, System.EventArgs e)
    {
      Response.Redirect(string.Format("http://localhost/index.aspx?Button={0}", ButtonID), true);
    }
      

  9.   

    我是在html文件中超级连接。〈a  href="http://localhost/index.aspx?Button={0}">hello</a>
    可以直接这么写吗?
      

  10.   

    这么写根本体现不出button的id号。