Linking webpages in visual studio - html

I have been trying to link other webpages using
<li>About</li>
but when I try it it shows me the following error:
This localhost page can’t be found
No webpage was found for the web address: https://localhost:5001/Pages/a.cshtml
HTTP ERROR 404
I'm using visual studio on mac version 8.6.6
I'm using ASP.NET

From your anchor tag link url ~/Pages/a.cshtml it seems that you are working with MVC project.
In order to navigate (or link) pages you need something like this:
About

You don't need to add the .cshtml.
If you are using ASP.NET 3.1 you can use the Anchor Tag Helper asp-page to go to other pages.
Below is a peice of code that works on one of my Razor Page websites:
<td><a asp-page="About">About</a></td>
So in your case just make sure to include the correct path to the page
Check out this link for more information on Tag Helpers in ASP.NET. Pretty cool stuff.

Related

Application for editing and rending HTML side by side?

Is there an application that can edit and render and web page side-by-side similar to http://rendera.herokuapp.com/ , but can working "offline" (i.e. can be working even without internet connection).
I tried googling for WYSIWYG HTML editor, but I couldn't come with something similar to http://rendera.herokuapp.com/
I found Brackets (http://brackets.io/) somewhat similar to I'm looking for. I managed to find the similar question (different keywords) in StackOverflow (Is there an HTML/CSS/JS editor that immediately shows changes?), so somebody can mark this as duplicate
On windows just point your built-in IIS server to your working directory
When you edit your html , just refresh the web page
Use Python to serve up your web page from the directory your working in
python -m SimpleHTTPServer
When you edit your html, just refresh the web page
If using angularjs you can use
ng serve
This will load your website normally on localhost:4200 , any change to your code will force a reload of your website
Simply have your browser on one side and your editor on the other.

Why my tag anchor does not work at localhost using Ratchet framework?

I'm using the Ratchet framework to compose a web page, but any anchor tags doest work, even though I am using the true rule, for example:
<a class="control-item" href="contact.php">click me</a>
The above code does not work. I really don't understand, but works with pure HTML code, and other frameworks.
An anchor won't work for the following reasons:
The link isn't linked to a page that exists.
The link is linked to a page that uses a server side language and
you're running locally and not through a server.
The link doesn't have an appropriate opening/closing tag.
It should seem that you're most likely not running through a server (or your server is not running correctly). Please define what "not working" means.

Can I still use `.cshtml` files in a hybrid mobile project?

All the resources use only HTML, but stuff like Cordova and Ionic work on the client, with HTML pages (and JavaScript and CSS of course), and once MVC has served a page, that page is HTML, so the hybrid tooling should be able to use it.
The only problem is that once it's served, it lacks the .html extension, but maybe I can figure a way to add this.
The reason I'd like to stick to .cshtml for my layout is that I can scaffold views from my sever-side view models, and this adds quite a lot of value for me.
If the question is: can you have .cshtml files on your mobile device, the answer is no. .cshtml file is processed on server by the Razor view machine, so plain HTML can be generated. Obviously you don't have MVC, Razor and such on your hybrid ionic app.
You can however work around it by taking your angular templates to be generated on your server by MVC. So, when you setup your templateUrl somewhere, instead of taking the relative path to your local template .html file, you can point to the controller on your server, giving the full path, with http:// and so. The controller will then generate your template for you and return as plain HTML.
Bear in mind, that angular will cache this, so it will be loaded only once.

Can I display my own HTML in Liferay?

I am trying to display my own HTML file inside of a Liferay Portal.
Is this possible? If it is, how do I do it?
Thanks!
Liferay is a CMS too, so what you need to learn is its Web Content Management system.
How are you trying to display HTML file.?
Yes, your custom html files can be loaded in liferay portal.
Download Eclipse Juno from here (already including the Liferay SDK). After that create new project in Eclipse FILE-->NEW-->Liferay Project. This will show you an additional windows to enter some details about your portlet. After you are done with this just follow this link.
Follow the tutorial and you will be ok. There they explain how to customize the look of the portlet. In the ".jsp" files you can just paste the html code and its going to work. Just dont forget to include the html tag library in your JSP file. Just paste:
<%#page contentType="text/html" pageEncoding="UTF-8"%> on top of the document and you are done!
Hope that helped!
Good luck with your portal development!

how to test html code of a big asp.net website

i want to test a big asp.net website through Visual studio. are it is possible. are i need any other tool. if yes then tell me the name of them.
my means testing to "HTML code". means there is no problem in html code and they written in standard way
If you have Firefox you install the HTML Validator or Total Validator add ons.
If you have Opera, just right-click your page in the browser and you will see something like "Validate source" on the menu.
Or else, you can use the validator at w3.org. There, you can validate HTML by URL, file upload or by direct input.
If your site is online visit http://www.htmlhelp.com/tools/validator/ and run a recursive validation