HTML / ASPX pages not validating and not rendering or validating - html

As a disclaimer, I have read all of the posts regarding this topic and have tried all of the suggestions and still don't seem to be able to get this to work. So, for purposes of this question, I have created a very simple Master page file and an index file. The code for the master page is:
<%# Master Language="C#" AutoEventWireup="true" CodeBehind="master.master.cs" Inherits="EckankarInOklahoma.master" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>ECKANKAR in Oklahoma</title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
The index page's code is as follows:
<%# Page Title="" Language="C#" MasterPageFile="~/master.Master" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="EckankarInOklahoma.index" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
I DON'T GET THIS AT ALL :)
</asp:Content>
When I debug through Visual Studio, I get the expected white screen that just says:
I DON'T GET THIS AT ALL :)
But after publishing, uploading to the website via ftp and going to the website, I get nothing but my code. I have saved the files with encoding but without BOM. I used Sublime Text editor to ensure I was saving without BOM. I have published and then uploaded, and I have uploaded without publishing. All to no avail. I still get unrendered code.
Additionally, I have tried to validate through W3C Schools and the code will not validate. I have 3 errors and 3 warnings.
Can someone please advise what I might be doing wrong? Thanks in advance. Have a great weekend!
***update 1 = I tried what MarcusVinicius suggested and that did get me closer, but now instead of giving me my code as text, it says :
This is a marker file generated by the precompilation tool, and should not be deleted!
I am unsure of where to go from here. I published the website as not updatable and the config files are in the root directory. Any more ideas for me to try? Again, I appreciate all of the help and suggestions. :)

Related

How to link css file in vb asp.net project

How to link css file in vb asp.net project
Right now my css file is not beeing run from Home.aspx files. What is my All_Body.css file path that I should type in Home.aspx file.
I need to put this code on server so I can not use full path with my computer username
project Files:
>MyWebsite
>Styles
>All_Body.css
>UI
>Home.aspx
>Master.master
All_Body.css full path
C:\Users\Dave\source\WebSites\MyWebsite\Styles\All_Body.css
Home.aspx
<asp:Content id="Home_Content1" ContentPlaceHolderID="head" runat="server">
<link rel="stylesheet" type="text/css" href="~\Styles\All_Body.css" />
...
</asp:Content>
Master.master
<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
...
</body>
</html>
I cleared my browser cache and it worked.
The browser doesn't reload the css or js files, so as a developer you have to do hard refresh /reload every time you update the css or js files and you must add query string like ?v=0.01 after the href or src when you publish the website to the server and change the number every time.
ex:
href="styles.css?v=0.01"
src="main.js?v=0.01"
Now the browser will think this is a new file and will reload it in the client browsers.
Home.aspx
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
....
</asp:Content>
Master.master
The link to your CSS file should be in the <head> element of the master page:
<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
<link rel="stylesheet" type="text/css" href="Styles/All_Body.css" />
</head>
<body>
<form id="form1" runat="server">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</form>
</body>
</html>
Note that I updated the path to your CSS file which was incorrect; this link is relative to the root. Also, the "~/" only works when you include runat="server" - either way it is not needed when using a relative link for CSS. You also had a malformed head content placeholder. The content placeholder for the main content was missing from your master page. There was no form tag so nothing could work. In fact the code you presented would not even compile. If you simply used the standard Web Forms template out of the box with the master page option, it would have worked.
Tip: The easiest way to get the CSS link correct in a master page is to drag the CSS file from Solution Explorer into the <head> section of the master page in Visual Studio.

v14.0 Web Report Viewer Control not displaying body of report

I am hoping someone has an idea about what I am experiencing.
I've worked with various versions of the Report Viewer control (both WinForms and Web) over the years and have just started trying to use the latest HTML5 based version in an ASP .NET Wed Forms project.
My environment is as follows:
Dev laptop with Windows 7 and SQL Server 2014 Including SSRS.
Various remote servers with 2008R2, 2014 and 2016 Reporting Services on them.
I've followed this tutorial page from the Microsoft Docs:
https://learn.microsoft.com/en-us/sql/reporting-services/application-integration/using-the-webforms-reportviewer-control, and have set up a page that points at remote server reports.
Code Behind:
protected void Page_Init(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
rv14.ProcessingMode = ProcessingMode.Remote;
ServerReport serverReport = rv14.ServerReport;
// A 2016 Report
serverReport.ReportServerUrl = new Uri("http://2016server/reportserver");
serverReport.ReportPath = "/Sports";
// A 2014 Report
// serverReport.ReportServerUrl = new Uri("http://2014server/reportserver");
// serverReport.ReportPath = "/SQL2014DemoReports/VertBar";
// A 2008R2 Report
// serverReport.ReportServerUrl = new Uri("http://2008R2server/Reportserver");
// serverReport.ReportPath = "/DemoReports/VertBar";
}
}
ASPX
<%# Page Language="C#" AutoEventWireup="true" CodeBehind="Reports.aspx.cs" Inherits="WebNew.Reports" %>
<%# Register assembly="Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Reports</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<rsweb:ReportViewer ID="rv14" runat="server" Width="100%" Height="100%"></rsweb:ReportViewer>
</form>
</body>
</html>
When I run the page, the new HTML based toolbar renders and I get and I get the "loading" mini dialog showing, but then nothing. No report body rendered. The report currently uncommented in the code is a simple list of sports a couple of pages long, nothing complex.
I can tell that the server was contacted and replied as I am seeing the pagination control indicating that there is more than one page, and if I then use any of the export controls, such as PDF, the PDF DOES have the correct rendered output in it.
It is simply not showing in my web page.
I've tried IE (11), Chrome (58) and Firefox (49) and all display the same behaviour. It does not matter which of the servers I target or if I connect to my local instance.
Has anyone seen this behaviour, have any pointers to what might be happening, or a good way of trying to debug?
Many thanks
OK, so I stumbled across a solution to what I was seeing. It would seem that the problem is to do with what the viewer is contained within.
If I wrap the viewer in a DIV and set it's height to 100 vertical height then the viewer does correctly show its content. Previously it must have effectively been in a container of height zero.
Working ASPX code looks like this:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>2016 Report Viewer Test</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div style="height:100vh">
<rsweb:ReportViewer
ID="rv14"
runat="server"
Width="100%"
Height="100%">
</rsweb:ReportViewer>
</div>
</form>
</body>
</html>
Hope this helps someone one day. :-)
Add this, worked for me.
rv14.SizeToReportContent = true;

Background image not showing in jsp dynamic web project

Hi I am trying to use a background image in home.jsp page.when i run the project image is not loading a red cross mark is showing instead of the image
<%# page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%#taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%# taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" href="ac-styles.css" type="text/css" media="screen" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Home Page</title>
</head>
<body >
<img src="img/bg.png">
<p> Hello This Is The Home Page For your J2ee Spring Application</p>
</body>
</html>
I had placed the image under
when i run the application the result is
please help..
Thanks in advance..
The JSP file is not in the same folder as of image file root folder is present. So either you have to move your .jsp file in web-content folder or you should use backspace commands like:
<img src="../../img/bg.png">
This should work.
Conversely the best method would be to migrate your image file in web-inf/views folder.That would be easy but not recommended for big projects.
note that I included "../" two times. In your directory structure it
is needed. For more information read the refering manual for HTML
src's.

Sending mail using classic asp

I am new for classic asp.
I have written simple code to send mail using classic asp as follows :
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<form method="post" action="ASPformEmailResults.asp">
<p><input type="submit" name="submit" value="Submit"/></p>
</form>
</body>
</html>
ASP page:
<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="a#gmail.com"
myMail.To="b#gmail.com"
myMail.TextBody="This is a message."
myMail.Send
set myMail=nothing
%>
<html>
<head>
<title>My First ASP Page</title>
</head>
<body bgcolor="white" text="black">
</body>
</html>
but whenever open html page & click on submit button then mail should sent to given id but it displays asp page content.
Please help me to solve this problem.
Thank You.
Based on the information given, it appears that although IIS is installed, the ASP parser itself is either disabled or unmapped.
The following instructions will enable it for Windows 8; other versions of Windows will be similar:
From the Start screen, search for "Turn Windows features on or off"; it will be under 'Settings'.
Expand 'Internet Information Services'
Expand 'World Wide Web Services'
Expand 'Application Development Features'.
Tick 'ASP'.
Click 'OK', and ASP will be enabled within IIS.
If it is installed, it may well be disabled. Load up the IIS Manager (either through the start screen, or by running inetmgr directly from Start, Run, then:
Expand your computer name
Expand 'Sites'
Click on 'Default Web Site'.
Click on 'Handler Mappings'.
Ensure that the mapping ASPClassic is enabled for *.asp; if it isn't, you will need to create it and ensure that its executable is set to %windir%\system32\inetsrv\asp.dll.

Aptana studio 3 automatically includes html markup in rhtml files

I am learning ruby on rails using aptana studio 3. I created a view hello.rhtml. When i run the view and see the source i get to see js files automatically included. Even if my rhtml file is empty for eg
hello world
Without the html markup, and if i see the source, i can see the entire markup from html doctype etc already present. How do i stop the inclusion of automatic markup?
Thanks
EDIT :
OK i create a hello.html.erb file. And put this code inside it
Hello
When i save and run the file, i get the output, but when i view source i get the following result.
<!DOCTYPE html>
<html>
<head>
<title>Demo</title>
<script src="/javascripts/prototype.js?1312799421" type="text/javascript"></script>
<script src="/javascripts/effects.js?1312799421" type="text/javascript"></script>
<script src="/javascripts/dragdrop.js?1312799421" type="text/javascript"></script>
<script src="/javascripts/controls.js?1312799421" type="text/javascript"></script>
<script src="/javascripts/rails.js?1312799421" type="text/javascript"></script>
<script src="/javascripts/application.js?1312799421" type="text/javascript"></script>
<meta name="csrf-param" content="authenticity_token"/>
<meta name="csrf-token" content="82LBP1pI5h0QzNW54PYSq/zdkS8kF4Z/nKSUHgKvv1g="/>
</head>
<body>
<html>
<head><title>Hello</title></head>
<body>
</body>
</html>
</body>
</html>
SO if you see, i get html inside html and when in browser my title shows "Demo" instead of "Hello"
UPdate :
Here is the content of application layout. And i now understand that, the code is coming from this layout.
<!DOCTYPE html>
<html>
<head>
<title>Demo</title>
<%= stylesheet_link_tag :all %>
<%= javascript_include_tag :defaults %>
<%= csrf_meta_tag %>
</head>
<body>
<%= yield %>
</body>
</html>
I am new to this, so what is the best practice and what code should be present in application_layout.html.erb. I would like all my view files to have its own html code.
Thanks a lot
Your view should have .html.erb extension not rhtml (That's a hang over from Rails 1.x).
Check out your application layout file. in the head section you'll see an entry for including javascript. Just comment that out and you js will not be included.
Which just leaves me with a question. What's the actual problem with what you have? Why does it bother you? Perhaps the answer to this will get you to the right question in order to find a more appropriate solution.
UPDATE
Have a close look at your application_layout.html.erb.
Can you post the contents of that?
This is not an error, this is the way Rails works!
Rails will generate views/layouts/application.html.erb for you, this is the basic template of the website. With this template, you don't have to copy and paste the same html declarations on each page you make.
Rails uses a convention called MVC which stands for Model, View, Controller. I suggest you read a bit more on how this works. Basically, <%= yield %> will insert the contents of your view, but you must tell Rails which url points to which view. Now you can have views/pages/home.html.erb, the contents of which might be..
<h1>Home Page</h1>
<p>Congratulations, you made a web page with Rails!</p>
And then in routes.rb
YourApp::Application.routes.draw do
match 'home' => 'pages#home'
end
When you go to http://localhost:3000/home, you should see your web page. If you look at the source code, you will see the output generated by Rails.
<!DOCTYPE html>
<html>
<head>
<title>Demo</title>
<%= stylesheet_link_tag :all %>
<%= javascript_include_tag :defaults %>
<%= csrf_meta_tag %>
</head>
<body>
<h1>Home Page</h1>
<p>Congratulations, you made a web page with Rails!</p>
</body>
</html>
This is definitely the proper way to use Rails. The goal is DRY (Don't Repeat Yourself). Michael Hartl has a wonderful tutorial and introduction to using Ruby on Rails. I would suggest anyone new to Ruby on Rails to start here: http://ruby.railstutorial.org/. If you have any questions about using Ruby on Rails or web design in general, I'd be happy to help. You can email me at draco#dragonstarwebdesign.com. Cheers and good luck to you!