CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 1/13/2008 5:30:31 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 4 Views: 90 Favorited: 0 Favorite
5 Items, 1 Pages 1 |< << Go >> >|
idl1234
Asp.Net User
Cross Page Post back Using Master Page1/13/2008 5:30:31 PM

0

Hi thanks for reading my post.

Can anyone tell me how (if it's possible) to do a Cross-Page Postback when using a Master Page?

I used the following Code on the page I am posting to:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

If PreviousPage IsNot Nothing AndAlso PreviousPage.IsCrossPagePostBack Then
   Dim text As TextBox = CType(PreviousPage.FindControl(?TextBox1?), TextBox)
   If text IsNot Nothing Then
      Label1.Text = text.Text
   End If
End If
End Sub

It works fine if placed on a page that does not have a Master, but when I put it on a page that does have a Master Page the FindControl fails.

Is there another way I should reference a control on a Previous Page (using Cross-page Postback) when using Master Pages?

aadreja
Asp.Net User
Re: Cross Page Post back Using Master Page1/13/2008 7:07:10 PM

0

take a look at http://forums.asp.net/p/1032020/1417975.aspx


Thanks,
Ritesh

---------------------------------------------
Please do not forget to mark as Answer if my reply is helpful.
karpach96
Asp.Net User
Re: Cross Page Post back Using Master Page1/13/2008 7:13:41 PM

0

 Hi,

You can register type of previous page and then reference control directly.

top of aspx page 

<%@ PreviousPageType VirtualPath="~/PrevPage.aspx" %>

.vb

Page.PreviousPage.TextBox1

 


Regards,
MCTS .NET 2.0
Viktar Karpach

http://www.karpach.com
idl1234
Asp.Net User
Re: Cross Page Post back Using Master Page1/13/2008 9:39:49 PM

0

Thanks for your reply. The Previous Page directive does help.

I combined this with a Public Read Only Property for the control on the first page:

Public ReadOnly Property pp_TextBox1() As TextBox
Get
Return TextBox1
End Get
End Property
This worked fine for a TextBox. But unfortunately when I tried to do the same with a GridView bound field I ran into more problems ... 
My Gridview control displays summary information about employees and I want to link to another page that displays detailed info for whichever employee is selected from the GridView. I can do this using:
Public ReadOnly Property pp_EmployeeID() As String
GetReturn SummaryGridView.SelectedRow.Cells.Item(1).Text()
End Get
End Property
 

But it will only work if I put a Select CommandField on the first page and if the user clicks on the select button before clicking on the link button for the same row.


This of course is a ridiculous situation! I don't know any other way to get the value for a cell in the selected row of a GridView 

 

karpach96
Asp.Net User
Re: Cross Page Post back Using Master Page1/14/2008 2:05:50 AM

0

Hi,

In Page_Load event of second page use sender argument, which should be LinkButton that you clicked. Use parent property of LinkButton to find out selected row. Use debugger to find exact type of parent.


Regards,
MCTS .NET 2.0
Viktar Karpach

http://www.karpach.com
5 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Professional ASP.NET 2.0 Authors: Bill Evjen, Scott Hanselman, Farhan Muhammad, Srinivasa Sivakumar, Devin Rader, Pages: 1253, Published: 2005
PROFESSIONAL ASP.NET 2.0, SPECIAL EDITION Authors: Bill Evjen, Scott Hanselman, Devin Rader, Farhan Muha, Pages: 1586, Published: 2006
Pro ASP.NET 3.5 in C# 2008 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1498, Published: 2007
ASP.NET 2.0 cookbook Authors: Michael A. Kittel, Geoffrey T. LeBlond, Pages: 989, Published: 2005
Pro Asp.Net 3.5 In C# 2008: Includes Silverlight 2, 3rd Ed Authors: Matthew Macdonald, Mario Szpuszta, Pages: 1516, Published: 2009

Web:
Cross Page Postback with Master Pages - Windows Live Cross Page Postback with Master Pages. Here's a TIP when using cross page postbacks with master pages. More specificially when your control that has the ...
Cross Page Post Back When Using Mixture of Master Pages and Non ... Talk about Cross Page Post Back When Using Mixture of Master Pages and Non- Master Pages.
Cross Page Post back Using Master Page - ASP.NET Forums Is there another way I should reference a control on a Previous Page (using Cross-page Postback) when using Master Pages? ...
CodeProject: Cross Page Postback Without Circular Reference Errors ... May 3, 2008 ... Were it not for my use of a master page, I would not be writing ... From here forward, this is what I will be using for all cross page post backs. .... My ambition was to work with cross page postback not just rig it so ...
Design Considerations for Cross Page Post Backs in ASP.NET 2.0 Jul 24, 2005 ... Net 2.0's new Cross Page Postback feature vs Server. ... chance to restore data to it's controls before handing off processing to the destination web form using Server. ... Net 2.0 - Master Pages: Tips, Tricks, and Traps ...

Master Pages and cross page postback? - ng.asp-net-forum ... Mini Dev: Cross Page Postback with Master Pages Here's a TIP when using cross page postbacks with master pages. More specificially when your control that ...
Master Page, Response.Redirect and ViewState - ng.asp-net-forum ... Use cross page postback to post to the new page instead of redirecting and then you .... problem with images when using master pages in different folders ...
update label in masterpage from another page - ng.asp-net-forum ... must master pages be built using server controls? master pages and cross page postback? can't i access a masterpage from a usercontrol? ...
printing part of a page in asp.net -- URGENT - ng.asp-net-forum ... I will probably have to switch the master page for the printing? .... Master Pages and cross page postback? - ng.asp-net-forum . ... page errror - ng.asp-net -forum.security Please help Reload this Page Error using ASP. ...
TreeView SelectedNodeChanged Event Not Firing For Leaf Nodes - ng ... I Have a master page in which i have a treeview and on click of leaf nodes i got to assign some ... Page_Load on Source Page Firing on Cross-Page Postback . ...

Videos:
Charlie Rose - Sydney Pollack / Will Shortz Segment 1: Filmmaker Sydney Pollack discusses his documentary about the acclaimed architect, "Sketches of Frank Gehry". Segment 2: Will ...
Opencast Project Open House at UC Berkeley http://www.opencastproject.org/ Opencast is an initiative driven by higher education institutions to empower: institutions - to make ...
DVLH volume 1 (WRESTLING) Classic Luke Hadley wrestling video. http://www.lukehadley.com Hardcore wrestling is a form of professional wrestling that eschews traditional ...
Luke Hadley Wrestling DVD Classic Luke Hadley wrestling video. http://www.lukehadley.com Hardcore wrestling is a form of professional wrestling that eschews traditional ...
Classic Luke Hadley wrestling video (DVLH) Classic Luke Hadley wrestling video. http://www.lukehadley.com Hardcore wrestling is a form of professional wrestling that eschews traditional ...






validator problem

classes in c#

clubsite : smtp (godaddy) error and site being redirected to the error page

difficulties inserting data into multiple tables using access 2003 in one operation.

enter keypress in mozilla

captcha image

an elementary question about replicated websites

how to print getrows data

where is csc.exe?

controls still showing after setting visible=false

changing behaviour of dates.

load xml file

.net

application planning

about webmatrix

new to .net need some serious advice

adding table control

2 questions

validate() not getting called under .net 2.0

before unload

video - p2p vs media server streaming

create user wizard

testing if function has exicuted

crypting connection without using ssl.is it possible??

error: handles clause requires a withevents variable.

popup message after server side validation is not validate.

button with text in two lines

pass object from one page to another

help with languages

executing of external url in asp.net without displaying browser

   
  Privacy | Contact Us
All Times Are GMT