Discussion on:

7
Comments

Join the conversation!

Follow via:
RSS
Email Alert
0 Votes
+ -
"You can determine if a page is being loaded as a result of a cross postback by checking the PreviousPage object. A null value indicates a regular load, while a null value signals a cross postback."

Which begs the question, what if there's a null value instead?
0 Votes
+ -
From msdn
jmiller@... 31st Jan 2007
The Page class exposes a property named PreviousPage. If the source page and target page are in the same ASP.NET application, the PreviousPage property in the target page contains a reference to the source page. (If the page is not the target of a cross-page posting, or if the pages are in different applications, the PreviousPage property is not initialized.) By default, the PreviousPage property is typed as Page.
0 Votes
+ -
You are not constrained to just the asp:button class.
The other button types of asp:imagebutton and asp:linkbutton also support the features that Tony has described in this great article.

Rod
HOW DO YOU DO THAT IN MULTIPLE PAGES
Source page : source.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="source.aspx.cs" Inherits="source" <>
. . .

void Page_Load(object sender, System.EventArgs e)
{
if (IsCrossPagePostBack)
. . .
object x = (Object)PreviousPage.FindControl("TextID");
. . .
}

Why press Button (ID="return") on source page, source.aspx, the target page, target.aspx, load on locally/refresh on the source page, but NOT show/display on another new page?
0 Votes
+ -
i need code add comment to my site please help topsokdna@gmail.com
Keyboard Shortcuts:
Prev
Next
Toggle
Join the conversation
Formatting +
BB Codes - Note: HTML is not supported in forums
  • [b] Bold [/b]
  • [i] Italic [/i]
  • [u] Underline [/u]
  • [s] Strikethrough [/s]
  • [q] "Quote" [/q]
  • [ol][*] 1. Ordered List [/ol]
  • [ul][*] · Unordered List [/ul]
  • [pre] Preformat [/pre]
  • [quote] "Blockquote" [/quote]

Join the TechRepublic Community and join the conversation! Signing-up is free and quick, Do it now, we want to hear your opinion.