Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Professional
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 13th, 2006, 03:00 AM
Registered User
Join Date: Jun 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to call a codebehin function on onblur event??

Hai All,

How can we call a codebehind function on onblur event of a control in asp.net 1.1?The control may be a web server control,html control,html server control or a web user control.
Actually, we can call a script function on such an event.But, how to call a codebehind one?

Or else, how to call a codebehind function from a javascript function?
Any suggestions?? Please welcome...

Old June 14th, 2006, 02:43 PM
Wrox Author
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons

This is generally what you are trying to do:

            strJavaScript.Append("if (typeof(Page_ClientValidate) == 'function') { ")
            strJavaScript.Append("if (Page_ClientValidate() == false) { return false; }} ")
            strJavaScript.Append("this.value = 'Please wait...';")
            strJavaScript.Append("this.disabled = true;")
            strJavaScript.Append(Page.GetPostBackEventReferenc e(Me.btnSubmit))
            btnSubmit.Attributes.Add("onClick", strJavaScript.ToString)

This javascript is added to a button and it disables the button on the client side and calls the btnSubmit_click() event in my code behind when a user clicks it. You get the general idea and should be able to make it work with your application.

"The one language all programmers understand is profanity."

Similar Threads
Thread Thread Starter Forum Replies Last Post
Call a Button's click event sams ASP.NET 1.0 and 1.1 Professional 3 July 24th, 2007 03:32 AM
calling a codebehind function on onblur event vishnupriya.kamalakaram ASP.NET 1.0 and 1.1 Basics 2 July 7th, 2006 08:25 AM
How to call javascript function from VB function vinod_yadav1919 VB How-To 0 February 13th, 2006 06:03 AM
tabindexes don't work with onBlur function in Net elisabeth Javascript 14 November 24th, 2004 11:07 AM
Alternative to onBlur() event ashu_gupta75 Classic ASP Basics 3 April 30th, 2004 09:07 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.