|
|
|
start date: Mon, 13 Aug 2007 22:05:11 +0100,
posted on: microsoft.public.dotnet.framework.aspnet
back
| Thread Index |
|
1
Ganesh
|
|
2
Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
|
|
3
Mark Rae [MVP]
|
|
4
Ganesh
|
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
Date:Mon, 13 Aug 2007 22:05:11 +0100
Author:
|
Re: master page refresh
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" wrote in message
news:uRQzn2e3HHA.5160@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
>
Date:Mon, 13 Aug 2007 15:29:55 -0700
Author:
|
Re: master page refresh
"Ganesh" wrote in message
news:uRQzn2e3HHA.5160@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
Date:Mon, 13 Aug 2007 23:43:24 +0100
Author:
|
Re: master page refresh
On Aug 14, 7:46 am, Ladislav Mrnka
wrote:
> 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
Date:Tue, 14 Aug 2007 04:20:56 -0700
Author:
|
|
|