PC Review


Reply
Thread Tools Rate Thread

Can we make confirm as a common function

 
 
ad
Guest
Posts: n/a
 
      10th Aug 2005
We must do with Javascirpt when develop web UI.
I write a alert function which can call from server side like:

public static void alert(Page myPage, string sMsg)
{
string myScritpt;
myScritpt = "<script> window.alert('"+sMsg+"');</script>";

myPage.RegisterStartupScript("", myScritpt);
}

I can call the alert function like:
alert (this, "my message");

I want to wrte a confirm as alert do, so I can call the confirm function
like:
if (confirm("Are you sure"))
{
.......
}

How can I write the confirm function?


 
Reply With Quote
 
 
 
 
Grant Merwitz
Guest
Posts: n/a
 
      10th Aug 2005
Place this in your page load, pointint it to your button you want the
confirm on:

btnMyButton.Attributes.Add("OnClick", "JavaScript: return confirm('Are you
sure');");




"ad" <(E-Mail Removed)> wrote in message
news:%2349%(E-Mail Removed)...
> We must do with Javascirpt when develop web UI.
> I write a alert function which can call from server side like:
>
> public static void alert(Page myPage, string sMsg)
> {
> string myScritpt;
> myScritpt = "<script> window.alert('"+sMsg+"');</script>";
>
> myPage.RegisterStartupScript("", myScritpt);
> }
>
> I can call the alert function like:
> alert (this, "my message");
>
> I want to wrte a confirm as alert do, so I can call the confirm function
> like:
> if (confirm("Are you sure"))
> {
> ......
> }
>
> How can I write the confirm function?
>
>



 
Reply With Quote
 
Curt_C [MVP]
Guest
Posts: n/a
 
      10th Aug 2005
ad wrote:
> We must do with Javascirpt when develop web UI.
> I write a alert function which can call from server side like:
>
> public static void alert(Page myPage, string sMsg)
> {
> string myScritpt;
> myScritpt = "<script> window.alert('"+sMsg+"');</script>";
>
> myPage.RegisterStartupScript("", myScritpt);
> }
>
> I can call the alert function like:
> alert (this, "my message");
>
> I want to wrte a confirm as alert do, so I can call the confirm function
> like:
> if (confirm("Are you sure"))
> {
> ......
> }
>
> How can I write the confirm function?
>
>


just pass the confirm() into the individual buttons clientside onClick
event.


--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Can I make a Common Array Class and create a instance of the Common Array Class with Type of a new class Peri Microsoft C# .NET 10 17th Oct 2007 07:37 AM
Trying to match up variables to a common list and confirm =?Utf-8?B?RGViS25pZ2h0NTY=?= Microsoft Excel Worksheet Functions 12 26th Jul 2007 09:40 PM
Re:how i make a window confirm to delete at datagrid? Saravana Microsoft ASP .NET 1 4th Oct 2004 04:27 PM
how i make a window confirm to delete at datagrid? Dexter Microsoft ASP .NET 2 3rd Oct 2004 11:43 PM
Using javascript return confirm function within asp.net sub Kathy Burke Microsoft ASP .NET 2 29th Dec 2003 04:00 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:37 PM.