473,803 Members | 3,616 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Adding MessageBox to my aspx page

VMI
I know this isn't the best group to post aspnet question, but the MS asp.net
NG hasn't been very helpful lately.
I've been trying to add a messagebox following the examples I've seen on the
web, but with no luck.
I have an aspx page where the user enters a bunch of data and clicks
'Submit'. When the user clicks on the 'Submit', I want to run an SP that
returns true/false depending on the data. If false, then my MessageBox will
pop up saying "It's false. Do you want to make it true?". If the user clicks
Ok, then I'll load "myResult.aspx" .This is the pseudo-code for it:
private void btnClose_Click( object sender, System.EventArg s e)
{
bool result = "RUN MY STORED PROC";
if (result)
{
SHOW MY JAVASCRIPT MESSAGEBOX
}
}
PRIVATE VOID MESSAGEBOX()
{
IF (JAVASCRIPT MESSAGEBOX.RESU LT == "OK")
{
Response.Redire ct ("myResult.aspx ");
}
}

I've googled this, but I haven't found too many helpful links. The ones I've
found assume too many things and they only explain how to display a
messagebox (not how to process the result).
Any help is appreciated.
May 22 '06 #1
3 6499
hi,
1. add a hidden text box named txtHidden in .aspx file.

2. in your pseudo code,

private void btnClose_Click( object sender, System.EventArg s e)
{
txtHidden.Text = "RUN MY STORED PROC";

}

3. in end of .aspx file, before </body> tag, add the following script

<script language="javas cript">
if(document.all ("txtHidden").v alue =="false")
{
if(confirm(""It 's false. Do you want to make it true?")
{
window.open("my Result.aspx");
}
}

</script>
</body>
</HTML>

let me know if u have problem.
--
Regards,
Amal [MCP, MCS]
http://geocities.com/techsharing
"VMI" wrote:
I know this isn't the best group to post aspnet question, but the MS asp.net
NG hasn't been very helpful lately.
I've been trying to add a messagebox following the examples I've seen on the
web, but with no luck.
I have an aspx page where the user enters a bunch of data and clicks
'Submit'. When the user clicks on the 'Submit', I want to run an SP that
returns true/false depending on the data. If false, then my MessageBox will
pop up saying "It's false. Do you want to make it true?". If the user clicks
Ok, then I'll load "myResult.aspx" .This is the pseudo-code for it:
private void btnClose_Click( object sender, System.EventArg s e)
{
bool result = "RUN MY STORED PROC";
if (result)
{
SHOW MY JAVASCRIPT MESSAGEBOX
}
}
PRIVATE VOID MESSAGEBOX()
{
IF (JAVASCRIPT MESSAGEBOX.RESU LT == "OK")
{
Response.Redire ct ("myResult.aspx ");
}
}

I've googled this, but I haven't found too many helpful links. The ones I've
found assume too many things and they only explain how to display a
messagebox (not how to process the result).
Any help is appreciated.

May 22 '06 #2
VMI
Thanks for the post.
I understand most of your solution, but I don't understand how the the
button Click event is linked to the javascript code (i.e. when will this
javascript code run?).

Thanks.

"Amalorpavanath an Yagulasamy(AMAL )MCP,MCS" wrote:
hi,
1. add a hidden text box named txtHidden in .aspx file.

2. in your pseudo code,

private void btnClose_Click( object sender, System.EventArg s e)
{
txtHidden.Text = "RUN MY STORED PROC";

}

3. in end of .aspx file, before </body> tag, add the following script

<script language="javas cript">
if(document.all ("txtHidden").v alue =="false")
{
if(confirm(""It 's false. Do you want to make it true?")
{
window.open("my Result.aspx");
}
}

</script>
</body>
</HTML>

let me know if u have problem.
--
Regards,
Amal [MCP, MCS]
http://geocities.com/techsharing
"VMI" wrote:
I know this isn't the best group to post aspnet question, but the MS asp.net
NG hasn't been very helpful lately.
I've been trying to add a messagebox following the examples I've seen on the
web, but with no luck.
I have an aspx page where the user enters a bunch of data and clicks
'Submit'. When the user clicks on the 'Submit', I want to run an SP that
returns true/false depending on the data. If false, then my MessageBox will
pop up saying "It's false. Do you want to make it true?". If the user clicks
Ok, then I'll load "myResult.aspx" .This is the pseudo-code for it:
private void btnClose_Click( object sender, System.EventArg s e)
{
bool result = "RUN MY STORED PROC";
if (result)
{
SHOW MY JAVASCRIPT MESSAGEBOX
}
}
PRIVATE VOID MESSAGEBOX()
{
IF (JAVASCRIPT MESSAGEBOX.RESU LT == "OK")
{
Response.Redire ct ("myResult.aspx ");
}
}

I've googled this, but I haven't found too many helpful links. The ones I've
found assume too many things and they only explain how to display a
messagebox (not how to process the result).
Any help is appreciated.

May 22 '06 #3
button Click event is not linked to the javascript code.
the java script will run, whenever the page is refreshed.
that means, end of all server and client events.

so myResult.aspx will open whenever the condition
if(document.all ("txtHidden").v alue =="false") is true.

--
Regards,
Amal [MCP, MCS]
http://geocities.com/techsharing
"VMI" wrote:
Thanks for the post.
I understand most of your solution, but I don't understand how the the
button Click event is linked to the javascript code (i.e. when will this
javascript code run?).

Thanks.

"Amalorpavanath an Yagulasamy(AMAL )MCP,MCS" wrote:
hi,
1. add a hidden text box named txtHidden in .aspx file.

2. in your pseudo code,

private void btnClose_Click( object sender, System.EventArg s e)
{
txtHidden.Text = "RUN MY STORED PROC";

}

3. in end of .aspx file, before </body> tag, add the following script

<script language="javas cript">
if(document.all ("txtHidden").v alue =="false")
{
if(confirm(""It 's false. Do you want to make it true?")
{
window.open("my Result.aspx");
}
}

</script>
</body>
</HTML>

let me know if u have problem.
--
Regards,
Amal [MCP, MCS]
http://geocities.com/techsharing
"VMI" wrote:
I know this isn't the best group to post aspnet question, but the MS asp.net
NG hasn't been very helpful lately.
I've been trying to add a messagebox following the examples I've seen on the
web, but with no luck.
I have an aspx page where the user enters a bunch of data and clicks
'Submit'. When the user clicks on the 'Submit', I want to run an SP that
returns true/false depending on the data. If false, then my MessageBox will
pop up saying "It's false. Do you want to make it true?". If the user clicks
Ok, then I'll load "myResult.aspx" .This is the pseudo-code for it:
private void btnClose_Click( object sender, System.EventArg s e)
{
bool result = "RUN MY STORED PROC";
if (result)
{
SHOW MY JAVASCRIPT MESSAGEBOX
}
}
PRIVATE VOID MESSAGEBOX()
{
IF (JAVASCRIPT MESSAGEBOX.RESU LT == "OK")
{
Response.Redire ct ("myResult.aspx ");
}
}

I've googled this, but I haven't found too many helpful links. The ones I've
found assume too many things and they only explain how to display a
messagebox (not how to process the result).
Any help is appreciated.

May 23 '06 #4

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

Similar topics

8
29190
by: Don | last post by:
How can I add a Messagebox to my web application? I have a datatable in my web application and I'd like to show a messagebox when the table's empty. Thanks.
0
2529
by: zgraf | last post by:
Greetings. I've created a simple ASPX form that displays a record from a SQL Server table. I have a "Delete" button on the form. When the user clicks it, I want to prompt the user with a message ("Are you sure you want to delete... ?"). I realize the Yes/No Messagebox can be done via Javascript -- but how do I retrieve the Messagebox return value in my .ASPX page, so I can act on it (i.e., to perform the delete)?
5
1561
by: Curt Emich | last post by:
I always thought writing a simple diagnostic message in a message box would be pretty simple. Not in .NET. First, I wrote this amazingly complex piece of code: MessageBox.Show("yer mama") It wouldn't even complile. "Gee...", I mused. "Maybe there's no reference to that method in my project". I muzed correctly. So I added a reference to System.Windows.Forms, which is where our beloved "MessageBox" method
10
2355
by: Russ | last post by:
I've been trying to figure out how to show a simple messagebox with an OK button in my web client program (C#). I have looked at every reference to JScript and MessageBox that seemed even remotely like it could help, both in the VS help and in this NG. I found lots of examples of people saying how easy it is and showing examples, and examples in the help. But I have two problems: 1. All the examples show all the code in HTML, usually...
10
6022
by: Andrew | last post by:
Hi, I have a messagebox that pops up due to an event. I did it in javascript. ie. alert("Time's up. Assessment Ended"); I want to capture the OK and Cancel events of this alert messagebox. My code is in C#/ASP.NET. TIA. Andrew.
9
424
by: Greg | last post by:
Binding Manager & dataset - won't add record I've got an untyped dataset with controls bound through code. The user can select a question number from a bound combobox, and the question number and question text are displayed in bound textboxes. This part works fine. When I go to add a new record, the textboxes clear as they should. I enter a new question number and tab to the textbox for the question text. At this point, the text for the...
4
2558
by: mac | last post by:
Hi! I've created a simple ASPX form that displays a record from a SQL Server table. I have a "Delete" button on the form. When the user clicks it, I want to prompt the user with a message ("Are you sure you want to delete... ?"). I realize the Yes/No Messagebox can be done via Javascript -- but how do I retrieve the Messagebox return value in my .ASPX page? so I can act on it (i.e., to perform the delete)?
2
15076
by: ChrisCicc | last post by:
Hi All, I got a real doozy here. I have read hundreds upon hundreds of forum posts and found numerous others who have replicated this problem, but have yet to find a solution. Through testing I have been able to find the cause of the problem, and will describe it here first textually and then through a code example. The purpose of what I am trying to do is to create a postback-free web application through the use of ASP.net AJAX UpdatePanels...
3
2882
by: Alexander Vasilevsky | last post by:
How display MessageBox in aspx-page? http://www.alvas.net - Audio tools for C# and VB.Net developers
0
9564
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10548
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...
0
10316
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10295
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
9125
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7604
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5500
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
5629
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2970
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.