Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

master page refresh

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ganesh - 13 Aug 2007 22:05 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 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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.