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
Steve C. Orr [MCSD, MVP, CSM, ASP Insider] - 13 Aug 2007 23:29 GMT
Have you tried setting the button visibility from the Master Page's Load
event?
If not, that's what I would suggest.

Signature
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
> 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
[quoted text clipped - 6 lines]
> Thanks
> Ganapathi
Mark Rae [MVP] - 13 Aug 2007 23:43 GMT
> 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
[quoted text clipped - 3 lines]
> 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
}

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net
Ladislav Mrnka - 14 Aug 2007 07:46 GMT
Hi,
I don't know how complex your soulution is but did you think about using
LoginView control?
Regards,
Ladislav
> 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
[quoted text clipped - 6 lines]
> Thanks
> Ganapathi
Ganesh - 14 Aug 2007 12:20 GMT
On Aug 14, 7:46 am, Ladislav Mrnka
<LadislavMr...@discussions.microsoft.com> wrote:
> Hi,
>
[quoted text clipped - 16 lines]
>
> - 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