Page bleed though.. anyone see this before?
-
There's got to be someone out there that understand what's going on. Let me explain in a little more detail. I created a system using the reflection object, that builds web pages based on requested class. Each page is it's own class, and the class functions are 'switched' depending on which page was called though the URL. On one of these pages, I have a Meta Tag Refresh set up to auto-refresh the page every 30 seconds in order to verify that the newest data has is being displayed. (yes I Guess I could/should use Ajax.. but that would require a rewrite of the system and something I'm not willing to do at the moment) The problem is when I start on that page (with the refresh) switch to another page then hit 'back on the browser I see a combination of the page with the refresh and the page I went to. From my understanding of asp.net that shouldn't be happening! I believe the cause is the meta refresh, and caching. However, in testing I've turned off the client and server side caching for that page and still have the same results. anyone have any ideas of what's going on?! From 'The PogoWolf' http://www.pogowolf.com Big ideas.. master of none.
-
There's got to be someone out there that understand what's going on. Let me explain in a little more detail. I created a system using the reflection object, that builds web pages based on requested class. Each page is it's own class, and the class functions are 'switched' depending on which page was called though the URL. On one of these pages, I have a Meta Tag Refresh set up to auto-refresh the page every 30 seconds in order to verify that the newest data has is being displayed. (yes I Guess I could/should use Ajax.. but that would require a rewrite of the system and something I'm not willing to do at the moment) The problem is when I start on that page (with the refresh) switch to another page then hit 'back on the browser I see a combination of the page with the refresh and the page I went to. From my understanding of asp.net that shouldn't be happening! I believe the cause is the meta refresh, and caching. However, in testing I've turned off the client and server side caching for that page and still have the same results. anyone have any ideas of what's going on?! From 'The PogoWolf' http://www.pogowolf.com Big ideas.. master of none.
If a page is inheriting from another page you, can get this "bleed" through. Or, the view state is getting corrupted.
-
If a page is inheriting from another page you, can get this "bleed" through. Or, the view state is getting corrupted.
Thanks George, What would be a good way to handle testing for either of these ideas? There shouldn't (keyword: Shouldn't) be any cross-inheridance from the classes and the main engine. The engine is located in 'System.aspx' and calls the same function name calls though out the engine. T he reflection just changes which class those functions are coming from. (but Hey, I've been wrong before.. *laugh* Honestly, I'm thinking it might have somethign to do with the Cache or now I'm thinking the viewstate. I've tried cleaning the .NET cache and the browser cache, but continue to see the same problem. thoughts? ---===/// The PogoWolf \\\===--- Blogs, Knowledge, Poems, Stories, Photos, Programming, Web Dev, and all sorts of cool sha-nits! http://www.pogowolf.com
-
Thanks George, What would be a good way to handle testing for either of these ideas? There shouldn't (keyword: Shouldn't) be any cross-inheridance from the classes and the main engine. The engine is located in 'System.aspx' and calls the same function name calls though out the engine. T he reflection just changes which class those functions are coming from. (but Hey, I've been wrong before.. *laugh* Honestly, I'm thinking it might have somethign to do with the Cache or now I'm thinking the viewstate. I've tried cleaning the .NET cache and the browser cache, but continue to see the same problem. thoughts? ---===/// The PogoWolf \\\===--- Blogs, Knowledge, Poems, Stories, Photos, Programming, Web Dev, and all sorts of cool sha-nits! http://www.pogowolf.com
Try just calling the setTimeout <body onLoad="setTimeout(5000, callMyFunc());" I've heard onem other person claim that. It seems illogical but maybe the client requested 2 pages at the same time and html just displayed them both. I can bet thats not the answer though. So out of curiousity what desgin pattern are you using? For your problem it sounds like an abstract factory. Just wandering 1 line of code equals many bugs. So don't write any!!
-
There's got to be someone out there that understand what's going on. Let me explain in a little more detail. I created a system using the reflection object, that builds web pages based on requested class. Each page is it's own class, and the class functions are 'switched' depending on which page was called though the URL. On one of these pages, I have a Meta Tag Refresh set up to auto-refresh the page every 30 seconds in order to verify that the newest data has is being displayed. (yes I Guess I could/should use Ajax.. but that would require a rewrite of the system and something I'm not willing to do at the moment) The problem is when I start on that page (with the refresh) switch to another page then hit 'back on the browser I see a combination of the page with the refresh and the page I went to. From my understanding of asp.net that shouldn't be happening! I believe the cause is the meta refresh, and caching. However, in testing I've turned off the client and server side caching for that page and still have the same results. anyone have any ideas of what's going on?! From 'The PogoWolf' http://www.pogowolf.com Big ideas.. master of none.
What did you do to try to turn of the client side caching? Did you also empty the cache? I believe that you didn't quite convince the browser, and it still gets things from the cache. Why are you using reflection, by the way? From what I understand it would work just as fine, or even better, using an interface, or inheriting from an abstract page class. --- b { font-weight: normal; }
-
Try just calling the setTimeout <body onLoad="setTimeout(5000, callMyFunc());" I've heard onem other person claim that. It seems illogical but maybe the client requested 2 pages at the same time and html just displayed them both. I can bet thats not the answer though. So out of curiousity what desgin pattern are you using? For your problem it sounds like an abstract factory. Just wandering 1 line of code equals many bugs. So don't write any!!
Ista, I'm not sure what you mean by 'design pattern' I look at specs.. I write code.. LOL However, that seems to be what's happening..but I'm calling two different urls.. like 'System.aspx?ID=1' and 'system.aspx?id=2' I will put System.aspx?ID=1 into IE, wait a few moments to make sure the refresh hits then put in system.aspx?id=2, and the page will load correctly. But if I hit 'back' then a mixture of both pages are displayed. but I'm not sure what an 'abstract Factory' is. =) .. The PogoWolf is tired of typing in his Sig.
-
What did you do to try to turn of the client side caching? Did you also empty the cache? I believe that you didn't quite convince the browser, and it still gets things from the cache. Why are you using reflection, by the way? From what I understand it would work just as fine, or even better, using an interface, or inheriting from an abstract page class. --- b { font-weight: normal; }
I used: Response.CacheControl = "no-cache" Response.ExpiresAbsolute = Now() - 1 Response.Buffer = True Response.Expires = 0 to kill it. as for doing the project another way, honestly.. because I didn't know how. =) the idea was to be able to create 'plugins' to the system. The Engine would then keep calling the same function names, but the reflection class would just route the function call to a different class depending on the need. The PogoWolf.
-
I used: Response.CacheControl = "no-cache" Response.ExpiresAbsolute = Now() - 1 Response.Buffer = True Response.Expires = 0 to kill it. as for doing the project another way, honestly.. because I didn't know how. =) the idea was to be able to create 'plugins' to the system. The Engine would then keep calling the same function names, but the reflection class would just route the function call to a different class depending on the need. The PogoWolf.
Use this:
Response.CacheControl = "no-cache" Response.Buffer = True Response.Expires = -1
Settings Response.Expires to a negative value means that it always expires immediately. Setting it to 0 just makes it expire at the current time, and if there are any difference in the server clock and the client clock, it might expire later. --- b { font-weight: normal; } -
Ista, I'm not sure what you mean by 'design pattern' I look at specs.. I write code.. LOL However, that seems to be what's happening..but I'm calling two different urls.. like 'System.aspx?ID=1' and 'system.aspx?id=2' I will put System.aspx?ID=1 into IE, wait a few moments to make sure the refresh hits then put in system.aspx?id=2, and the page will load correctly. But if I hit 'back' then a mixture of both pages are displayed. but I'm not sure what an 'abstract Factory' is. =) .. The PogoWolf is tired of typing in his Sig.
Well a design Pattern is a proven method to solve a problem. They describe an intent. Anyone can write code. If its documented out using UML and problems are solved using proven patterns "design patterns" then a solid framwork is realized. Otherwise, it's spagetti code thats not useful to anyone. But, thats my opinion. An abstract factory is a design pattern to provide mutliple types of classes depending on the necessity. Basically what you are describing. Although if you followed the abstract factory rules your code would be stronger. Your problem could be caused by not controlling access on how your making classes available. There are many question, how are you using handlers? are you making the module available to be re-used? this class you say provides the class or interface. Is it thread safe? Are you using a singleton to control access or allowing many copies to be created? If many copies then how are you ensuring data isn't being duplicated? If you solve those questions, follow the abstract factory rules, and tie down functionality your error will probably disappear. Or at leat have a great understanding to why it's happening. Nick 1 line of code equals many bugs. So don't write any!!
-
Use this:
Response.CacheControl = "no-cache" Response.Buffer = True Response.Expires = -1
Settings Response.Expires to a negative value means that it always expires immediately. Setting it to 0 just makes it expire at the current time, and if there are any difference in the server clock and the client clock, it might expire later. --- b { font-weight: normal; } -
Well a design Pattern is a proven method to solve a problem. They describe an intent. Anyone can write code. If its documented out using UML and problems are solved using proven patterns "design patterns" then a solid framwork is realized. Otherwise, it's spagetti code thats not useful to anyone. But, thats my opinion. An abstract factory is a design pattern to provide mutliple types of classes depending on the necessity. Basically what you are describing. Although if you followed the abstract factory rules your code would be stronger. Your problem could be caused by not controlling access on how your making classes available. There are many question, how are you using handlers? are you making the module available to be re-used? this class you say provides the class or interface. Is it thread safe? Are you using a singleton to control access or allowing many copies to be created? If many copies then how are you ensuring data isn't being duplicated? If you solve those questions, follow the abstract factory rules, and tie down functionality your error will probably disappear. Or at leat have a great understanding to why it's happening. Nick 1 line of code equals many bugs. So don't write any!!
Wow, Now I know I need to read more articles here to gain more knowledge about .NET =/ Honestly, I'm not sure how to answer your questions. No there has not been any flowcharting up front, nor UML specs created. I was given a piece of paper and told to "make this". The solution is a ASP.NEt reporting system. The code to create each report is located in their own class (42 of them) with the Datagrids and other support panels located in the primary report.aspx (the Engine) a URL is used to specify which report is to be shown, so 'report.aspx?reportID=1" would show report ID1, which is named as Report1.class in the code. the engine (by use of the reflection class) looks at all the classes in the reporting system, and uses the the functions located in the class that the URL speifiys. for example ReportID=1 would run the functions located in Report1.class, and reportID=3 would run the functions in Report3.class All the report classes have the same function names (like ShowData, INIT, etc) so that the engine calls the same function names.. only the returned data is different because of the classes. I did it this way because the reports are custom reports and where a 'revamp' of an older DOS bases system used. The comany wanted the reports to look/act the same why they where used to. I'm not using threads at all, nor a singleton for controlling access. and the report classes do not offer the engine an interface. .. The PogoWolf
-
Wow, Now I know I need to read more articles here to gain more knowledge about .NET =/ Honestly, I'm not sure how to answer your questions. No there has not been any flowcharting up front, nor UML specs created. I was given a piece of paper and told to "make this". The solution is a ASP.NEt reporting system. The code to create each report is located in their own class (42 of them) with the Datagrids and other support panels located in the primary report.aspx (the Engine) a URL is used to specify which report is to be shown, so 'report.aspx?reportID=1" would show report ID1, which is named as Report1.class in the code. the engine (by use of the reflection class) looks at all the classes in the reporting system, and uses the the functions located in the class that the URL speifiys. for example ReportID=1 would run the functions located in Report1.class, and reportID=3 would run the functions in Report3.class All the report classes have the same function names (like ShowData, INIT, etc) so that the engine calls the same function names.. only the returned data is different because of the classes. I did it this way because the reports are custom reports and where a 'revamp' of an older DOS bases system used. The comany wanted the reports to look/act the same why they where used to. I'm not using threads at all, nor a singleton for controlling access. and the report classes do not offer the engine an interface. .. The PogoWolf
Well lets look at it this way You have a multitude of classes to display a report. Each class represent a particular behavior. And each class may/may not contain addition class objects to represent additional custom behavior. That needs a composite design to supply additional behavior. Much like an assembly line with additional bays. Each bay has at least one conveyor belt for assembly. But each bay may contain additional bays also. Look at it that way. So based on a composite design pattern we can build the entire report. Create interfaceA that will have all actions needed like newObject, dataGrid, Parent. Not the exact methods and properties but you get the drift. Now that you have the report organized and resembling true functions and access is governed by an interface to allow for needed polymorhism to access additional composites. Now lets talk about access your report. You would want a factory to produce the report object. Take a look and say is there any access that might need thread safe actions? I suggest a abstract factory with a singleton pattern. The reason, and I could be wrong since I'm not there. But, this sounds like herogenous data source which means if 2 threads hit the data source at one time it would block the other from getting to the data. So decide do I need mutiple factories or just one. Also set the module property also depending if you can re-use. But if you have multiple factories make sure there will not be locking. So basically what it will do. Create a handler that will access propert types like .sqlx files. Create a handler class that will get your factory. Call GetReport passing the needed parameters. This factory will return the composite interface Then add this composite to your page. Then tell the page to call RenderControl on your object, thus building your page singleton basicall is this private static _object = null; public static singleton GetFactory { if _object == null _object = new singleton(); return _object } thats a simple singleton. As you can see we get a reference from calling a static property. The contructor needs to private. For a factory class it just needs one method public IComposite GetReport( ... parameters ... ) { create the composite needs } interface maybe defined as public interface IComposite { IComposite Control{get; set;} DataGrid DataGrid{get; set;} ... more ... } this way the functions are the same and they use polymorphism Now you don't have to do this but it wil