470,573 Members | 1,582 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,573 developers. It's quick & easy.

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 2081
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Luke Bellamy | last post: by
5 posts views Thread by Andrew Poulos | last post: by
7 posts views Thread by Daniel Kaplan | last post: by
1 post views Thread by Amanda H. | last post: by
8 posts views Thread by pamelafluente | last post: by
10 posts views Thread by pamelafluente | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.