Partial view never affects site after upload and IIS reset - asp.net-mvc-4

I'm including a partial view in one of the pages of my MVC4 site which when deployed, even after a restart of the web site and recycling of the app pool, never seems to affect the site
I'm wondering if this is caching coming into play
I ended up including the content of the partial view in the page iteself and that seems to have worked but I'd rather have the partial view as I'd like to use the view in other parts of the site
The question is, does anyone have any suggestions as to why this might be happening? I've been pulling my hair out trying to get a view to post the correct data, only to realise that some of the hidden inputs are just missing because the partial view has not been refreshed
EDIT:
Ok now I have a need to use this partial view in more than once place. On my dev environment the partial is rendering correctly. Uploading to the server doesn't seem to have any effect, but what's worse, deleting the partial view from the server also has the same issue.
My site still thinks the file is there and complains about the model type passed to the view now (I changed the model type in the view - all working fine on my local dev) - why does it still think the file is there?
I deleted one of the parent views to see if the site carried on working, but as soon as I delete any other file, the site is affected. Why is this particular file giving me trouble? It's as if the server has cached it at the file system level and is supplying the wrong file content to ASP.NET
I'm going to try renaming the file next

Ok so renaming the file appears to have worked.
I didn't try Fals suggestion but I might try that next time, strange behaviour I'm not going to try and understand why at this point!

Related

Magento 2, PageBuilder - adding custom content type

I'm trying to add custom content type to existing page builder module in Magento 2 following https://devdocs.magento.com/page-builder/docs/create-custom-content-type/overview.html
Bit of a problem that docs is kind of outdated, but the biggest issue for me right now, is that for some reason, panel with settings of content type is not loading. Console doesn't throw any errors and I'm not even sure how to debug this.
Normal behavior: https://drive.google.com/open?id=1OClPda-WGuc7idNogUnTz0wi4ZSk_Qu_
Behavior of custom content type (settings are not loading at all): https://drive.google.com/open?id=1I-IeTImec-M8DuLfgjiA193mhm0Fwtd8
Maybe someone already stumbled upon issue like this and know possible ways to solve it?
Ok I've found out what problem was, so I'm answering this question in case someone will need this in future.
Check your ui_component xml structure, I was having an issue with naming there (namespace was not correct), and that's why it was not loading.

cakephp 2 non existing controller and files could not be found

I make debug on a website running on cakephp 2 (yes it's old i know)
I have strange errors i cannot resolve.
in log i have:
-Error: [MissingControllerException] Controller class Wp-login.phpController could not be found
-Error: [MissingControllerException] Controller ColonisersController could not be found.
-Error: [MissingActionException] Action ImgController::ui-bg_diagonals-thick_90_eeeeee_40x40.png() could not be found.
-Error: [MissingActionException] Action ImgController::moustique-tigre-default.png() could not be found.
...
I search over all the source code for Colonisers but it is not write even once (also i think ColonisersController is a renammed controller because it is misspelled).
I search over the web for the Wp-login.php and it is a wordpress page, so no link to cakephp at all, also not write anywhere in the source code.
Same story for the missings pngs files. not in the source code.
I try to clear the cache folder on server but problems remains.
I have ghost source code? file are somewhere in another cache ?
any idea are welcomed.
By default all request that do not map to an actual file are being passed over to CakePHP, where the app will try to match the request to a route, and if one is found, finally try to match it to a controller and an action.
You seem to have some rather unspecific routes defined that eat pretty much anything as a possible controller name, hence things are being passed further for searching for a matching a controller and an action, which is where the request flow will end, as no matching controller or action can be found - consequently a MissingControllerException or MissingActionException is being triggered, an error is being logged (by default all exceptions are being logged), and in production mode (debug = 0) the app will respond with a 404 error.
So, no ghosts, no cached files, that's just how things work.

FIXED IT! Type 'ASP._Page__ViewStart_cshtml' does not inherit from 'System.Web.WebPages.StartPage'

Moving and copying some files, now I have this exception on my project, used to work fine.
The thing is that this failing project is a copy of another one, that is working fine, so every critical file inside i´m sure it´s ok.
web.config --> from solution is ok.
web.config --> from views is ok.
viewStart --> ok.
I found out the fix for this, so if you have the same problem than me even if you did what other posts said about adding razor sections to the config, check this solution.
Regards!.
Ok. So I´m assuming that you have all your configs ok, and all of the DLLs ok and updated.
If you did all of that and still having the exception, try to check and DOUBLE check if you don´t have any undesired "_viewStart" files placed somewhere wrong, and also check if is not excluded from solution.
In my case, this was the problem: I removed wrong "_viewStart" that I copied by mistake and the web start working again.
I´m sure that most of scenarios that everybody has this exception is caused by moving this file to another folder or creating a new one.
try it!
hope it helps.
Regards.

Multiple RequiredFieldValidator crashes page

I have a very strange problem. I've recently added MVC4 to an old Web Forms project. I did this by creating a new project, and adding the old files to the new project (rather than opposite approach of copying the new MVC files in). When I did this, one of my Web Forms pages stopped working - When I try to access it, it redirects to HTTP Error 404.0 - Not Found.
The file is there, and I also have other Web Forms (.aspx) pages that load without any issues. To pin-point the issue, I created a Web Forms page with the same name to replace it, and it the blank page loads. I started adding code to the new page one line at a time till I found the issue.
I finally found that what caused the issue is when I have more than one RequiredFieldValidator tag on the page. Any idea why this would happen or what I can do to work around it?
assign groups to the validators. Put them in separate groups, dont put them in same groups , make sure You dont have controltoassign be same because then during compilation same requiredfield validator might have concurrency issues and crash the page. Putting them in different groups assures that even more. If you still get the same issue then try this as well
Open IIS Manager
Right Click the server name
Select properties
Click the MIME Types button
Click New
Extension is .pdf
MIME type is application/pdf

Solve IE6 static content caching issues on IIS6

I'm currently experiencing problems with static content - most noticeably jQuery datepicker images, but also other static files - which results in images/static content loaded many times - I can clearly see it in IE6 status bar (not to mention SLOW rendering).
The problem and possible solutions seems to be described here: http://www.explainth.at/en/tricks/flickfix.shtml. However, I use IIS6 not Apache, and static files that I don't want to feed through php or asp.
How do I make IE6 cache static images properly? How do I add custom response header for specific files/folders?
Hm, let met re-phrase it. I'm not sure it is caused by the bugs above. Actually, I tried appcmd to apply cacheControlMode/etc and it doesn't seem to work. As far as I remember, IE6 also does not cache for XMLHttpRequest calls? So, the biggest problem that I need to solve is:
in jQuery calendar, moving mouse over image buttons (prev/next) causes them to be reloaded-refreshed
in jQuery dialog, each dialog('open') causes images from theme (like header background) to be re-loaded/refreshed
etc
This link probably gives a better explanation: http://ajaxian.com/archives/internet-explorer-and-ajax-image-caching-woes
How do I solve this - that is, without feeding images through ASP.NET to setup headers?
Thanks everybody for listening, the trick with appcmd seems to work ;-) The problem was that I used jQuery theme from googleapis... which obviously was not affected by appcmd ;-) Moving theme to local folder did the trick. These are the commands:
\Windows\system32\inetsrv\appcmd.exe set config "Default Web Site/images" -section:system.webServer/staticContent -clientCache.cacheControlMode:UseMaxAge
\Windows\system32\inetsrv\appcmd.exe set config "Default Web Site/images" -section:system.webServer/staticContent -clientCache.cacheControlMaxAge:"01:00:00"
from http://forums.iis.net/t/1067723.aspx