I see a very strange problem with rendering asp.net. I EXACTLY this in the corresponding part of .aspx (just replaced the names of paths and controls):
<div id="header">
<% if (SiteSettings.SiteName.Equals("sx") || SiteSettings.SiteName.Equals("sw"))
{ %>
<sc:sublayout runat="server" renderingid="{B04CFA1A-6B5B-49D3-8000-339DBE9899C1}"
path="/layouts/AX/HeaderSublayout.ascx" id="AXHeader" placeholder="content"></sc:sublayout>
<% }
else
{ %><ax:strangeBehavingControl id="HeaderInclude" runat="server" IncludeType="Header" />
<% } %>
</div>
The displayed html is as follows:
""
expected content from strangeBehavingControl
The .ascx for strangeBehavingControl is really simple:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="strangeBehavingControl.ascx.cs" Inherits="layouts.strangeBehavingControl" %>
there are no extra spaces anywhere, it has been checked many times already. the code behind is also very simple:
public partial class strangeBehavingControl: System.Web.UI.UserControl
{
protected override void Render(HtmlTextWriter writer)
{
var filePath = GetFilePath();
if (!string.IsNullOrWhiteSpace(filePath) && File.Exists(Server.MapPath(filePath)))
Response.WriteFile(filePath);
}
}
so I thought the weird "" inside the embedded files, but I checked them manually, and they start with the expected characters. any idea how these characters can be inserted there?
source
share