Hi,
Simply put, I have a control in MasterPage and another in content.
When the control in content fires off post back, MasterPage also runs
and returns post back. I want to control these where post back
happens in respected area, within content or within MasterPage. What
will be the simplest and logical way to implement this? TIA. 10 5143
When a postback occurs, the Init and Load events for both the Master Page
and the Content Page will be triggered. What, where, and when specifically
is it that you want to prevent code from being executed? Until you give more
detail on what you are trying to do, I'm not sure if anyone will be able to
help you.
--
Nathan Sokalski nj********@hotm ail.com http://www.nathansokalski.com/
<go*******@gmai l.comwrote in message
news:2c******** *************** ***********@l76 g2000hse.google groups.com...
Hi,
Simply put, I have a control in MasterPage and another in content.
When the control in content fires off post back, MasterPage also runs
and returns post back. I want to control these where post back
happens in respected area, within content or within MasterPage. What
will be the simplest and logical way to implement this? TIA.
the master page is just another control on the page that uses it, its
not a separate page.
-- bruce (sqlwork.com) go*******@gmail .com wrote:
Hi,
Simply put, I have a control in MasterPage and another in content.
When the control in content fires off post back, MasterPage also runs
and returns post back. I want to control these where post back
happens in respected area, within content or within MasterPage. What
will be the simplest and logical way to implement this? TIA.
That is a good point as well, a page that gives a good explanation of the
relationship between Content and Master Pages is: http://www.odetocode.com/Articles/450.aspx
--
Nathan Sokalski nj********@hotm ail.com http://www.nathansokalski.com/
"bruce barker" <no****@nospam. comwrote in message
news:et******** ******@TK2MSFTN GP05.phx.gbl...
the master page is just another control on the page that uses it, its not
a separate page.
-- bruce (sqlwork.com)
go*******@gmail .com wrote:
>Hi, Simply put, I have a control in MasterPage and another in content. When the control in content fires off post back, MasterPage also runs and returns post back. I want to control these where post back happens in respected area, within content or within MasterPage. What will be the simplest and logical way to implement this? TIA.
Thanks for reply. So I have a button with a textbox for submit in
MasterPage, like search feature. I also have similar setting in
Content but for to submit something else for postback action. User
sees both inputs. However, user may select to click one in MasterPage
but Content Also fires off and gets undesired result there. Vice
versa occurs when Content fires off and MasterPage also reacts. Ideal
solution would be to isolate both world. I hope I describe enough. I
apprieciate your reply and let me know if I need to clarify further.
Thanks.
Page_Load is the place where I would like to isolate the action,
either by bypassing the event or within this method to detect and skip
the most of logic there.
<go*******@gmai l.comwrote in message
news:68******** *************** ***********@m74 g2000hsh.google groups.com...
Page_Load is the place where I would like to isolate the action,
either by bypassing the event or within this method to detect and skip
the most of logic there.
As Bruce has explained, a MasterPage is nothing more than a special type of
UserControl. As such, it is fairly simple for a content page to communicate
with its MasterPage control, and vice versa, by defining properties and
setting their values: http://www.google.co.uk/search?sourc...ontent+page%22
In addition, it is possible to capture whether the page is being loaded
"first time" as it were, or as the result of a postback:
if (!IsPostback)
{
// this code runs first time
}
else
{
// this code runs on postback
}
--
Mark Rae
ASP.NET MVP http://www.markrae.net
I warned bruce and Nathan you might be hunting them down to warn them not to
top post. Thought I'd save you some time so you could focus on your real
value to us all..
"Mark Rae [MVP]" <ma**@markNOSPA Mrae.netwrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
<go*******@gmai l.comwrote in message
news:68******** *************** ***********@m74 g2000hsh.google groups.com...
>Page_Load is the place where I would like to isolate the action, either by bypassing the event or within this method to detect and skip the most of logic there.
As Bruce has explained, a MasterPage is nothing more than a special type
of UserControl. As such, it is fairly simple for a content page to
communicate with its MasterPage control, and vice versa, by defining
properties and setting their values: http://www.google.co.uk/search?sourc...ontent+page%22
In addition, it is possible to capture whether the page is being loaded
"first time" as it were, or as the result of a postback:
if (!IsPostback)
{
// this code runs first time
}
else
{
// this code runs on postback
}
--
Mark Rae
ASP.NET MVP http://www.markrae.net
Better be careful, Mark Rae will hunt you down and scold you for top posting
:-0
"Nathan Sokalski" <nj********@hot mail.comwrote in message
news:Of******** ******@TK2MSFTN GP02.phx.gbl...
That is a good point as well, a page that gives a good explanation of the
relationship between Content and Master Pages is:
http://www.odetocode.com/Articles/450.aspx
--
Nathan Sokalski nj********@hotm ail.com http://www.nathansokalski.com/
"bruce barker" <no****@nospam. comwrote in message
news:et******** ******@TK2MSFTN GP05.phx.gbl...
>the master page is just another control on the page that uses it, its not a separate page.
-- bruce (sqlwork.com)
go*******@gmail .com wrote:
>>Hi, Simply put, I have a control in MasterPage and another in content. When the control in content fires off post back, MasterPage also runs and returns post back. I want to control these where post back happens in respected area, within content or within MasterPage. What will be the simplest and logical way to implement this? TIA.
Better be careful, Mark Rae will hunt you down and scold you for top posting
:-0
"bruce barker" <no****@nospam. comwrote in message
news:et******** ******@TK2MSFTN GP05.phx.gbl...
the master page is just another control on the page that uses it, its not
a separate page.
-- bruce (sqlwork.com)
go*******@gmail .com wrote:
>Hi, Simply put, I have a control in MasterPage and another in content. When the control in content fires off post back, MasterPage also runs and returns post back. I want to control these where post back happens in respected area, within content or within MasterPage. What will be the simplest and logical way to implement this? TIA.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: techfuzz |
last post by:
I scoured this group and others looking for the best way to disable a
button after the first click to prevent multiple submissions, but
never did find anything that worked like they said it would. I went
ahead and wrote my own bit of code so I'm sharing it here for
everyone. Even though it doesn't really disable the button by greying
it out, it prevents the multiple submissions which it what I was
attempting to prevent all along. ...
|
by: Rob |
last post by:
Each time a webform is posted back (submitted), another URL is added to the browser's history list. My web application allows a back button to return to previously visited pages, but I do not wish to return to each Postback URL, but rather only the initial page URL. Is there a way to prevent Postback URL's from being added to the browser's history list
Thanks in advance for any help.
|
by: Ali |
last post by:
i am using visual studio 2005 and I am trying to create a popup calender so
when a user click on a image on the main form, a calender will then popup,
the user will select a date and the date will then be passed back to the main
form and populate a textbox. it works fine. but when i used master page for
all my pages and i put the textbox inside the content , the calender pops up
but when i select the date nothing happens .. the textbox was...
|
by: User |
last post by:
OK, I asked in a reply, but I've wasted far too long so I'm going to put
a new post out there in hopes that it will be more visible.
I have a MasterPage. I want to call a method declared in that class from
a Page that uses the MasterPage. How do I do that?
public partial class List : System.Web.UI.MasterPage
{
protected ArrayList m_SortList;
|
by: Herman verschooten |
last post by:
Hi,
I am creating my first real ASP.NET 2.0 site and want to use the some of the
new features. I created a masterpage with my main layout and added several
contentpages, no problem so far.
I added a members-only section where I want to use a second masterpage, and
am now having trouble. My member-startpage contains:
A WebPartManager and 1 WebPartzone, with 3 gridviews each connected to a
| |
by: Alex Maghen |
last post by:
Hi. I'm a little confused about the code that resides in the code-behind of a
MasterPage and the code that resides in the code-behind of the actual pages
that USE that MasterPage.
I'm noticing, for example, that the Page_Load on the specific page executes
before the Page_Load of its MasterPage. Is this right? But what I really want
to understand is VARIABLE SCOPE, etc. between the two.
For example: Is there a way for me to write code...
|
by: bill |
last post by:
I dynamically create buttons and associate them with an event using
AddHandler.
I want all the button events to fire at one time, when the page is posted,
instead of when each button is clicked.
How I stop the buttons from posting back when they are clicked?
Thanks
|
by: Tom |
last post by:
I have a VS.NET 2005 WEB application where I place all of my common controls
(ie header, nav, footer) into a mater page template. Then all of my web forms
inherit from the mater page template. All is well.
In the code behind in my materpage I have tried to code the isPostBack and
the Page.Master.IsPostback. But no matter which method I try, the Postback
returned is always false and my master page loads during each pstback.
Is there a...
|
by: GaryDean |
last post by:
"Unable to cast object of type 'ASP.masterpage_master' to type 'MasterPage"
This code has always worked but today it is getting the exception in the
subject line of this post...
protected void Page_Load(object sender, EventArgs e)
{
this.Master.HeadingLabel.Text = "Direct 4506 Purchase"; <--this
gets the cast exception
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |