第二个问题:<input type="file" runat="server" id="file1">

解决方案 »

  1.   

    第一个问题:
       如何在单行编辑框里输入回车时,让它触发某个按钮的单击事件
    使用javascript的事件,onKeyPress,然后调用按钮的onClick事件。第二个问题:
       如果点击某个按钮时打开系统的选择文件的对话框(比如发邮件时,添加附件),要用api函数吗?应该怎么做?
    <input type="file" runat="server" id="file1">,他的SaveAs可以帮助你把文件通过http流存放在服务器上面。
      

  2.   

    第1噶问题
    private void textBox1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
    {
    if(e.KeyData == Keys.Enter)
    {
    this.button1_Click(sender,e); }

    }
      

  3.   

    1.<input type="submit" value="BUTTON1" name="B1">
    type为submit
    2.不需加载API
      

  4.   

    错拉,我用的是winform hehe 看错了
      

  5.   

    第二个问题:<input type="file" runat="server" id="somefile">
      

  6.   

    1.
    RegisterStartupScript("focus", "<script language=javascript>document.all('txtpwd').focus()</script>")
                txtPwd.Attributes.Add("onkeydown", "if(event.keyCode==13) event.keyCode=9")
                btnLogin.Attributes.Add("onfocus", "this.click();")2.
    <INPUT class="butfull" id="UploadFile" style="WIDTH: 154px; HEIGHT: 18px" type="file">
      

  7.   

    麻烦各位能讲的细些吗?
    我是初学,对asp也不是很熟。这些代码我要加在什么地方呢,总不是加在页面的.aspx文件里吧?谢谢大家了。
      

  8.   

    是加在.aspx里面.
    点窗体上的HTML就可以看到代码.