PC Review


Reply
Thread Tools Rate Thread

Call Javascript confirm from code behind

 
 
tshad
Guest
Posts: n/a
 
      4th May 2009
In 3.5 is there a way to call a javascript confirm box from the code - not a
button - and get the response back before continuing on?

In my program, I want to be able to check the database to see if a company
exists after the save button is pressed and if it does not, then popup a box
asking if the user really wants to add this new company or not.

If so, continue with the save, if not stop the processing.

Thanks,

Tom


 
Reply With Quote
 
 
 
 
tshad
Guest
Posts: n/a
 
      5th May 2009
I wasn't sure where to put it.

Thanks,

Tom

"Mark Rae [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "tshad" <(E-Mail Removed)> wrote in message
> news:O$(E-Mail Removed)...
>
>> In 3.5 is there a way to call a JavaScript confirm box from the code

>
> Yes there is, but...
>
> ...you're in the wrong newsgroup - for ASP.NET questions please post in
> microsoft.public.dotnet.framework.aspnet
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net



 
Reply With Quote
 
Cor Ligthert[MVP]
Guest
Posts: n/a
 
      5th May 2009
Thad,

There is a bunch of methods you can use in code behind with the C# language.

http://msdn.microsoft.com/en-us/libr...r_methods.aspx

http://msdn.microsoft.com/en-us/libr...r_methods.aspx

The one you ask for is the startupscript

Cor


"tshad" <(E-Mail Removed)> wrote in message
news:O$(E-Mail Removed)...
> In 3.5 is there a way to call a javascript confirm box from the code - not
> a button - and get the response back before continuing on?
>
> In my program, I want to be able to check the database to see if a company
> exists after the save button is pressed and if it does not, then popup a
> box asking if the user really wants to add this new company or not.
>
> If so, continue with the save, if not stop the processing.
>
> Thanks,
>
> Tom
>


 
Reply With Quote
 
Cor Ligthert[MVP]
Guest
Posts: n/a
 
      5th May 2009
Mark,

The ASPNet newsgroup is program language neutral.
In that newsgroup are examples given in VB, C++ and C#

While that is here not the situation.

Cor
 
Reply With Quote
 
Cor Ligthert[MVP]
Guest
Posts: n/a
 
      5th May 2009
Mark,

Why

I read
Call...................................................................................................

What makes that so special to ASPNET.

I have checked it, and the OP has got as answer a VB example.

Cor

"Mark Rae [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "Cor Ligthert[MVP]" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
>> The ASPNet newsgroup is program language neutral.
>> In that newsgroup are examples given in VB, C++ and C#
>>
>> While that is here not the situation.

>
> Look at the title of the topic - this is clearly an ASP.NET question...
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net


 
Reply With Quote
 
Cor Ligthert[MVP]
Guest
Posts: n/a
 
      5th May 2009
Mark,

In the way you write it, it is when you are doing your job in an office you
have to go to an office newsgroup

In my idea it is not important where the C# language is used, but that it is
used.

:-)

Cor

"Mark Rae [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "Cor Ligthert[MVP]" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>
>>>> The ASPNet newsgroup is program language neutral.
>>>> In that newsgroup are examples given in VB, C++ and C#
>>>>
>>>> While that is here not the situation.
>>>
>>> Look at the title of the topic - this is clearly an ASP.NET question...

>>
>> Why
>>
>> I read
>> Call...................................................................................................
>>
>> What makes that so special to ASPNET.

>
> Well, principally that the OP wants to know how to call a JavaScript
> confirm() method from code behind - when did you last do that in anything
> other than ASP.NET...?
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net


 
Reply With Quote
 
Gareth Erskine-Jones
Guest
Posts: n/a
 
      5th May 2009
On Tue, 5 May 2009 12:33:29 +0200, "Cor Ligthert[MVP]"
<(E-Mail Removed)> wrote:

>Mark,
>
>Why
>
>I read
>Call...................................................................................................
>
>What makes that so special to ASPNET.


The "..from code behind" bit surely?

GEJ
 
Reply With Quote
 
Cor Ligthert[MVP]
Guest
Posts: n/a
 
      5th May 2009
>>
>>What makes that so special to ASPNET.

>
> The "..from code behind" bit surely?
>

Yes that distinct it from #xxxx# included code in an ASPX (ASPNET) page.

A code behind is pure C#, VB or C++ not much different from a Window
Service, Windows Form or whatever code to build an assembly.

Cor

 
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
Call Javascript confirm from code behind tshad Microsoft ASP .NET 2 5th May 2009 09:26 PM
how do I call a code-behind procedure from javascript? Scott M. Microsoft ASP .NET 3 31st Mar 2008 12:08 AM
call javascript from code behind Mike Microsoft ASP .NET 2 4th Oct 2007 04:30 PM
Run server code on a javascript confirm =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?= Microsoft ASP .NET 4 9th Dec 2004 03:57 AM
javascript-confirm via C# code? Daniel Gustafsson Microsoft C# .NET 4 5th Aug 2003 02:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:03 PM.