473,473 Members | 1,882 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to trigger a postback from javascript

NWx
Hi,

How can I make a page to postback automatically, using JavaScript?
I need a JavaScript function as handled to page_load, but I don't know what
code to write to trigger postback.

Can anyone help me?
Regards
Nov 18 '05 #1
4 25123
formName.submit()

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"NWx" <te**@test.com> wrote in message
news:eO**************@TK2MSFTNGP11.phx.gbl...
Hi,

How can I make a page to postback automatically, using JavaScript?
I need a JavaScript function as handled to page_load, but I don't know what code to write to trigger postback.

Can anyone help me?
Regards

Nov 18 '05 #2
Call the __doPostBack function that ASP.NET creates:
__doPostBack(id,'');

If you want to see an example of this check out the Time Tracker starter
kit on www.asp.net. They do this to force a postback after selecting a date
from a popup calendar.

-John

"NWx" <te**@test.com> wrote in message
news:eO**************@TK2MSFTNGP11.phx.gbl...
Hi,

How can I make a page to postback automatically, using JavaScript?
I need a JavaScript function as handled to page_load, but I don't know what code to write to trigger postback.

Can anyone help me?
Regards

Nov 18 '05 #3
"NWx" <te**@test.com> wrote in news:eO**************@TK2MSFTNGP11.phx.gbl:
How can I make a page to postback automatically, using JavaScript?


The form has a submit method that you can call.

--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
ELKNews - Get your free copy at http://www.atozedsoftware.com

Nov 18 '05 #4
Hi,

if you want to cause the postback as if happening in behalf of another
control (means this controls postback event is raised as well), you can use
Page.GetPostBackEventReference to return the __doPostBack call (it returns
it as string and you need to place that on page to be called)

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"NWx" <te**@test.com> wrote in message
news:eO**************@TK2MSFTNGP11.phx.gbl...
Hi,

How can I make a page to postback automatically, using JavaScript?
I need a JavaScript function as handled to page_load, but I don't know what
code to write to trigger postback.

Can anyone help me?
Regards

Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mozzie ³ | last post by:
Can 'onbeforeunload' (ie) be used to trigger a javascript? I can't find any info on how or if this is possible. Regards.
1
by: Svein Terje Gaup | last post by:
When I try to validate my webpages on http://validator.w3.org the validation fails because of the auto-generated postback function: <script language="javascript"> <!-- function...
3
by: darrel | last post by:
I have a page that checks to see if it's a postback on page_load. I want it to do one of two different things depending on which object triggered the postback. Is there a way to check to see which...
2
by: Terence McGhee | last post by:
Hello. All I want to do is have my web app display a page with an animated gif on it. After a certain timespan, I want that page to redirect the user to another page. So, in effect, I can display a...
0
by: JoRo | last post by:
I found a great design template idea on this website http://www.csharphelp.com/archives2/archive383.html. But when I downloaded the code and tried to implement ControlsPage.aspx, I got a...
10
by: Beffmans | last post by:
Hi I want to trigger a postback in my parent page from my popup window which i opened with javascript. How to go about this? ch Beffer *** Sent via Developersdex...
2
by: Lars Netzel | last post by:
I open a popup from an aspx page and when done working in the popup i I need to update the aspx page in the background. I know how to get to the page in the background thru JavaScript...
2
by: wildman | last post by:
RE: Gridview textbox has data check without postback.. javascript? I have a gridview with a textbox. I can set the textbox to autopostback and check for a value in a prerender event to decide if...
1
by: Jethro | last post by:
Hi all working on someone elses code ! I have a javascript call at the end of the <BODYtag, which sets up a calendar utility connected to an image button. This works fine. However there is a...
1
by: pkeerthi86 | last post by:
 mouse actions  operating system actions  keyboard actions  timed actions which is correct
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.