Cache Issue with virtualpath in ASP.net

aproape

New Member
We want to load different \[code\]Default.aspx\[/code\] & \[code\]Master.master\[/code\] base on querstring value \[code\]?t=template1\[/code\].Code is working fine when we return null in \[code\]GetCacheDependency()\[/code\]. It perfectly show template1 or template2 base on query but in this approach problem is every time it load page from physical file which cause bad performance.In second approach as shown in figure when put cache dependency base on \[code\]PhysicalPath\[/code\] it first time execute this code \[code\]return new CacheDependency(file.PhysicalPath);\[/code\] but next time even we change query string it return first loaded file. As shown in figure when we trying to show template2 it still showing template1 because it is already loaded and cachedependency. If I physically make any change in template1 file then complete code will execute and template2 will show correctly.What I think ASP.net mapping caching per virtualpath and virtualpath does not contain querystring so if I request \[code\]http://localhost:31067/Default.aspx?T=template1\[/code\] or \[code\]http://localhost:31067/Default.aspx?T=template2\[/code\] asp.net serve it as default.aspx only.Sample CodeFull Image
OoGGN.png
 
Top