CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
web_forms
getting_started
data_presentation_controls
dotnetnuke
data_access-sql_server_sql_server_express_and_sqldatasource_control
security
client_side_web_development
novell-support-groupwise-6x-clients
data_access-data_access_and_objectdatasource_control
asp-net_ajax-asp-net_ajax_control_toolkit
novell-support-netware-6x-install-upgrade
asp-net_ajax-asp-net_ajax_discussion_and_suggestions
novell-support-netware-6x-administration-tools
master_pages_themes_and_navigation_controls
configuration_and_deployment
novell-support-netware-client-winnt-2x-xp
novell-support-groupwise-7x-clients
asp-net_ajax-asp-net_ajax_ui
novell-support-edirectory-netware
community-free_for_all
visual_studio_2005
novell-support-groupwise-6x-install-setup
data_access-xml_and_xmldatasource_control
control-cancel
novell-support-iprint
advanced_asp-net-crystal_reports
data_access-xml_web_services
microsoft-public-access
novell-community-chat
state_management
novell-support-netware-6x-abends-hangs
dotnetnuke-getting_started
novell-support-groupwise-6x-gwia
-net_languages-c
novell-support-identity-manager-engine-drivers
novell-support-groupwise-discontinued
advanced_asp-net-architecture
opensuse-org-suse-linux-support-install-configure-administration
dotnetnuke-custom_modules
novell-support-groupwise-7x-install-setup-admin
novell-support-netware-6x-storage-media
novell-support-groupwise-6x-agents
installation_and_setup
data_access-access_databases_and_accessdatasource_control
windows-hosting_open_forum
visual_web_developer_2005_express
novell-support-groupwise-6x-web-access
novell-support-netware-6x-server-backup
macromedia-dreamweaver
novell-support-netware-5x-administration-tools
novell-support-ifolder
novell-support-bordermanager-install-setup
novell-support-imanager
microsoft-public-dotnet-framework-aspnet
novell-support-netware-5x-install-upgrade
novell-support-cluster-services
novell-support-bordermanager-proxies
novell-support-newsflash
advanced_asp-net-sql_server_reporting_services
microsoft-public-dotnet-languages-csharp
web_parts_and_personalization
about_this_site-feedback_on_this_website
ibm-software-websphere-portal-server
novell-support-netware-dns-dhcp
novell-support-zenworks-desktops-4x-app-launcher
-net_languages-visual_basic_-net
advanced_asp-net-custom_server_controls
novell-support-bordermanager-vpn
novell-support-ndps-neps
microsoft-public-sqlserver-programming
novell-support-netware-webserver
community-jobs
novell-support-netware-4x
advanced_asp-net-mobile_and_handheld_devices
internet_explorer_web_controls
novell-support-zenworks-desktops-4x-install-setup
novell-support-edirectory-linux
novell-support-groupwise-7x-gwia
development_tools-web_matrix_general_discussions
microsoft-public-access-formscoding
macromedia-flash
community-announcements
portal_starter_kit
novell-support-zenworks-desktops-4x-management-agent
novell-support-zenworks-patch-management
novell-support-native-file-access
microsoft-public-access-queries
microsoft-public-access-forms
novell-support-groupwise-7x-web-access
novell-support-netware-small-business-6x
data_access-active_directory_and_ldap
novell-support-edirectory-windows
novell-support-groupwise-7x-agents
novell-support-ichain
data_access-oracle
novell-support-zenworks-desktop-management-6x-imaging
novell-support-groupwise-7x-wireless
novell-support-netware-5x-abends-hangs
advanced_asp-net-localization
novell-support-zenworks-desktop-management-7x-imaging-server-nw-win




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: Date Entered: 4/17/2007 6:47:15 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 1 Views: 33 Favorited: 0 Favorite
2 Items, 1 Pages 1 |< << Go >> >|
"megakid" <>
NewsGroup User
MasterPage & CrossPagePostBack woes...4/17/2007 6:47:15 PM

0

Hi,

I'm developing a website with a global masterpage - this masterpage has a search box and submit button with its PostBackURL set to "Search.aspx".

When I submit the form using this button, I can easily access the text value of this search box like so:

My getter set up in the MainMasterFile.master:

1    <%@ Master Language="VB" ClassName="MainMasterFile" %>
2    
3    <script runat="server">
4        Public ReadOnly Property SearchString() As String
5            Get
6                Return SearchTextBox.Text
7            End Get
8        End Property
9    </script>

 In Search.aspx.vb in Page_Load:

1            If (Page.PreviousPage IsNot Nothing AndAlso PreviousPage.IsCrossPagePostBack) Then
2                searchString = CType(PreviousPage.Master, ASP.MainMasterFile).SearchString
3            Else
4                searchString = Master.SearchString
5            End If

This all works fine until I add a "repeat" search box onto Search.aspx which includes more advanced forms of searching, now I have 3 routes to loading this page:

  1. From another page (PreviousPage.IsCrossPagePostBack = True) using the masterpage textbox
  2. From Search.aspx using the masterpage textbox (PreviousPage.IsCrossPagePostBack = False)
  3. From Search.aspx using the page declared search textbox

Is there anyway I can differenciate routes 2 and 3?  I need them to have different behaviours when Page_Load is run.

Thanks,

 

"megakid" <>
NewsGroup User
Re: MasterPage &amp; CrossPagePostBack woes...4/17/2007 7:49:44 PM

0

Hi,

After playing around and searching I came up with a perfect solution, incase anyone else is having this issue:

In page_load of Search.aspx.vb I registered a Handler:

AddHandler Master.SearchButton.Click, AddressOf MasterPageSearchButton_Click

(you will need to cast Master to your particular masterfile, or add MasterType declaration at the top of Search.aspx) so when Search.aspx was active, it handled the master page click.

Now I have 2 click events (one for the Search.aspx advanced search, one for the masterpage quick-search button) and the page load IsCrossPagePostBack if statement to handle each of the eventualities.

 

2 Items, 1 Pages 1 |< << Go >> >|


Free Download:













dot net menu

how to set <title>'s skinid

drop shadow and highlighting of dynamic menus

windows marketplace design

error in sitemappath

can't reach control placed in loginview

how can i make autopostback to false of treeview in asp.net 2.0

default button when using a masterpage

tree view control

how to add seperators in horizontal menu control?

need help with layout, how do i get nice forms without the grid?

masterpage search problem

check & uncheck all nodes of tree view.

need help with menu navigation control

label in contentplaceholder

i'm "stumped" on treeview

treeview...selectively collapsing/expanding sub sections?

chaining masterpages...

question about menu item style

xmlsitemapprovider requires that sitemap nodes have unique urls.

unnecessery footer movement in master page

updatable sitemapprovider

applying skins on a dropdownlist

multiple master page

set master page <body onload=xxxx> from content page

how to get rid of url in parent node in web.sitemap without getting error when running the file.

open a treeview at the right place

treeview root displayed as text

css compatibility with .net dynamic themes

hiding menuitems depending on roles using sitemap

sitemap not working based on roles

how to put the 'cascading' back into 'cascading style sheets'?

why default page is always loaded when visiting other pages?

css border for an image in the content placeholder...

form problem(s)

how to access a web user control in masterpage from form?

how to force a "refresh" of content page via code?

how to set multi language feature in a master page

master page wish

any other method to hide/show the sitemap content other then using roles???

not able to apply master page in web.config

error while using "&" symbol in the url of web.sitemap

page dependency matrix + objects

the master page does not allow the child page to grow down

rootnode on treeview will not expand by default

masterpage path for <scripts..>

site works in firefox, but not ie

treeview collapse/expand problem on postback

treeview with navigateurl and populateondemand does postback first time each node clicked

i've been looking at this for too long - menu issue

 
Search This Site:

 
  Privacy | Contact Us
All Times Are GMT