473,382 Members | 1,611 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,382 software developers and data experts.

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.EventArgs e)
{
bool result = "RUN MY STORED PROC";
if (result)
{
SHOW MY JAVASCRIPT MESSAGEBOX
}
}
PRIVATE VOID MESSAGEBOX()
{
IF (JAVASCRIPT MESSAGEBOX.RESULT == "OK")
{
Response.Redirect ("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 6483
hi,
1. add a hidden text box named txtHidden in .aspx file.

2. in your pseudo code,

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

}

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

<script language="javascript">
if(document.all("txtHidden").value =="false")
{
if(confirm(""It's false. Do you want to make it true?")
{
window.open("myResult.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.EventArgs e)
{
bool result = "RUN MY STORED PROC";
if (result)
{
SHOW MY JAVASCRIPT MESSAGEBOX
}
}
PRIVATE VOID MESSAGEBOX()
{
IF (JAVASCRIPT MESSAGEBOX.RESULT == "OK")
{
Response.Redirect ("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.

"Amalorpavanathan 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.EventArgs e)
{
txtHidden.Text = "RUN MY STORED PROC";

}

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

<script language="javascript">
if(document.all("txtHidden").value =="false")
{
if(confirm(""It's false. Do you want to make it true?")
{
window.open("myResult.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.EventArgs e)
{
bool result = "RUN MY STORED PROC";
if (result)
{
SHOW MY JAVASCRIPT MESSAGEBOX
}
}
PRIVATE VOID MESSAGEBOX()
{
IF (JAVASCRIPT MESSAGEBOX.RESULT == "OK")
{
Response.Redirect ("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").value =="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.

"Amalorpavanathan 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.EventArgs e)
{
txtHidden.Text = "RUN MY STORED PROC";

}

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

<script language="javascript">
if(document.all("txtHidden").value =="false")
{
if(confirm(""It's false. Do you want to make it true?")
{
window.open("myResult.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.EventArgs e)
{
bool result = "RUN MY STORED PROC";
if (result)
{
SHOW MY JAVASCRIPT MESSAGEBOX
}
}
PRIVATE VOID MESSAGEBOX()
{
IF (JAVASCRIPT MESSAGEBOX.RESULT == "OK")
{
Response.Redirect ("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
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
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...
5
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") ...
10
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...
10
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...
9
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...
4
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...
2
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...
3
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.