473,614 Members | 2,089 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Javascript Prompt and ASP.NET

In my ASP.NET application, I wish to have a page for administrators to
edit items in a list. Preferably, I would like to use the javascript
prompt for the 'rename' function, and a javascript alert box for the
'delete' function. When the user clicks 'rename', the javascript prompt
asks for the new name. When the user clicks 'delete', a javascript
alert asks the user if he really wants to delete that item. Here is an
example of what my list would look like with the functions on the side:

Link
---------------------------------------
google.com [rename] [delete]
msn.com [rename] [delete]
slashdot.com [rename] [delete]

I am not concerned with the java alert message, it is just a simple
function that I can add to the OnClick event. However, I am concerned
with prompting the user when they click 'rename' and sending that value
back to my ASP.NET script. Does ASP.NET have a built-in function to
prompt a user? If not, what are some of your suggestions?
--
J.P. Cummins
jp*******@gmail .com
Nov 19 '05 #1
3 7883
CMA
hi,

ASP.NET is for run at the server. (c# or vb.net)

so if you need to do this.. really need to use JavaScript.

else you can do the rename in this way.

create a page with a textbox and "Done" button.

when the user click on "rename"...
you can open a small window with JavaScript window.open()..
after DONE, do the DB updates from the button click event of the DONE...then
close the second window... then refresh the first window.

this is just an idea.

hope this helps,
CMA
"J.P. Cummins" <jp*******@gmai l.com> wrote in message
news:lp******** *********@newss vr31.news.prodi gy.com...
In my ASP.NET application, I wish to have a page for administrators to
edit items in a list. Preferably, I would like to use the javascript
prompt for the 'rename' function, and a javascript alert box for the
'delete' function. When the user clicks 'rename', the javascript prompt
asks for the new name. When the user clicks 'delete', a javascript
alert asks the user if he really wants to delete that item. Here is an
example of what my list would look like with the functions on the side:

Link
---------------------------------------
google.com [rename] [delete]
msn.com [rename] [delete]
slashdot.com [rename] [delete]

I am not concerned with the java alert message, it is just a simple
function that I can add to the OnClick event. However, I am concerned
with prompting the user when they click 'rename' and sending that value
back to my ASP.NET script. Does ASP.NET have a built-in function to
prompt a user? If not, what are some of your suggestions?
--
J.P. Cummins
jp*******@gmail .com

Nov 19 '05 #2
I would have a hidden input on your page that accepts the input from the
prompt, then just submit the form and update the database:

<code>
<script language="javas cript">
function buttonClick()
{
var text = prompt('Enter the new name');
document.getEle mentById('hidde nInput').value = text;
document.forms( 0).submit();
}
</script>

<input type="button" id="rename" value="Rename">
<input type="hidden" id="hiddenInput " runat="server" value="">
</code>

"J.P. Cummins" wrote:
In my ASP.NET application, I wish to have a page for administrators to
edit items in a list. Preferably, I would like to use the javascript
prompt for the 'rename' function, and a javascript alert box for the
'delete' function. When the user clicks 'rename', the javascript prompt
asks for the new name. When the user clicks 'delete', a javascript
alert asks the user if he really wants to delete that item. Here is an
example of what my list would look like with the functions on the side:

Link
---------------------------------------
google.com [rename] [delete]
msn.com [rename] [delete]
slashdot.com [rename] [delete]

I am not concerned with the java alert message, it is just a simple
function that I can add to the OnClick event. However, I am concerned
with prompting the user when they click 'rename' and sending that value
back to my ASP.NET script. Does ASP.NET have a built-in function to
prompt a user? If not, what are some of your suggestions?
--
J.P. Cummins
jp*******@gmail .com

Nov 19 '05 #3
I built a selection of user controls that create various client-side prompts
and dialogs, and you can reuse these or copy the code. See:
http://www.daveandal.net/books/6744/default.asp
for the main page and download links, or run these examples from the online
examples page:
a.. Alert, Prompt and Confirm Dialogs from a User Control
a.. Browser-Adaptive Dialogs from a User Control
a.. Internet Explorer Dialog Windows from a User Control
a.. Adaptive Dialog Windows from a User Control

"Matt Hamilton" <Ma**********@d iscussions.micr osoft.com> wrote in message
news:09******** *************** ***********@mic rosoft.com...
I would have a hidden input on your page that accepts the input from the
prompt, then just submit the form and update the database:

<code>
<script language="javas cript">
function buttonClick()
{
var text = prompt('Enter the new name');
document.getEle mentById('hidde nInput').value = text;
document.forms( 0).submit();
}
</script>

<input type="button" id="rename" value="Rename">
<input type="hidden" id="hiddenInput " runat="server" value="">
</code>

"J.P. Cummins" wrote:
In my ASP.NET application, I wish to have a page for administrators to
edit items in a list. Preferably, I would like to use the javascript
prompt for the 'rename' function, and a javascript alert box for the
'delete' function. When the user clicks 'rename', the javascript prompt
asks for the new name. When the user clicks 'delete', a javascript
alert asks the user if he really wants to delete that item. Here is an
example of what my list would look like with the functions on the side:

Link
---------------------------------------
google.com [rename] [delete]
msn.com [rename] [delete]
slashdot.com [rename] [delete]

I am not concerned with the java alert message, it is just a simple
function that I can add to the OnClick event. However, I am concerned
with prompting the user when they click 'rename' and sending that value
back to my ASP.NET script. Does ASP.NET have a built-in function to
prompt a user? If not, what are some of your suggestions?
--
J.P. Cummins
jp*******@gmail .com

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2370
by: Rich | last post by:
Hello, I'm learning JavaScript.........or Trying to and am stuck. My old brain is just not understanding why this isn't working. Internet Explorer reports an error but the error is Cryptic to me. Any Help would be Greatly Appreciated.
5
3912
by: hcross | last post by:
This project is a web based html and Javascript site. I am working on mac at the moment. This script works except for attempting to open new window once complete. As you can see, i am new to javascript coding. Can i open a new browser window after my prompts and alerts have finished. I am not sure what i am doing wrong. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
0
8627
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8279
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8433
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5540
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4052
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4127
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1747
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1425
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.