Web Forms :: Access Masterpage Control From Other Page
Dec 27, 2010
i have a masterpage and an default.aspx page that derives from masterpage. On default.apsx, i list products. when i click add basket buton that product is added to shoppingbasket. i do this using jquery. On mastepage,there is a label that shows how many product is in shopping basket. i want to do this. when i click add basket on default.aspx, label control on masterpage show the new product count on shoppingbasket.How can i access masterpage control and change using javascript/jquery from default.aspx.
View 7 Replies
Similar Messages:
Apr 12, 2010
I have a textbox on a masterpage called txtNotes
I have a button on a content page called btnNotes
I am trying to access the txtNotes textbox on the MasterPage using the following code and I get and error saying "Object reference not set to an instance of an object.
[code]....
View 1 Replies
Dec 17, 2010
The website will have public and private (members) access.I'm using VB and MS access database. Registering, login, MasterPage (Master1), default.aspx and users (members.aspx) pages are already set up. What I wanted or what I'm thinking to do is to also base the members.aspx on the MasterPage.
When a user logged in, I wanted to add additional menu (reserved only to members) to the MasterPage and
remove/hide unnecessary menu. Here is a scheme of what I want:
MasterPage + default.aspx: (visible to the public)
Menu1
Menu11, Menu12, Menu13
Menu2
Menu21, Menu22, Menu23
MasterPage + members.aspx: (When user login)
Menu1
Menu11, Menu12, Menu13
Menu3
Menu31, Menu32, Menu33
If the user logout, it will return to MasterPage + default.aspx. Nowing that if the user authentication successful, he will redirected to members.aspx,
1. how can I, when loading members.aspx, manage the MasterPage so that I can show and hide some of its menu? how to use members controls on the MasterPage?
2. in case I'm wrong with what I'm trying to to do, what is your advice?
3. FYI, I'm using VB. Any code in C# will also be OK. I will just have to convert it.
4. I might probably use placeHolder to show and hide these menu in the Page_load event of members.aspx (refer to what I don't want in 3).
View 6 Replies
Feb 2, 2010
I have a Master Page that has several User Controls on it. The MasterPage code behind does some work to calculate a value that needs to be used in all of the UserControls. From the UserControl code behind, how do I access the public property of the MasterPage that I have set?
View 2 Replies
May 3, 2010
I have 2 masterpages. (Default.master and User.master).I have a hidden field in Default.master then how can i get the hidden field value of Default.master file from User.master.is there any way to access that hidden field like: Request.form("hidID") ?
View 2 Replies
Mar 14, 2011
i want to accessing the MasterPage variable, such as Panel, from the others page. How to do that? I have try this code:
CType(MasterPage.FindControl("PanelLogin"), Label).Visible = False
I want to call PanelLogin and make it visible (before called, it should be invisible) while opening the page. The code is error.
View 1 Replies
Nov 25, 2010
I tried to write a little function to reset the form to default. Therefore I want to access the Controls of the page. I'm using a MasterPage. Maybe because of that, I have no access to the ContolsCollection via Page.Controls.
View 4 Replies
Feb 10, 2011
I have following environment:
masterpage with a contentPlacholder multiple pages which use this masterpage and implement a base-class (fooPage) fooPage has a certain property (fooProperty)
[Code]....
Obviously this is not going to work - but how can I achieve this?
I know the alternative: call a method from the masterPage in the contentPage with fooProperty as a parameter - but i would like to rather have a pull-system in this case...
View 2 Replies
Oct 21, 2010
I am creating some sessions on successful login and I need to access them from my master page. How do I go about this?
public void showUser()
{
if (!string.IsNullOrEmpty(Session["User"].ToString()))
{
Response.Write(Session["User"].ToString());
}
else
{
Response.Write("Not Logged In");
}
}
View 1 Replies
Jul 20, 2010
In a project I'm working on, the master page codebehind does a load of complex checks and confirmations that decide the navigation list displayed on the TreeView of the page. Now, I need a way to access this list from another front-end page, such as "frontpage.aspx".
This serves two purposes. One, the masterpage will hide pages on the navigation list the user shouldn't have access to, but the user can still enter the page by typing the page name into the URL manually. By being able to browse through the TreeView, I can isolate the whole authorization into a single method by simply checking if the page name exists within the currently used TreeView.
Two, this will allow me to easily change the displayed content of any page without checking the database or storing sessions for whatever specific rights the current user has, as I can just look if the TreeView contains "Products Admin" for example, and then use that to hide or display the section of the page that has to do with "Product Admin" functionality.
View 3 Replies
Feb 4, 2010
I have a MasterPage (MasterPage.master) with 2 child MasterPages (specialMaster.master and standardMaster.master). From the MasterPage.master I need to get at some of the controls in one of the children, specialMaster.master, say for example to hide certain
content if a session variable is not null.
View 2 Replies
Apr 8, 2010
Using VS 2010 RC, VB, I have a label on a masterpage that is hidden. I want to make it visible from a content page when needed, and have the text change on the label as well from the master page.
I am using the following to access the label, but the text and other properties don't change for some reason.
Dim lblErrorMessage As Label lblErrorMessage = CType(Master.FindControl("lblErrorMessage1"), Label)
lblErrorMessage.Style.Add("display", "inline")
lblErrorMessage.Text = "LoginID ALREADY EXISTS!!! Please choose a different ID"
View 9 Replies
Aug 19, 2010
On my master page , I have "Search textbox" and "Search Button".
On My content page , I have a "User Control" which has a "GridView".It shows some data about Vendors.
Also, on this User Control's Page Load, i have code written to display all vendors in GridView.
Now, when user enters Vendor Number in "Search textbox" , and hits "Search Button" , i want to handle this event inside my User Control.
How to do this ?
View 2 Replies
Nov 2, 2010
I have a label control on my MasterPage that is used to display error information. If an error occurs on another aspx page or a Module.vb page, how can I display the exception in the label control on my MasterPage? I tried using a Session variable, however, it would not work in my Module.vb code-behind file.
View 31 Replies
Feb 17, 2011
I have a content page which has a related master page.I register a prefix <%@ TagPrefix ..... and can load other custom controls at that namespace.However, one particualar control at the same namespace, when added to the aspx page, breaks it.The control in question inherits from asp:Panel, has a parameterless constructor, defines a few public accessors, and creates some standard child controls, and nothing much else.Are there some fundamental restrictions to creating custom asp controls that I am breaking unknowingly?
View 2 Replies
Jan 26, 2010
I seem to be having problems with something that I thought would be simple
I have
[Code]....
[Code]....
and I get the error "object not set to an instance of an object" - I have moved it from prerender to load and tryed all sorts of things, but I get the same error.I am just trying to add a literal control to the masterpage from the masterpage code behind
View 2 Replies
Aug 23, 2010
On my master page , I have "Search textbox" and "Search Button".On My content page , I have a "User Control" which has a "GridView".It shows some data about Vendors.Also, on this User Control's Page Load, i have code written to display all vendors in GridView.Now, when user enters Vendor Number in "Search textbox" , and hits "Search Button" , i want to handle this event inside my User Control.How to do this ?
View 2 Replies
Jun 1, 2010
I have a function called Public Shared Function get_userDB() As String in my MastePage.master.vb file that i would like to access from my users page that is connected to the master page.
I have tried with: me.master.get_userDB()
But that won't work. It says that my function is not a member of my masterpage. What im i doing wrong?
View 4 Replies
Jun 29, 2010
i have an odd thing with the Request.Params / Request.Form.i have a literal control in my masterpage.
[Code]....
So far pretty basic i thought. But to my suprise the geLocation turns out to be null. The control wasn't found...
when i then use a link from the dashboard page to another page which has the same masterpage, everything on that page seems to work fine.
View 3 Replies
Aug 22, 2010
I have used a lot, in my application, the code below in order to access a Panel located in MasterPage.
CType(Master, MasterPageName).Panel1()
But, right now I need to do the same command above, in a page located within an iFRAME. The parent page (that calls the iFrame) is normally using that MasterPage. But the iFrame isn't.
View 3 Replies
Sep 6, 2010
i want access in my variable of masterpage from content for change language of my site ;
i define a int in my masterpag and want write a quary for show data from database
View 3 Replies
Feb 22, 2011
using the code below how come I cannot access a public method inside of a Site.Master page from a page using the Site.Master page:
Site.Master page:
[Code]....
View 3 Replies
Sep 9, 2010
I have a a public method in my code behind on the site.master page
[Code]....
I wish to call applyUserRole() from Default.aspx
On Default.aspx I have ..
[Code]....
[Code]....
Master. the method is not appearing. I've seen other post where people are having this issue but I can't find an answer.
View 11 Replies
Jan 27, 2010
I have a user control in the master of my website and I want change some property of that control from the content page.
View 3 Replies
Dec 8, 2012
How to access a control declared in a Master Page in a content page.I have a ModalPopUpExtender in Master Page and i want to access it from a content page, how can i do that.
View 1 Replies