如何处理输入框javascript和asp.net? [英] how to deal with Input box javascript and asp.net?

查看:64
本文介绍了如何处理输入框javascript和asp.net?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个数据库Web应用程序,其功能之一是从数据库中删除记录。



我需要向用户提示将要删除的记录的一些信息,同时要求用户指定删除的原因存储在数据库中。谁能告诉我怎样才能用javascript和asp.net做到这一点?这可能吗?



如何将数据发送到javascript以显示在输入框中?如何从javascript输入框中获取数据?



非常感谢,

Missa

Hi,

I have a database web application one of its function is to delete a record from the database.

I need to prompt the user with some information of the record that will be deleted and in the same time ask the user to specify a reason of deletion to be stored in the database. Can anyone tell me how can I do that with javascript and asp.net? is this possible?

How can I send data to the javascript to be displayed in the input box? and how can I get the data from the javascript input box?

Many thanks,
Missa

推荐答案

根据您的解释,您有两个任务要执行:

1)获取用户确认删除记录对他/她是好的。

2)记录删除的原因。


任务1可以使用javascript确认框完成,代码片段如下:

You have two tasks to perform as per your explanation:
1) Get a confirmation from user that deletion of record is OK with him/her.
2) Record a reason for deletion.

Task 1 can be accomplished using javascript confirm box, code snippet given below:
function delete_confirm()
{
  var r=confirm("This will delete the record. Are you sure you want to continue?")
  if (r==true)
  {
      // Here comes Task 2
      window.open("DeleteReason.aspx");//Open a popup here which will have a textbox and a submit button, where user will enter reason and submit. On submit button click, update the reason field in the database and close the this window.
  }
}


这篇关于如何处理输入框javascript和asp.net?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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