show Open Dialog on a Button click

2019-08-20 20:11发布

I have to show a Open Dialog box on a button click. Basically I have to upload a file, for this I am using FileUpload control, but I don’t want to show it to user instead I want to show a Button

1条回答
Lonely孤独者°
2楼-- · 2019-08-20 20:42
    <script type="text/javascript">
        $(document).ready(function() {
           $("#btn").click(function() {
              $("#FileUpload1").click(); 
              return false; 
           }); 
        });
    </script>
    <style type="text/css">
       .Class { visibility:hidden;}
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
       <asp:Button ID="btn"  runat="server" Text="Send File"/>
        <asp:FileUpload ID="FileUpload1" CssClass="Class" runat="server" />
查看更多
登录 后发表回答