PC Review


Reply
Thread Tools Rate Thread

Calling VB.NET CodeBehind From a Javascript on ASP.NET webpage

 
 
johnc
Guest
Posts: n/a
 
      18th Aug 2005
Hey all, just wondering if the subject of this post is possible. I
have a javascript on my asp page that detects browser onunload, and it
will successfully popup a messsage box. When I try to call a sub in my
codebehind, the sub never fires, and I receive no errors.

I've also tried unsuccessfully to take advantage of the application_end
and session_end sub's in the global.asax, but neither would work
correclty.

In case it matters, the sub in my codebehind simply queries an sql
database, and emails the information to my sales dept.

Thanks!

 
Reply With Quote
 
 
 
 
Dragon
Guest
Posts: n/a
 
      18th Aug 2005
Hi,

> Hey all, just wondering if the subject of this post is possible. I
> have a javascript on my asp page that detects browser onunload, and it
> will successfully popup a messsage box. When I try to call a sub in

my
> codebehind, the sub never fires, and I receive no errors.


You can't call a serverside sub in your client JS/VBS. Remember that at
the point client scripts execute, there's already no codebehind, and no
serverside code, so you just can't call them.

Maybe, you could open a pop-up window in unload event with some server
page, and execute your proc in it, but to my mind, it isn't a good idea.

Roman


 
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
Calling Javascript from codebehind... =?Utf-8?B?RWtrZW4gWnVpYmVy?= Microsoft ASP .NET 2 4th Jun 2004 02:16 AM
Re: calling codebehind method from javascript mikeb Microsoft ASP .NET 0 31st Mar 2004 06:26 PM
Re: calling codebehind method from javascript Konrad Rotuski Microsoft ASP .NET 0 31st Mar 2004 05:35 PM
Calling a javascript function from a codebehind Jan Eliasen Microsoft C# .NET 2 12th Mar 2004 07:56 AM
Calling a JavaScript Function from Codebehind Scott Wallace Microsoft C# .NET 0 17th Aug 2003 10:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:42 PM.