TinyMCE Error - content cannot be displayed in an a frame - asp.net

I have a TinyMCE control on my ASPX.NET page. When the user clicks the "find" button on the control:
The find 'pop-up' appears with the error "This content cannot be displayed in a frame"
The puzzling thing is that for most users, the div/pop-up shows up fine (with the exact same browser version, IE8). Clearing cache and temporary internet files does not appear to resolve the issue.
This item is in the system.webserver node of the web.config
<httpProtocol>
<customHeaders>
<add name="X-Frame-Options" value="SAMEORIGIN" />
</customHeaders>
</httpProtocol>
Any ideas on how to resolve this issue? I am unable to reproduce, hitting the same website and performing the same action.

You could try to use the tinymce config parameter dialog_type:
dialog_type: 'modal'
Using modal dialogues the browsers won't have to open new windows.

Related

ASP.NET Ajax Toolkit Slider handle displays broken image

Using ASP.NET 4.5 Web Forms project that has been running for years and a new problem arose: the ASP.NET Ajax Control Toolkit Slider stop rendering an image (its a broken image symbol where the "handle" usually renders).
This only happens in IE11. Its working OK in Chrome nor Firefox (below):
Currently reviewing recent changes to code made (we've been doing an annual security review on OWASP Top 10) to see what may have broken it, but any advice appreciated.
Edit: recently we have been adding entries to our web.config customHeaders section per https://scotthelme.co.uk/hardening-your-http-response-headers
When we set X-Content-Type-Options=nosniff in web.config as below:
</system.webServer>
...
<httpProtocol>
<customHeaders>
<add name="X-Content-Type-Options" value="nosniff" />
</customHeaders>
</httpProtocol>
</system.webServer>
the slider breaks in E11. When the above is removed, the slider works in IE11.
I don't fully understand why, but this appears to be our culprit.

404 Not Found aspx file but it is there

I´m using Plesk and in Web scripting and statistics I have Microsoft ASP support in ON.
I uploaded a application (which works correctly in my PC) to a directory and it can be shown but when I go to the aspx file it shows me the 404 error (The path is the correct).
I noticed that some files in "shtml" extension are neither shown by the server.
This is my very first time with ASP.NET, ISS8 and Plesk. I don´t know what to do. I will thank you for your help
You have to set the HTTP Handler Extension. If you have no access to IIS directly, you could do on the web.config:
Open the Web.config file for the application, locate the httpHandlers element of the system.web section and add an entry for the file-name extension
Example:
<system.webServer>
<handlers>
<add name="SampleHandler" verb="*"
path="SampleHandler.new"
type="SampleHandler, SampleHandlerAssembly"
resourceType="Unspecified" />
</handlers>
</system.webServer>
For more configuration options please refer to:
https://msdn.microsoft.com/en-us/library/bb515343.aspx
and
https://msdn.microsoft.com/en-us/library/46c5ddfy(v=vs.100).aspx
Check also the Custom Handler Policy of Plesk that should not be enabled:
https://docs.plesk.com/en-US/onyx/administrator-guide/plesk-administration/securing-plesk/custom-handlers-policy.76787/
Here I've found also another interesting document:
https://learn.microsoft.com/en-us/iis/configuration/system.webserver/handlers/
Scroll down and you'll find a piece of code to add the handlers programmatically, even if I suggest you to add them in your web.config

How to enable Trace Logging in a VB web project

I'm currently developing a web project in VB.net.
I have run into some errors experienced more in IE11 than any other browser. I have researched all options related to turning the project cookieless, changed my variables and such around, and tried to make the project as sound as possible for all browsers, but to no avail.
My next step is to enable Trace Logging for the site so that I may ascertain the identity of the error.
The error I am getting is thus:
As I've siad, I've looked into the dropdownlist that is described in the error. I've changed it. Done everything I could
Thing is, I use the same page (in a sense) on another webpage, and the error does not occur. Similiary, in Chrome, Firefox even IE9 there is no error. Only in IE11.
As I said, I would like to implement Trace Logging. Now I have in my web.config
<system.diagnostics>
<trace autoflush="true">
<listeners>
<add name="WebPageTraceListener"
type="System.Web.WebPageTraceListener, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" initializeData="C:\Diagnostics\trace.svclog"/>
</listeners>
</trace>
I have set the initializeData to the C drive for testing (for me) and because I would like to see if another PC gets the error, hence the log should go to their machine.
My
<customErrors>
is set to off.
Yet there is no file! In my web.config, I had
<trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" writeToDiagnosticsTrace="true" />
But removed everything expect for
writeToDiagnosticsTrace="true"
But still nothing.
I followed Walkthrough: Integrating ASP.NET Tracing with System.Diagnostics Tracing, specifically the sections on logging through the web.config. I focused on the section titled
Routing All Tracing Output to .NET Framework Tracing
but following this, I thought I would get a file or something. But nothing came.
How do I get the trace file? Am I doing something wrong in the web.config? The user has full access to the folder.
Can this even be done?
I had this in a C# WPF application that logged only critical erros
<system.serviceModel>
<diagnostics>
<messageLogging logEntireMessage="true" maxMessagesToLog="300" logMessagesAtServiceLevel="true" logMalformedMessages="true" logMessagesAtTransportLevel="true" />
</diagnostics>
Can I do the same for a web project?
What more can I do?
Your help is greatly appreciated
EDIT
Apologies for not posting what I'm trying to do.
On page load, the dropdownlist is populated
ddlMedicalAid.DataSource = objMedicalAids
ddlMedicalAid.DataValueField = "MedicalAidID"
ddlMedicalAid.DataTextField = "Name"
ddlMedicalAid.DataBind()
Now when the page is rendered, the values are present, and the selected value in this case would be
Medical Aid 1
When the user enters text and clicks search, the method calls a service, in which the selected medical aid's value and the text is sent. The text has a required validator on it, so there is no way that a null value is passed there. It is for some reason the dropdownlist
Dim objTransactions As ArrayList
objTransactions = Managers.Transaction.GetTransactionsByMedicalAid(ddlMedicalAid.SelectedValue, strMember)
Believe it or not, I just had to change the current .browser file to accommodate the various browsers. This eliminated the main error, working in Chrome, but not in IE11. I just thought getting a tracer would help. Seems this did it
For more help, Browser Definition File Schema (browsers Element)

Icons missing on Azure Wordpress site

I created a WordPress Azure Website through the Azure Websites Gallery. I installed a theme called Bridge.
Everything is working quite fine...Except, I have no icons appearing on the desktop version of my site (through Chrome, Firefox and IE). I am seeing icons on my Windows phone. I am not seeing icons on the desktop site when I squeeze the window down to mobile phone size.
To give you some background to where this problem is potentially coming from…
I have used a custom domain. To make the WordPress site work with a custom domain, I have added this code to the wp-config.php file:
/*Emma added the below to fix permalink to be custom domain*/
define('WP_HOME','http://examplesite.com');
define('WP_SITEURL','http://examplesite.com);
The code above meant that once you clicked on a post or page and moved away from the homepage, the url was still examplesite.com/pagename instead of examplesite.azurewebsites.net/pagename.
So back to the icon issue…
The icons are displayed through using a font (font-awesome to be exact). I have the latest updates of the theme and the latest 4.2.0 version of the font is in the font files. The font files can be found here in my site:
wp-content > themes > bridge > css > font-awesome > fonts
I asked the Bridge theme team why the icons were not displaying. They replied:
This is happening because of cross-origin access is denied for your site. You should paste this code to htaccess file that is located in
WP installation directory:
<ifModule mod_headers.c>
Header set Access-Control-Allow-Origin: http://examplesite.com
</ifModule>
I do not have an .htaccess file because my site is running on Azure. From what I understand .htaccess files are linked to Apache. Instead of a .htaccess file, I have a web.config file and a web-config.php file because I installed this from Azure.
I created a .htaccess file in the root of my website and pasted the above code. Of course that didn’t work. I also looked up how to write the web.config version of the code and pasted that into the web.config file and that did not work (although with my little knowledge of this area, the syntax is probably wrong) and that didn’t work. See the code below:
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="http://examplesite.com" />
</customHeaders>
</httpProtocol>
I also added this to the web.config file and that hasn't worked:
<remove fileExtension=".svg" />
<remove fileExtension=".eot" />
<remove fileExtension=".woff" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
<mimeMap fileExtension=".woff" mimeType="application/x-woff" />
I have read that I need to also change the buildAction to "content", but not sure how to do that as when you click properties of files such as .woff, you don't seem to get that option.
I also played around with adding something to the web.config.php file under the custom code I wrote to get my domain to work, but that didn’t work either. Once again, not sure my code was correct.
I went back to the support team at the Bridge theme and they said that I should contact my hosting provider to do this for me because .htaccess can’t work on this type of server.
So, now I am not quite sure what to do.
Does anyone know the correct code I should put into my web.config, web-config.php or other file? Or, is there another issue here I am not understanding? Perhaps something as simple as adding something to the custom css to call to the font?
I wonder if there is a clue in the statement I made above...
"Everything is working quite fine...Except, I have no icons appearing on the desktop version of my site (through Chrome, Firefox and IE). I am seeing icons on my Windows phone. I am not seeing icons on the desktop site when I squeeze the window down to mobile phone size."
If I can see them on my phone, then surely that means at some point the icons are being rendered correctly?
I have had a look through my css files for a change in a way the site is rendered through media queries, but didn't find anything there either.
After many hours of searching for a solution I found this post: Windows Azure CDN and *.woff fonts
I copied this code into my web.config file as a child of system.webserver:
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Methods" value="HEAD,GET,OPTIONS" />
</customHeaders>
</httpProtocol>
That seemed to solve it! :)
Have tested in Chrome, FireFox, IE and mobile and all icons are now showing. Magic!

Internet Explorer compatibility mode

I have a ASP.NET web application which is supposed to work on IE.
If I go to compatibility View Settings and uncheck Display intranet sites in Compatibility View and the domain is not added in the box Websites you've added in Compatibility View, the users sees the code not the forms of the page.
If I check the checkbox, he still sees the code, only after I add it in the box I can see the actual forms of the page.
I tried
<system.webServer>
<httpProtocol>
<customHeaders>
<clear />
<add name="X-UA-Compatible" value="IE=IE5" />
</customHeaders>
</httpProtocol>
</system.webServer>
but still the same problem.
Is there another way to force it from code? I understand in the future the checkbox will be disabled so I must find I way to force the compatibility mode.
Can I add it to the box for Compatiblity View from code?

Resources