Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 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
  #1 (permalink)  
Old August 10th, 2007, 10:23 AM
Authorized User
 
Join Date: Jun 2007
Location: , , .
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default Executing Javascript on Page_Load

Hi All,
I have a asp.net web form which executes a javascript function on click of Radiobutton list.

However it stopped working after I added AutoPostback = true to a dropdown in my web form.

I want to execute the javascript function everytime a postback occurs or page is refreshed...!
How can I do that..?

Thanks,
--Monika
  #2 (permalink)  
Old August 10th, 2007, 11:48 AM
Friend of Wrox
 
Join Date: Feb 2006
Location: noida, UP, India.
Posts: 133
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to gaurav_jain2403
Default

Hi monica. Can you explain your problem in better way.
  #3 (permalink)  
Old August 10th, 2007, 02:12 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You can put a JS call in the body onload client side event. If you only want the javascript to run on a postback call, you could use the RegisterStartupScript method of the page's ClientScript property after testing for IsPostback.

For more:
http://msdn2.microsoft.com/en-us/lib...tupscript.aspx

-Peter


Similar Threads
Thread Thread Starter Forum Replies Last Post
Executing a JavaScript Function from XSL IronStar XSLT 5 July 8th, 2010 07:49 PM
AJAX, javascript not executing html code niklas JSP Basics 0 August 17th, 2006 04:27 AM
page_load() hassel vijayapteET ASP.NET 1.0 and 1.1 Basics 2 October 6th, 2005 01:30 PM
Executing from JavaScript C# functions see07 ASP.NET 1.x and 2.0 Application Design 1 March 1st, 2005 07:02 PM
Page_Load not working! New2ASPnet General .NET 6 July 28th, 2004 01:53 PM





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