473,382 Members | 1,353 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,382 software developers and data experts.

SmartNavigation, Stylesheets and Frames

I have a situation where my stylesheet seems to be ignored when I set the smartNavigation property to True. Can someone please tell me what I'm doing wrong or how I should be doing this

I have a project with a stylesheet (Styles.css) in which I define a syle class. The start page is a frameset with a frame that points to a web form that is located in a sub-folder (i.e. MySubFolder\WebForm1.vb). This web form references the stylesheet in the folder above. Thus, the link to the stylesheet is as follows
<LINK href="../Styles.css" type=text/css rel=stylesheet
On the web form I have a single button and a label. The label's CssClass property is set to the name of the my style class defined in Styles.css
When smartNavigation in WebForm1 = false everything works fine. The label is rendered using the style defined in Styles.css. When I click the Button the page is re-rendered correctly
HOWEVER...when I set smartNavigation in WebForm1 = true, the page is initially displayed correctly, but when the button is clicked and the page is re-rendered, the style seems to be completely ignored. Interestingly, if I change the <LINK...> tag to the stylesheet in WebForm1 to look not look in the parent folder (i.e. '<LINK href="Styles.css" type=text/css rel=stylesheet>'), the page initially displays incorrectly, but after clicking the Button, it displays correctly

Can anyone tell me a neat way of working with this unusual behaviour

Sleepy
Nov 18 '05 #1
2 1399
One workaround uses some client side JavaScript to attach the
stylesheet after the page loads. For example, you could place the
following script block in your ASPX:

<script>
function AttachStyleSheet()
{
document.createStyleSheet(
href="http://server/Styles.css");
}
</script>

Then you can invoke this method by adding an event handler for the
body onload:

<body onload="AttachStyleSheet()>"
HTH,

--
Scott
http://www.OdeToCode.com

On Sun, 2 May 2004 18:36:03 -0700, Sleepy
<an*******@discussions.microsoft.com> wrote:
I have a situation where my stylesheet seems to be ignored when I set the smartNavigation property to True. Can someone please tell me what I'm doing wrong or how I should be doing this?

I have a project with a stylesheet (Styles.css) in which I define a syle class. The start page is a frameset with a frame that points to a web form that is located in a sub-folder (i.e. MySubFolder\WebForm1.vb). This web form references the stylesheet in the folder above. Thus, the link to the stylesheet is as follows:
<LINK href="../Styles.css" type=text/css rel=stylesheet>
On the web form I have a single button and a label. The label's CssClass property is set to the name of the my style class defined in Styles.css.
When smartNavigation in WebForm1 = false everything works fine. The label is rendered using the style defined in Styles.css. When I click the Button the page is re-rendered correctly.
HOWEVER...when I set smartNavigation in WebForm1 = true, the page is initially displayed correctly, but when the button is clicked and the page is re-rendered, the style seems to be completely ignored. Interestingly, if I change the <LINK...> tag to the stylesheet in WebForm1 to look not look in the parent folder (i.e. '<LINK href="Styles.css" type=text/css rel=stylesheet>'), the page initially displays incorrectly, but after clicking the Button, it displays correctly!

Can anyone tell me a neat way of working with this unusual behaviour?

Sleepy


Nov 18 '05 #2
Thanks, Scott, it works like a dream!
Nov 18 '05 #3

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

Similar topics

6
by: Eric Bodden | last post by:
Hi! I would like to use alternative stylesheets in combination with frames. Is that doable? My problem ist that when I - as the user - switch the stylesheet of the framset page, then the...
2
by: Anna | last post by:
Hi all. I want to create a noframes version of a certain page (not written by me), that has three frames, each loading a page with few external stylesheets. If I copy the content of each...
0
by: karim | last post by:
I have a datalist with an itemedittemplate. When I have smartnavigation on, I can't exit out from edit mode with EditItemIndex = -1. When smartnavigation is off, everything works fine. I know...
1
by: Jerad Rose | last post by:
I've done some investigating about various problems with the SmartNavigation feature. It seems to me that the general consensus is to avoid SmartNavigation like the plague. It's really a shame...
0
by: kolos | last post by:
Hi! I had to face with a strange problem. A html page loads an aspx page (written in C#, but I think it does not matter in this case) into one of the frames on the page. I tried to use the...
4
by: Bobby | last post by:
Hi all... I rather confuse using smartnavigation in my web application because if I set the "smartnavigation = true" then If I run my app, then after I post page that page, using event...
3
by: Nestus | last post by:
Hi, im developing a solution in ASP.Net, i have a page that i need to use the smartnavigation in true, the problem occurs when i put in the directive @Page SmartNavigation = true my page trhows a...
2
by: Wysiwyg | last post by:
Has anyone found a reasonable way to emulate smartnavigation functionality for any browser? I'd really like to avoid creating history entries when posting back to the same page. SmartNavigation...
5
by: Mogens Nielsen - Elbek & Vejrup A/S | last post by:
Hi, I can see from the msdn-docs that SmartNavigation is now obsolete. Why is that? The SmartNavigation feature has been replaced by MaintainScrollPosition, but the scoll position is not why...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.