473,398 Members | 2,389 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,398 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 46418
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.