Setting the value of a Master page's control's property using a property of the Master page

N

Nathan Sokalski

Thanks. I was working on figuring out what's wrong, and although I haven't
found an answer, I did find something that if I spend a few weeks pulling my
hair out looking at, might get me a solution. I was looking at the
LoadControl method. The problem is, it seems very inefficient (if possible)
to use it to solve my problem. No problem being late with the code, my
family was here over the weekend, so I was busy until now anyway. Hope to
hear from you soon!
 
A

Andy O'Neill

Nathan Sokalski said:
I have, and I think I do, but either way, I'm not sure what events are left
for me to put it in. If you don't want to or can't help me, then just don't
reply to the posts, the purpose of these newsgroups is to help our fellow
developers solve there problems, there is no better way to learn more about
anything than seeing the answer hands-on, even if you do need some help
figuring out what that answer is. Thanks.

Just giving someone a piece of code doesn't teach them anything other than
how to cut and paste.
They have not explored the issue so they have no idea on whether the code is
good or bad.

Here's several answers.
I already gave you one of these.

Quick but AWFUL fix
Persist your property in viewstate.
Don't update it in postback.

BAD fix:
Use an object to drive the menu.
Cache it in session.
Update in content pages.
Read in master page.

Best fix.
Completely change the way your navigation works.
It makes you look bad.


I was particularly amused by this part:
>If you don't want to or can't help me, then just don't
reply to the posts,

Oh, the irony.
If you just don't want or like my advice how about you don't bitch and whine
about it.
 
S

Sergey Poberezovskiy

Nathan,

I was wright - I use Master.Master to initilise the control tree - strangely
enough I do not have comments explaining the reason (as I usually do).
The code, however, is wrapped in a try catch, and if not succeeded, then
called again from Init - again, not sure why - has been quite a few years now
- but seems to be working ...

Could you try to create a small project that consistently recreates the
problem, and send it to (e-mail address removed) - I will have a look at it for
you
 
N

Nathan Sokalski

Good (I mean great!) News! I finally found the problem! I don't know why it
was causing a problem, but removing the following @OutputCache directive in
the LeftNavigation.ascx control fixed the problem:

<%@ OutputCache Duration="2592000" VaryByParam="none" Shared="True"
VaryByCustom="page" %>

I don't know why this caused the problem, since I had cleared the entire
browser cache, but getting rid of it fixed my problem, so that's enough to
make me happy for now.
 
G

Guest

Good (I mean great!) News! I finally found the problem! I don't know why it
was causing a problem, but removing the following @OutputCache directive in
the LeftNavigation.ascx control fixed the problem:

<%@ OutputCache Duration="2592000" VaryByParam="none" Shared="True"
VaryByCustom="page" %>

I don't know why this caused the problem, since I had cleared the entire
browser cache, but getting rid of it fixed my problem, so that's enough to
make me happy for now.
--
Nathan Sokalski
(e-mail address removed)://www.nathansokalski.com/

in message






...

read more »

OutputCache is cached in ASP.NET cache on server. You set 30 days to
cache the control and that's why it was not updated.
 
N

Nathan Sokalski

So the ASP.NET cache is different from the browser cache? Does that mean
that if I put the directive back in 30 days from now (or once it was gone
from the ASP.NET cache) it would be ok? Is there a way to clear the ASP.NET
cache? My experience with ASP.NET cache is somewhat limited (I understand
how the browser does caching, but I am unfamiliar with what ASP.NET can do
as far as caching). I would obviously like to apply any applicable features
to this control, since it looks the same every time you visit the page, but
I'm obviously not going to add a directive that's going to prevent my site
from working. Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
474,095
Messages
2,570,616
Members
47,232
Latest member
helpplease!

Latest Threads

Top