hi,
i want to pop up a message box when a button is clicked. the situation
is something like this as follows.
protected void button1_click(.. , ..)
{
.......
........
.......
response.write(<script language="javascript"> or
language="vbscript">confirm or msgbox or etc..</script>)
if(clicked yes)
{
do the following
}
else
get out of the method
}
is there any way if user clicks yes on the confirm box or message box,
the rest of the code in button1 click method should be executed
otherwise get out of the method. Any help or reference is appreciated.
Thanks,
Ratnakar Pedagani 5 1213
btn.Attributes.Add("onClick", "return confirm('Do you really want to delete
the record?');");
HTH
Elton Wang
"ra*******@gmail.com" wrote: hi,
i want to pop up a message box when a button is clicked. the situation is something like this as follows.
protected void button1_click(.. , ..) { ....... ........ .......
response.write(<script language="javascript"> or language="vbscript">confirm or msgbox or etc..</script>) if(clicked yes) { do the following
} else get out of the method
}
is there any way if user clicks yes on the confirm box or message box, the rest of the code in button1 click method should be executed otherwise get out of the method. Any help or reference is appreciated.
Thanks, Ratnakar Pedagani
Hello Elton,
Thanks for your reply, but here i'm facing the problem., i forgot to
add a condition. i changed the code. In the following code, if the
cond1 is true, then the confirm message should pop up. if clicked yes,
i should be able to do something else within button click method. for
example
protected void button1_click(.. , ..)
{
x=callmethod1();
y=callmethod2();
z=str1;
if(z>40)
{
//pop up confirm box, "do you want to continue"
response.write(<script language="javascript"> or
language="vbscript">confirm or msgbox or etc..</script>)
if(clicked yes)
{
save the details in the database;
}
else
{
get out of the method
}
}
can you please let me know how to proceed further. Kindly let me know
if you need to know anything else.
Thanks & Regards,
Ratnakar Pedagani.
You should know that client-server (Web) application is different from
desktop one. Especially, in server-side code you can’t directly interact with
user. What I can suggest is to put your logic on client-side (javascript
function(s)). Only when postback, on server-side to save detail to DB:
Server Code:
Page_Load(){
// ...
btn.Attributes.Add("onClick", "return CheckZ();");
}
btn_Click(...)
{
// save info;
}
Client code:
<script>
function CheckZ()
{
var z = getZ;
if(z <=40)
{
return false;
}
Return confirm(confirm message);
}
</script>
HTH
"ra*******@gmail.com" wrote: Hello Elton,
Thanks for your reply, but here i'm facing the problem., i forgot to add a condition. i changed the code. In the following code, if the cond1 is true, then the confirm message should pop up. if clicked yes, i should be able to do something else within button click method. for example
protected void button1_click(.. , ..) { x=callmethod1(); y=callmethod2(); z=str1;
if(z>40) { //pop up confirm box, "do you want to continue" response.write(<script language="javascript"> or language="vbscript">confirm or msgbox or etc..</script>) if(clicked yes) { save the details in the database; } else { get out of the method } }
can you please let me know how to proceed further. Kindly let me know if you need to know anything else.
Thanks & Regards, Ratnakar Pedagani.
Do you guyz got any other ideaz, looks like these things are not
working for me? Thanks for your help
Regards,
Ratnakar Pedagani This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Hugh Welford |
last post by:
Hi Using WIN XP and FP2000
Using CDO.message to out put a message from my site, I get the following
error message 8004020f from using the code:-
strsql = "SELECT * FROM details WHERE patid...
|
by: Brian Keating EI9FXB |
last post by:
Would I be correct in saying that the only way to get a user message into a
Windows form would be to use P/Invoke with Message?
Of is there some part of the .NET API that I am totally un aware...
|
by: Rod |
last post by:
I have been working with ASP.NET 1.1 for quite a while now. For some
reason, opening some ASP.NET applications we wrote is producing the
following error message:
"The Web server reported...
|
by: Microsoft News |
last post by:
What I have is a message box that pops up. It is another browser window.
The code is a general function that you pass message, title and a key to.
The box works great except, that if you are on a...
|
by: ronscottlangham |
last post by:
I am working on a custom WCF EndpoingBehavior that will modify the
messages coming in and out of my Service. I am having an error
related to the modification of the message in the...
| |
by: =?Utf-8?B?QWRl?= |
last post by:
HI All,
I am encountering the following error when I try to send an email through a
SMTP server. I believe the problem lies with the authentication part when the
network crednetials are used,...
|
by: Steven Allport |
last post by:
I am working on processing eml email message using the email module (python
2.5), on files exported from an Outlook PST file, to extract the composite
parts of the email. In most instances this...
|
by: Philluminati |
last post by:
I have a Perl SOAP Server which returns this SOAP Message when
invoked:
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http://
www.w3.org/2001/XMLSchema-instance"...
|
by: bernd |
last post by:
Hi netties,
posted this in a different group already, which seems to be
inappropriate.
I create a message queue with msgget(), sent a 5-byte message to it
with msgsnd() and try to receive the...
|
by: forums_mp |
last post by:
Facing a design problem here and I'm not sure how to solve this. The
system consists of bi-directional communication between a subject
communicating with two (at least for now ) listeners. ...
|
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,...
| |
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...
|
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...
|
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: 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...
|
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...
|
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...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |