Losing Style Sheet

B

blue

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.
 
B

blue

OK, someone helped me figure this out. I needed to hard-code the full path
of my style sheet. That works.
 

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

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top