Solved

Yes or No Messagebox in ASP.NET (vb)

Posted on 2011-09-28
5
453 Views
Last Modified: 2012-05-12
Hello all,

I need to display a message box with the Yes or No buttons and the legend "Are you a current user?" on it when the user clicks on an image.

If the user click on Yes I need to redirect the page to LOGIN.ASPX and if the user clicks on NO I need to redirect to SIGNUP.ASPX.

Can this be done with JavaScript?

Thanks!

Paula.
0
Comment
Question by:pvg1975
  • 3
  • 2
5 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 36720475
<script language="javascript" type="text/javascript">
if( confirm("Are you a current user?") ) {
   location.href = "/path/to/LOGIN.ASPX";
}
else {
   location.href = "/path/to/SIGNUP.ASPX";
}
</script>

Open in new window

0
 
LVL 82

Expert Comment

by:leakim971
ID: 36720478
more infos (Confirm box) : http://www.w3schools.com/js/js_popup.asp
0
 

Author Comment

by:pvg1975
ID: 36720492
Hey Leak! How are you?

And how can I call that script when the user clicks on an image?! Sorry Im so basic... :(
0
 

Author Closing Comment

by:pvg1975
ID: 36720508
NEver mind, I got it. What a shame that the text of the buttons cannot be changed. Thanks Leak!
0
 
LVL 82

Expert Comment

by:leakim971
ID: 36720559
Hi pvg1975,

I'm fine, thanks?
yes the text can't be replaced for security purpose
for example a coder may invert the labels and cause some troubles to the users

see you soon
Regards
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
A procedure for exporting installed hotfix details of remote computers using powershell
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now