Odd error with HTML content and attributes disappearing - asp.net

I have an odd error with an ASP.NET web page (ASP.NET 2.0, C#). For several users at one customer location, on one part of one page, HTML content and attributes are being stripped out. So, something that should look like this:
<p class="adminmainlink">
Add or edit resources
<script type="text/javascript">
var hb526 = new HelpBalloon(
{
title: '',
content: 'Add or edit downloadable file, web links, and text resources associated with a course.'
}
);
</script>
</p>
In the users' source code looks like this:
<p><a></a><script></script></p>
Not only is the content of the HTML tags disappearing, but also the attributes of the tags (the "class" value for the "p" tag, the "href" from the "a" tag).
Other areas of the same page are being rendered fine, with no changes to the HTML. The HTML isn't being generated by a code-behind page -- it's just plain text in the .aspx page. The area that is rendering correctly is in the .master page; the problem area is inside an asp:Content tag.
This error is only happening on one page of the application. Other, very similar pages that use the same .master page are unaffected. I am not able to reproduce this error outside of the client's facility, even when logging in to the client's account. The client is using IE 6 -- we have tested on that, and all is OK. No other customers are reporting a similar problem.
Maybe it's a content blocker or firewall issue at the client's location? Maybe the script is causing the content filtering (other pages use the same script and they display fine, however)?
If it's a code problem, it would seem to affect only the area inside the asp:Content control that is dropping into the .master page. Has anyone seen something like this before? What part of the ASP.NET page life cycle would eliminate attributes and tag content from hard-coded HTML? I could see weirdness happening with a control, but with regular HTML?
Many thanks for your thoughts and opinions!

Are the users using Firefox with AdBlock or some other ad blocking software? I've had strange behaviors in our internal application where certain content was being mysteriously removed, and it turned out it was because a liberal filter was applied, blocking out the word "ad." I noticed "ad_resourcewizard.aspx" was contained in your link. You should have the customers at that location try a different browser or disable their ad blocking software in case it's hooked into their networking software (a plugin for their security suite, for example).

Check whether they have any internet security software installed, and if so, try disabling it.
I know we had an issue with one of the versions of Norton Internet Security, which was stripping scripts out of our CMS pages for one particular client.

Related

Cross Domain iFrame auto height resizing

I've been googling and looking at various options but could not seem to be able to find a perfect solution that works in what I'm attempting...so needing some help here.
The situation/environment that I have is the following:
Parent page (which has the iframe) - is on a different domain, and the only control I have is a portion of the body tag, where it is updated via an admin console using html/WYSIWG editor. No access to head tag or even hosting jscript in their domain.
Child page (iframe) - is hosted in our domain, and we have full control.
The parent site is actually 3rd party online stores where we have products there, and we want to put in common information that we can control on our end without having to edit each individual product listing one by one.
I've tried alot of options found but it does not seem to work as either they need to include in js file or access to the head tag in the parent page.
So wondering if there are any other options that can help us on this?
I'm afraid you need access to JavaScript on both domains to do this.
Could you get the 3rd online store to host a small JS library that all their clients could then use to solve this problem? I work on a project that allows third parties to add in iFrames and produced this little project for just this reason. When any one say they want to be able have their iFrame resize to content, we point to the iFrame js file and say include this on your page.
https://github.com/davidjbradshaw/iframe-resizer
Sorry, that's not quite the answer your after, but trying asking the store to support this and they might be open to the idea, as I expect others have the same issue with their site.

What are some alternatives to server side include in asp.net that can use absolute path?

I have found these threads: thread1, thread2, and thread3 but it's not answering my question. I am creating a master page but all the navigation menus are coming from an absolute path. In the past I have downloaded the .html file and used SSI but if there is a change in the navigation menu, I do not have the latest menu. So, what are my alternatives? I need the capabilities similar to SSI but using absolute path pointing to a http://mydomain.com/myMenu.html file.
The reason this does not work (based on your comments) is that you're trying to do a server side include from a different website. That just won't fly because it's a security risk. In fact, that's a technique that phishing sites would love to be able to do.
What you could do is a WebRequest to download the HTML from the other site and then embed it as a literal on your page. Do this during the Page_Load method. This gets around the need for Server Side Includes.
When you say the navigation menu is "done by someone else", are they part of your team? If so, it'd be a good idea to host the navigation menu as a custom user control (.ascx) on your site. Then you can embed that user control in your master page.

Loading different aspx pages into an area without reloading the entire page

I have written a longer text on this subject posted earlier today. Perhaps the text was too long, so I rephrase it very briefly here:
I want to design a very standard site where the user gets the opportunity to navigate to different aspx pages with the aid of navigation menus (left, top). I do not want the entire page to be reloaded when changing the content page for three reasons: state handling, flickering and bandwidth conservation. I just want to load a new aspx page into a "main content area" with the rest of the site untouched.
What is the best way to achieve this? I must not rely on master pages or not master pages or AJAX or not AJAX. It must not rely on anything specific. I just wonder what the standard method would be to achieve this. It must be a pretty common wish.
Thanks
/DT
You can use iframe for this.
The <iframe> tag specifies an inline frame.
An inline frame is used to embed another document within the current HTML document.
<iframe src="http://www.w3schools.com"></iframe>

<!-- #include virtual="/footer.asp"--> in ASP.NET application

I need to include a header and footer currently located in an asp page. The page takes the language ID and gives you the correct header for the page you are viewing.
I was going thru this: http://forums.asp.net/t/1420472.aspx and this particular fragment seemed to explain it better tho I could not wrap my mind around it.
Hi, instead of using include tags, you could compose your page this way:
Your .NET application here
You can
then implement in codebehind remote
header and footer download logic and
set them in the Literals' Text. After
downloading from the remote site, I
would suggest to store the header and
footer in the application's Cache to
avoid too many connections to the
remote server. If the same
header-and-footer are shared from many
pages in your project, moving this
structure to a MasterPage could be
useful.
Kindly assist.
Well, it would be applicable if header/footer content is coming from some other (remote) server. So the suggested solution is to
Write code to download header/footer content from remote server
Cache the content so that you don't have to download it again and again.
Use literal controls as placeholders on page and set its text to this downloaded content from code-behind.
Now, this may or may not be applicable to your problem. From where does you get the content for header/footer. If its some helper class/method then you can directly call it to set the literal text. You can even do that is master page making things even simpler.
Edit: Additional information requested by OP
You can use WebRequest for downloading content. See this article to get started.: http://www.west-wind.com/presentations/dotnetwebrequest/dotnetwebrequest.htm
Refer below to get started on caching:
http://www.asp.net/general/videos/how-do-i-use-the-aspnet-cache-object-to-cache-application-information
You can use HttpWebRequest to get the required footer text from the asp page and then use the Literal control to display this text.
This page has an example code about how you can submit value to a page and get the response.

Why is search functionality not working on this page?

we deliver micro-site content for our client. Our content is injected into a wrapper that is supplied by another developer.
To deliver our content we host the wrapper as well as the content. The user can access this at
http://fundcentre.[redacted].ie/ (try a search for '[redacted]')
For the other content that is not ours, the other developer hosts a similar (though slightly different) wrapper and delivers the content. the user accesses this here:
http://www.[redacted].ie/ (try a search for '[redacted]')
The wrapper contains a search box, which does not work for us but it works for the other developer. I took a look at the network traffic with FireBug but it appears that when I do the search from the wrapper that we're hosting, I'm getting a "407 Proxy Access Denied" error. My guess is their proxy has a problem with the fact that the search is being conducted from a page hosted outside the scope of their proxy.
It was also suggested that there were javascript errors on the page that were preventing the search from executing but I can't see any. Also, I don't think I'd get as far as the proxy error if that was the case.
I don't really understand this stuff too well though, so could somebody with a bit more experience please take a look and maybe shed some light on this for me? Thanks.
The problem appears to be that the search box and the button next to it (the magnifying glass) are both causing the whole page form to submit after they try to set the page URL to the search URL. When you type into the search field and hit "Enter", the outer form that's wrapped around the entire page is submitted. When the magnifying glass is clicked, it tries to load the search results but because it's an image button the click also causes the outer form to be submitted.
I'm not exactly sure how best to fix it, partly because I think the entire page design should be thrown out. But if you're stuck with it, it might be possible to get it working by ditching that in-line Javascript on the button (since it's not working anyway) and then wrapping the search stuff with its own <form> directed to the search page. Having a <form> within a <form> is bad mojo but that's hard to avoid in a design that puts the whole page in a <form> to start with.
Alternatively, you could try handling keypress events on the search input to detect "Enter", and have that handler and the code on the button both return "false" to stop the outer form submission.
edit — as to why that works on the other site, well it appears to me that there the outer form really is the "search" functionality somehow, as they don't have the click handler on the search button at all, so all it'll do is submit the outer form anyway.
edit again — also, I never see that "proxy" issue. The search from your page works fine for me if I first fix the inline Javascript on the button so that it ends with ; return false. That actually may be all you need to do.
It could be a problem that your tags' action are pointing to different scripts. One is pointing to "Home.aspx" and the other to "/Default.aspx".
The two links are in different subdomains, so maybe you would like to change the action of the subdomain so it contains the full location of the action (ex. "http://www.newireland.ie/Default.aspx")

Resources