当我在Asp.Net Vb中单击“确定”按钮时如何进行确认弹出窗口 [英] How To Do Popup With Confirmation When I Click Ok Button In Asp.Net Vb

查看:55
本文介绍了当我在Asp.Net Vb中单击“确定”按钮时如何进行确认弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我正在尝试显示确认框我创建了以下代码,当我单击确定并取消按钮时,它应关闭弹出窗口,但形成我没有关闭。任何人都可以帮我解决。下面是html代码和另外一件事,如果我使用javascript它显示错误$未定义任何人都可以帮助我使用任何其他选项来解决。



Hi I was trying to display confirmation box I have created the below code and when I click ok and cancel buttons it should close the popup window but form me its not closing. can anyone help me to solve. Below is the html code and one more thing if I use javascript it shows error "$" is undefined can anyone help me to use anyother option to solve.

<div class="box">
	<a class="button" href="#popup1">Upload Document</a>
</div>

<div id="popup1" class="overlay">
	<div class="popup">
		<h2>Upload Document</h2>
		<a class="close" href="#">×</a>
		<div class="content">
			<form action="" method="post" enctype="multipart/form-data" name="form" id="form1">
<label>Choose File 
<input type="file" multiple="true" style="width: 315px" />
                <br />
                <br />
                Destination Folder
<input type="file" multiple="true" style="width: 317px" />
                <br />
                <br />
                <br />

</label>
</form>
		    <asp:Button ID="btnOk" runat="server" Text="OK"

            <asp:Button ID="btnCancel" runat="server" Text="Cancel" />
		</div>





以上代码我尝试正确显示如果我上传文件后单击确定没有上传,点击取消也没有任何人建议我做的改变。还有一件事而不是文件上传我们有像Choose文件夹这样的选项,因为对于目标文件夹我必须创建按钮名称选择文件夹。



The above code I tried its displaying correctly if I click Ok after uploading the file is not uploading and click cancel also no change can anyone suggest me to do. And one more thing instead of file upload do we have option like Choose folder because for destination folder I have to create button name choose folder.

推荐答案

未定义任何人都可以帮我用另一个选项来解决。



" is undefined can anyone help me to use anyother option to solve.

<div class="box">
	<a class="button" href="#popup1">Upload Document</a>
</div>

<div id="popup1" class="overlay">
	<div class="popup">
		<h2>Upload Document</h2>
		<a class="close" href="#">×</a>
		<div class="content">
			<form action="" method="post" enctype="multipart/form-data" name="form" id="form1">
<label>Choose File 
<input type="file" multiple="true" style="width: 315px" />
                <br />
                <br />
                Destination Folder
<input type="file" multiple="true" style="width: 317px" />
                <br />
                <br />
                <br />

</label>
</form>
		    <asp:Button ID="btnOk" runat="server" Text="OK"

            <asp:Button ID="btnCancel" runat="server" Text="Cancel" />
		</div>





上面的代码我尝试正确显示如果我点击确定上传文件后没有上传,点击取消也没有任何人建议我做的改变。还有一件事而不是文件上传,我们有像Choose文件夹这样的选项,因为对于目标文件夹,我必须创建按钮名称选择文件夹。



The above code I tried its displaying correctly if I click Ok after uploading the file is not uploading and click cancel also no change can anyone suggest me to do. And one more thing instead of file upload do we have option like Choose folder because for destination folder I have to create button name choose folder.


有很多方法可以处理它但很简单就是低于一个

There are many ways you can handle it but simple is below one
//just call a function on button click and return true of user click on OK
function confirmSubmit() {
      var agree=confirm("Are You Sure you want to Delete?");
      if (agree)
       return true ;
      else
       return false ;
    }

//in aspx
<asp:button id="btnDel" runat="server" text="DELETE" onclientclick="confirmSubmit()" xmlns:asp="#unknown" />


这篇关于当我在Asp.Net Vb中单击“确定”按钮时如何进行确认弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆