473,402 Members | 2,072 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

master page refresh

I've couple of button on master page, based on user login from default.aspx
i control visibility of controls. I thought once i hide the button from
default.aspx it should be same for other pages aswell. but it doesn't. it
works only for default.aspx only.

How can i do that? do i need refresh master page or call my condition in
every page to setup master's button visiblity

Thanks
Ganapathi
Aug 13 '07 #1
4 7621
Have you tried setting the button visibility from the Master Page's Load
event?
If not, that's what I would suggest.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"Ganesh" <gs******@yahoo.comwrote in message
news:uR**************@TK2MSFTNGP05.phx.gbl...
I've couple of button on master page, based on user login from
default.aspx i control visibility of controls. I thought once i hide the
button from default.aspx it should be same for other pages aswell. but it
doesn't. it works only for default.aspx only.

How can i do that? do i need refresh master page or call my condition in
every page to setup master's button visiblity

Thanks
Ganapathi
Aug 13 '07 #2
"Ganesh" <gs******@yahoo.comwrote in message
news:uR**************@TK2MSFTNGP05.phx.gbl...
I've couple of button on master page, based on user login from
default.aspx i control visibility of controls. I thought once i hide the
button from default.aspx it should be same for other pages aswell. but it
doesn't. it works only for default.aspx only.

How can i do that? do i need refresh master page or call my condition in
every page to setup master's button visiblity
Presumably once the user has logged on, then the visibility of the buttons
remains the same for the entire duration of the session?

If so, store a boolean Session variable and point your MasterPage at it e.g.

Global.asax.cs
---------------
void Session_Start(Object sender, EventArgs e)
{
Session["MyLoginVariable"] = false | true; // initial value, as
required
}

default.master.cs
-----------------
protected void Page_Load(object sender, EventArgs e)
{
MyButton.Visible = (bool)Session["MyLoginVariable"];
}

default.aspx.cs
---------------
protected void cmdLogin_Click(object sender, EventArgs e)
{
Session["MyLoginVariable"] = true | false; // depending on result of
login
}
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 13 '07 #3
Hi,

I don't know how complex your soulution is but did you think about using
LoginView control?

Regards,
Ladislav

"Ganesh" wrote:
I've couple of button on master page, based on user login from default.aspx
i control visibility of controls. I thought once i hide the button from
default.aspx it should be same for other pages aswell. but it doesn't. it
works only for default.aspx only.

How can i do that? do i need refresh master page or call my condition in
every page to setup master's button visiblity

Thanks
Ganapathi
Aug 14 '07 #4
On Aug 14, 7:46 am, Ladislav Mrnka
<LadislavMr...@discussions.microsoft.comwrote:
Hi,

I don't know how complex your soulution is but did you think about using
LoginView control?

Regards,
Ladislav

"Ganesh" wrote:
I've couple of button on master page, based on user login from default.aspx
i control visibility of controls. I thought once i hide the button from
default.aspx it should be same for other pages aswell. but it doesn't. it
works only for default.aspx only.
How can i do that? do i need refresh master page or call my condition in
every page to setup master's button visiblity
Thanks
Ganapathi- Hide quoted text -

- Show quoted text -
Hi Thanks for your email, I don't use any login controls from
microsoft, I think it's not user friendly and needs another database
to store all the user information. I want to have userinformation in a
table with some more additional information which is not available in
the login controls.
I change the master control visibility from details page, i'll try
with master page load

Aug 14 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: M.Siler | last post by:
Let me first by saying I am NOT a .net programmer, but am very skilled with ASP, JavaScript, HTML, DHTML, Flash development. I've been reading through posts here about Frames vs. Master Pages and...
8
by: David Thielen | last post by:
Hi; Any strong arguments on using master pages vs frames when the header & footer are always the same and the main body is the part that keeps changing? -- thanks - dave
1
by: LilC | last post by:
I'm creating an application that has a standard layout for all pages. The information that is displayed in the layout will be dynamic based on the user that is logged in. Thus when a page is...
11
by: EagleRed | last post by:
I am writing an ASP.NET 2.0 application that uses master pages. I have some pages that must not be cached on the client. In ASP.NET 1.1 I achieved this using metatags: <meta...
4
by: sck10 | last post by:
Hello, I have the following in my Master Page that I am using as a redirect template: <head id="headRedirect" runat="server"> <meta id="metaRedirect" http-equiv="Refresh" content="2;...
0
by: Andrew_Vodo | last post by:
Hi, I'm developning ASP.Net 2.0 application which will use Google Map. The page with Google Map uses master page. As Google map uses client-side script, the first problem is where do I have...
2
by: Argirop | last post by:
I have a page Default.aspx. Its first line is the following: <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="default.aspx.cs"...
4
by: Jeff Allan | last post by:
Hello, I am starting to use Master pages. I understand the concept that these pages should remain passive. So, I need a little assistance. Scenario: 1. Master page with a search box &...
4
by: Rob | last post by:
Hi, I have a master page that contains a table layout. The contentplaceholder is located in one of the table cells. With frames technology it was possible for hyperlinks to load the linked pages...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
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,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.