Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 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 27th, 2005, 11:27 AM
Authorized User
 
Join Date: Jun 2005
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Preventing postback on refreshing aspx page

Hi,

I have a submit button (server side control) on an aspx page.
I have a server side function in the code behind which is associated with this page.In this function, I open a child window using javascript window.open(...)
When I refresh this page in the browser, the button's function gets called and the child window opens up even though I did not click on the submit button.
That means postback event is getting fired automatically on refresh of the page.

Is there any way in which I can prevent the button's code behind function getting executed when I refresh the parent window....??


Thanks in advance..

livehed
 
Old June 27th, 2005, 01:14 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

please post your code.

 
Old June 27th, 2005, 01:22 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Take a look at this article: http://msdn.microsoft.com/library/de...rockaspnet.asp

It explains how to detect a refresh post back...

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Don't Mug Yourself by The Streets (Track 9 from the album: Original Pirate Material) What's This?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Preventing page refresh from asp.net button hericles ASP.NET 1.0 and 1.1 Professional 2 October 8th, 2008 04:29 PM
Preventing access to a page in PHP Steve777 PHP How-To 1 July 22nd, 2005 01:18 PM
refreshing XML withour refreshing the page sasidhar79 XML 1 January 12th, 2005 05:16 AM
Preventing tab controls from changing page badgolfer VS.NET 2002/2003 2 December 17th, 2003 05:35 AM
Preventing Page Caching neeter HTML Code Clinic 3 June 5th, 2003 01:19 PM





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