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

How to Post back page from Client side code?

Hi,

I am developing a website in ASP.NET. I want to have a client side code to
confirm the deletion of some information from backend database. I want to
use a Message Box have two buttons "Yes" and "No" to confirm the deletion.

Now I want if the user press "Yes" the page should be posted back to the
server to delete the information from database and do nothing when user
press "No" button means don't post back the page.

Anybody there to help me.

with best Regards,
Ahmad Jalil Qarshi
Nov 19 '05 #1
3 1396
Use __doPostBack(<eventTarget>,<eventArgument>)...

Nov 19 '05 #2
You can add an onClick attribute to your Button & handle the confirmation
using the confirm javascript method.

On your page load event:

YourButtonNameHere.Attributes.Add("onclick", "<script>return confirm('Do
you want to continue deleting the record(s)?');</script>");

That's all there is to it!
"Ahmad Jalil Qarshi" <ah*********@SPAMhotmail.com> wrote in message
news:OP**************@TK2MSFTNGP09.phx.gbl...
Hi,

I am developing a website in ASP.NET. I want to have a client side code to
confirm the deletion of some information from backend database. I want to
use a Message Box have two buttons "Yes" and "No" to confirm the deletion.

Now I want if the user press "Yes" the page should be posted back to the
server to delete the information from database and do nothing when user
press "No" button means don't post back the page.

Anybody there to help me.

with best Regards,
Ahmad Jalil Qarshi

Nov 19 '05 #3
Hello,

Please add the javascript function to the onclik event on the button by
adding hte functioname in the attritubes on the button. like

buttonname.attributes.add("onclick",functionname)

And in the functio jsut write
functionanem
(
return confirm('do u want to delete');
)

It will work.

Regards
--
Niraj Ranka
The will to be successfull is waste, unless u have the will to prepare!!!

"Ahmad Jalil Qarshi" <ah*********@SPAMhotmail.com> wrote in message
news:OP**************@TK2MSFTNGP09.phx.gbl...
Hi,

I am developing a website in ASP.NET. I want to have a client side code to
confirm the deletion of some information from backend database. I want to
use a Message Box have two buttons "Yes" and "No" to confirm the deletion.

Now I want if the user press "Yes" the page should be posted back to the
server to delete the information from database and do nothing when user
press "No" button means don't post back the page.

Anybody there to help me.

with best Regards,
Ahmad Jalil Qarshi

Nov 19 '05 #4

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

Similar topics

6
by: Phillip N Rounds | last post by:
I have a webform, from which I have to submit info to another site. Their instructions are to have a html form, with the following as the submit: <form method="post"...
6
by: Phillip N Rounds | last post by:
I have a webform, from which I have to submit info to another site. Their instructions are to have a html form, with the following as the submit: <form method="post"...
6
by: Paul Perot | last post by:
Hi All: I was wondering if it was possible to evoke a post back event during code execution. I have a form that contains file specific information. I would like to iterate through an array of...
3
by: Ahmed Hashem | last post by:
Hi All; I hope that you can help me in replying to my question. I have a web form that have many post backs to get data from the web server. Every time I use one of those post backs all the page...
6
by: guoqi zheng | last post by:
In a regular html form, when user press "enter" key, the form will be submitted. However, in ASP.NET web form, a form will only be submitted (post back) when a special button is clicked. Many...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.