473,441 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,441 software developers and data experts.

How do I force a postback in the codebehind?

aaa
I am checking if a certain object is null and if it is I need to go back to
ther server and get this object can I force a postback in the code behind
and if so how?
Nov 19 '05 #1
3 46430
You need to call a javascript method. myForm.submit() will do.
location.reload() also will. Why do you want to do it in the code behind?
Why not to put a few lines if javascript in the .aspx page?

Eliyahu

"aaa" <so*****@microsoft.com> wrote in message
news:eP****************@TK2MSFTNGP14.phx.gbl...
I am checking if a certain object is null and if it is I need to go back to ther server and get this object can I force a postback in the code behind
and if so how?

Nov 19 '05 #2
your question makes no sense. codebehind is server processing, so there is
no need of a postback, you are already there.
-- bruce (sqlwork.com)

"aaa" <so*****@microsoft.com> wrote in message
news:eP****************@TK2MSFTNGP14.phx.gbl...
I am checking if a certain object is null and if it is I need to go back to
ther server and get this object can I force a postback in the code behind
and if so how?

Nov 19 '05 #3
"aaa" wrote:
I am checking if a certain object is null and if it is I need to go back to
ther server and get this object can I force a postback in the code behind
and if so how?

I'm not really sure what you mean, but if your in the codebehind there is no
way to execute postback but there is trick there by rendering a javascript
that will resubit the form:

....
....

if(requirePostback)
{
Response.Write("<script>document.forms[0].submit();</script>");
}

...
....

the statement above will reexecute submit.

Nov 19 '05 #4

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

Similar topics

4
by: Tom | last post by:
Does anyone know how ot force a postback in the codebehind? Thanks Tom
1
by: Julie Barnet | last post by:
I would like to be able to force a postback when a user tabs off of a user control. I currently have the following code: <script language="JavaScript1.1"><!-- function keyPressed() {...
7
by: moondaddy | last post by:
I have a user control being used instead of a frame page. when the user clicks on a menu item I need to send the ID (integer value) of that menu as a parameter in the postback of the user control...
3
by: Grigs | last post by:
Hello, I have an ASP.Net webform that shows numerous attributes of parts we sell. There is one portion of the form that I have the user click a button to get the information for. I did this for...
4
by: DEWright_CA | last post by:
I need to be able to from C# launch a postback. I have a command button that launches a function, I also have a javascript function that then keeps you from firing any other objects on the page,...
2
by: Byron Hopp [MCS] | last post by:
How do you force a postback, we have a button to save our users entry, but the button does not have a postback property (like the dropdownlistbox). Is there a way to force a postback? Byron...
0
by: jobs at webdos | last post by:
I have form with a checkbox with autopostback. When I click on the form I want to update a table with the boolean and stamp a datatime field, then come back and display *EXACTLY* what is in the db...
2
by: Phillip Vong | last post by:
I know how to check IsPostback, but what is the VB code to force a postback? I have a link I want to do a postback with this URL. I've tried using Postback and I've tried using doPostback. Am I...
2
by: DB | last post by:
I have a page that uses ComponentArt components. I have an imagebutton to update one part of the page and there is a graph that should update with it. The problem is the graph has some funky...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.