473,503 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Losing Style Sheet

My app draws a bunch of tables on the page and has a form for the user to
enter data and submit. The form is contained within a User Control called
DecisionCtl. When they submit the form, a bunch of db updates are performed
and then page needs to be redrawn with the new table that is generated from
the data they entered.

After the DB updates, the DecisionCtl bubbles an event up to its container
(the Page). The OnBubbleEvent removes all the controls from the panel and
re-draws them. The page loads with the correct data but the style sheet
doesn't get applied. In the source, I can see that the CSS is in the HTML.
If I do a refresh, the style sheet is applied.

The same thing happens if I use Server.Transfer (transfer back to the same
page) instead of attempting to redraw the page on the postback.

I was using Response.Redirect before but for some reason it recently started
caching the data on occasion and I would have to hit refresh to see the new
data. The thing I changed recently -- I started using the validation
controls provided by MS. I don't really think that's related though.

<snip>
......................................
private void Page_Load(object sender, System.EventArgs e)
{
SetupPage();
}
......................................
protected override bool OnBubbleEvent(object source, EventArgs args)
{
Control c = (Control)source;
if(c.GetType().ToString() == "ASP.DecisionCtl_ascx")
{
FCDecisionPanel.Controls.Clear();
SetupPage();
}
return true;
}
......................................
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>ProcessDisplay</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
<LINK href="ProcessStyle.css" type="text/css" rel="StyleSheet">
</HEAD>
......................................

</snip>

Setup page loads the DecisionCtl and draws the tables onto the
FCDecisionPanel.

Thank you.
Nov 18 '05 #1
1 2250
OK, someone helped me figure this out. I needed to hard-code the full path
of my style sheet. That works.

"blue" <bl**@arizona.edu> wrote in message
news:eO**************@TK2MSFTNGP11.phx.gbl...
My app draws a bunch of tables on the page and has a form for the user to
enter data and submit. The form is contained within a User Control called
DecisionCtl. When they submit the form, a bunch of db updates are performed and then page needs to be redrawn with the new table that is generated from the data they entered.

After the DB updates, the DecisionCtl bubbles an event up to its container
(the Page). The OnBubbleEvent removes all the controls from the panel and
re-draws them. The page loads with the correct data but the style sheet
doesn't get applied. In the source, I can see that the CSS is in the HTML. If I do a refresh, the style sheet is applied.

The same thing happens if I use Server.Transfer (transfer back to the same
page) instead of attempting to redraw the page on the postback.

I was using Response.Redirect before but for some reason it recently started caching the data on occasion and I would have to hit refresh to see the new data. The thing I changed recently -- I started using the validation
controls provided by MS. I don't really think that's related though.

<snip>
.....................................
private void Page_Load(object sender, System.EventArgs e)
{
SetupPage();
}
.....................................
protected override bool OnBubbleEvent(object source, EventArgs args)
{
Control c = (Control)source;
if(c.GetType().ToString() == "ASP.DecisionCtl_ascx")
{
FCDecisionPanel.Controls.Clear();
SetupPage();
}
return true;
}
.....................................
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>ProcessDisplay</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
<LINK href="ProcessStyle.css" type="text/css" rel="StyleSheet">
</HEAD>
.....................................

</snip>

Setup page loads the DecisionCtl and draws the tables onto the
FCDecisionPanel.

Thank you.

Nov 18 '05 #2

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

Similar topics

2
1997
by: Mark | last post by:
Hi - I want to allow users of an intranet application, to select their own colours etc. So I have a tbale in my database, which has fields called bgcolour, fontcolour etc. As I want all pages...
2
3939
by: Luke Bellamy | last post by:
Hi, I have been looking for a way to incorperate several different style sheets into a web page (i.e cascading effect). I have looked into the @import statement which seems to do what I want but...
5
1956
by: Andrew Poulos | last post by:
If I have an external stylesheet that is @imported into my page and it has an element that looks like this: * html td { font-style: italic; } how can I use javascript to change the font...
7
3034
by: Daniel Kaplan | last post by:
I have the item below at the top of my style sheet. And it seems that the font-szie is ignored. I know that my linked style sheet is being read, and used because if I remove the font-family line,...
1
1972
by: Amanda H. | last post by:
I posted about this a few days ago, and I got a few suggestions that fixed part of my problem. I am using a PHP script to switch external style sheets when the viewer clicks on the style link. ...
8
41492
by: pamelafluente | last post by:
Hi guys, Is it possible to add "onload" (via Javascript) a new class to the <styleheader section? If yes, how would that be done ? <style type="text/css" media="screen"> .NewStyleClass{...
10
2665
by: pamelafluente | last post by:
Hi, this time I am trying to add a style on the fly.I wish equivalency with this one (only the menuItemStyle line): <head> <style type="text/css" media="screen"> ... some static styles ......
4
2376
by: fjm | last post by:
Hello everyone. I’d like to know how to handle multiple style sheets. I have css tabs that have a style sheet and then I also have a separate style sheet for the content that goes inside the tab. ...
4
5625
Frinavale
by: Frinavale | last post by:
So a while ago I created a Tab Strip Control (before the AjaxToolkit had theirs otherwise I would have probably just used theirs). When I looked at the AjaxToolkit control to see how they got...
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7348
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7467
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4685
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3166
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1519
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.