473,396 Members | 2,003 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,396 software developers and data experts.

IsCrossPostBack always return false

I've been trying for a while, but unfortunately I can't get a
solutions, neighter I was able to find it in google.

In the CrossPostBack referred page the property IsCrossPostBack is
always set to false, while it should be set to true if the
CrossPostBack occured: is there anybody who can explain me why?

Thanks,
Lorenzo

Jun 16 '06 #1
3 2681
Hi,

usage of IsCrossPagePostBack is a bit weird. You don't check it from Page
but from PreviousPage property.

Say on page1.aspx you have

<asp:Button ID="Button1" runat="server" Text="Button"
PostBackUrl="page2.aspx" />

And on page2.aspx in code

If Not Page.PreviousPage Is Nothing Then

If PreviousPage.IsCrossPagePostBack Then
Response.Write("It is a cross-page postback")
End If
'Essentially this means that IsCrossPagePostBack property is
sort of clumsy
'If PreviousPage property is non-null, that's already enough to
know it's a cross-page post
End If

If you use C# then it's just checking if(PreviousPage != null){...} and so
on

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"Lore" <lo******@libero.it> wrote in message
news:11**********************@r2g2000cwb.googlegro ups.com...
I've been trying for a while, but unfortunately I can't get a
solutions, neighter I was able to find it in google.

In the CrossPostBack referred page the property IsCrossPostBack is
always set to false, while it should be set to true if the
CrossPostBack occured: is there anybody who can explain me why?

Thanks,
Lorenzo

Jun 17 '06 #2
To add,

it's essentially that source page's IsCrossPagePostBack is true. Reason is
that posting to second page also invokes the original posting page, and
there you might need the info if it's participating a cross-page post or
not.

Of course PreviousPage could be non-null when ttere's also Server.Transfer.
See:
http://msdn2.microsoft.com/en-us/library/ms178141.aspx
http://msdn2.microsoft.com/en-US/library/ms178139.aspx
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"Lore" <lo******@libero.it> wrote in message
news:11**********************@r2g2000cwb.googlegro ups.com...
I've been trying for a while, but unfortunately I can't get a
solutions, neighter I was able to find it in google.

In the CrossPostBack referred page the property IsCrossPostBack is
always set to false, while it should be set to true if the
CrossPostBack occured: is there anybody who can explain me why?

Thanks,
Lorenzo

Jun 17 '06 #3
Thank you very much.

Lorenzo
"Teemu Keiski" <jo****@aspalliance.com> ha scritto nel messaggio
news:uy**************@TK2MSFTNGP05.phx.gbl...
To add,

it's essentially that source page's IsCrossPagePostBack is true. Reason is
that posting to second page also invokes the original posting page, and
there you might need the info if it's participating a cross-page post or
not.

Of course PreviousPage could be non-null when ttere's also
Server.Transfer. See:
http://msdn2.microsoft.com/en-us/library/ms178141.aspx
http://msdn2.microsoft.com/en-US/library/ms178139.aspx
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"Lore" <lo******@libero.it> wrote in message
news:11**********************@r2g2000cwb.googlegro ups.com...
I've been trying for a while, but unfortunately I can't get a
solutions, neighter I was able to find it in google.

In the CrossPostBack referred page the property IsCrossPostBack is
always set to false, while it should be set to true if the
CrossPostBack occured: is there anybody who can explain me why?

Thanks,
Lorenzo


Jun 19 '06 #4

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

Similar topics

2
by: OtisUsenet | last post by:
Hello, I am trying to call Javascript from FORM's onSubmit, and return false, so the form is not actually submitted. Normally I can just add 'return false;' to onSubmit to accomplish this, like...
6
by: Tim::.. | last post by:
Can someone tell me why the value of my Boolean is always false! Even after I have declared that my variable iNews should equal TRUE it seems to remain false... Can some please explain why... ...
3
by: comp.lang.php | last post by:
class ThumbView extends PaginationView { function ThumbView() {} /** * Determine if the original image is actually an image and thus a thumbnail can be generated at all * * @access public...
0
by: tjonsek | last post by:
I am working with directories in PHP for the first time. I have code that I've changed multiple times to try different things. I would think this is pretty standard fare so I'm not sure why I can't...
13
by: alvin.yk | last post by:
Hi, Normally, a piece of code such as <a href="http://www.yahoo.com" onclick="alert('hello');return false;">link</a> will stop the browser from actually going to href's destination....
12
by: snow | last post by:
Hi All, I noticed if file path has a white space, for example "C:\my document \test.txt", the function File.Exists(filePath) always return false in release mode. How could I make this function...
40
by: nufuhsus | last post by:
Hello all, First let me appologise if this has been answered but I could not find an acurate answer to this interesting problem. If the following is true: C:\Python25\rg.py>python Python...
5
by: dwb0407 | last post by:
I am testing out an idea for an IE7 only user base. The idea is that there are a bunch of Input fields on a form. Each field validates itself "onblur" like so. I want logically should be able to...
7
Haitashi
by: Haitashi | last post by:
I have a form that calls a function using the onClick event in the submit button. I would like this function to return false if the username is taken. The the original function, which I've tested,...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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,...
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.