473,396 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 7862
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*******@gmail.com> wrote in message
news:lp*****************@newssvr31.news.prodigy.co m...
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="javascript">
function buttonClick()
{
var text = prompt('Enter the new name');
document.getElementById('hiddenInput').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**********@discussions.microsoft.com> wrote in message
news:09**********************************@microsof t.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="javascript">
function buttonClick()
{
var text = prompt('Enter the new name');
document.getElementById('hiddenInput').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
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...
5
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.