Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to Post back page from Client side code?

Reply
Thread Tools

How to Post back page from Client side code?

 
 
Ahmad Jalil Qarshi
Guest
Posts: n/a
 
      10-26-2005
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


 
Reply With Quote
 
 
 
 
Tasos Vogiatzoglou
Guest
Posts: n/a
 
      10-26-2005
Use __doPostBack(<eventTarget>,<eventArgument>)...

 
Reply With Quote
 
 
 
 
Onin Tayson
Guest
Posts: n/a
 
      10-26-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
Niraj Ranka
Guest
Posts: n/a
 
      10-26-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to execute client-side code _after_ client-side validation? Bogdan ASP .Net 2 06-09-2008 01:31 PM
How does a dynamic control load post back data across post back?? =?Utf-8?B?Z29yaWxsYQ==?= ASP .Net 1 05-25-2007 05:02 AM
Client side script after client side validation with asp.net 2.0 Boss302 ASP .Net 0 11-21-2006 08:43 AM
How to Post back page from Client side code? Ahmad Jalil Qarshi ASP .Net Building Controls 3 10-26-2005 10:04 AM
How can I send back(Post back) some values from client machine Joby ASP .Net 0 05-14-2004 04:19 AM



Advertisments