Create Dynamic pages in asp.net mvc - c#

I need to integrate the functionality of creating dynamic pages (like google sites) to my regular asp.net mvc(C#) application. I like to write my own code with database.
Any suggestions or reference for this?

You might want to read this article by Phil Haack, Scripting ASP.NET MVC Views Stored In The Database.

Related

How to organize multilingual URLs in ASP.Net Core Razor Pages?

ASP.NET Core 2.2.0
I'm looking for language-based urls in ASP.NET Core. Found a lot of examples online for .NET Core MVC, but can't get it working in Razor Pages.
What I want to achieve is:
domain.com/informatie -> link to the 'information' page in default language (Dutch for me)
domain.com/en/information -> link to same the same page in English
Therefor I need 2 features:
Recognize the language in the url, or set default language when language-tag is not provided
Translate the names of my Pagemodels
I will write a custom method for translating the content.
Best fitting example
I found 2 examples that do almost the same I want, but they are using MVC:
ASP.NET Core: Simple localization and language based URL-s
Localized routing using ASP.NET Core MVC 2
The second one looks great, I tried to rewrite it for Razor Pages, but got stuck on the LocalizationController.cs (since I'm not using a controller, but a Pagemodel) CultureActionLinkTagHelper.cs (I use the asp-page attribute).
Is there anybody who has fixed this in Razor Pages and who would like to share the code? Or anybody who can help me through?
You need to build your application considering globalization/localization.
Here is the official documentation from Microsoft.
You may find this tutorial for Developing Multicultural Web Application helpful, it is for DotNetCore 2.1 Razor Pages, but it is valid for 2.2 as well.
Additionally, her is a sample project for localizing razor pages in GitHub

Simplified "Razor-Only" website?

I have a website I want to make using the Razor template engine, however it really only has one simple page with a basic AJAX form in it. Having a full-blown MVC Web Application seems like a massive overkill for this, but I don't want to have to use something like PHP. Can I use Razor in a 'PHP-like' manner (i.e. one or two .cshtml/.vbhtml pages I can make requests to, in a similar function to how you make requests to .php pages)?
This will be hosted on IIS 8, if that'll help.
You can use razor with ASP.NET Websites (not web projects).
To do this go to File > New Web Site... and pick one of the templates that supports razor.
http://msdn.microsoft.com/en-us/library/gg606533%28v=vs.100%29.aspx
Gives more depth, however, you might be able to skip the first step "Installing the ASP.NET Razor Tools" if you already have it installed.

Can you use the CMS Orchard along side your own ASP.NET website?

I have a ASP.NET website which has various utility scripts/pages for some software but no public website. I would like to use Microsoft's Orchard CMS to create the website for visitors to look at - but would this mean I would have to move the utility scripts?
Can you run ASP.NET pages etc alongside Orchard or do you have to extend Orchard to do those tasks for you? If you can run scripts alongside, is there anything you should do to prevent interference with Orchard?
I will accept an answer from someone who has experience with Orchard or good reasoning.
Thanks in advance!
If you're speaking about existing ASP.NET WebForms application then I guess no, at least it won't be easy.
In this case your best bet would be to either
run those applications separately with appropriate rewrite rules, so for end-user it would look like a single application. With this approach you won't be able to access Orchard features (like user management) from your exisiting app, though.
rewrite your current pages to MVC and move those along with existing utility scripts to a separate Orchard module
If you're speaking about existing ASP.NET MVC application - the solution could be found here.

MVC from scratch

I don't use the ready made MVC template by VS10, I create an empty web application then create folders: Models, Views, Controllers and would like to create a simple MVC web application from scratch, I don't find any tutorial about this online, I have created the DB for my application, I need what next steps I should do to make a login/logout sessioned web application runnable on the browser.
Phil Haack has a really empty MVC project template http://haacked.com/archive/2012/01/11/a-really-empty-asp-net-mvc-3-project-template.aspx. The bare minimum.
As for authentication why can't you use the default project template which has a working example. If you really don't want to use it, search online. Lots of examples of how to implement authentication. If you have a specific problem with authentication, ask another question here.
The really empty MVC project template is a good start. I'd nuget the jquery, jquery.validation also.
About authentication , I'll give you some hints to research: FormsAuthenticationTicket, FormsAuthentication.Encrypt/Decrypt, Response.Cookies, FormsAuthentication.SignOut (sic), asp.net pipeline events

What are the options available for asp.net mvc paging with jQuery?

As I know in current Asp.Net MVC3, there is a component available named WebGrid and in jQuery there is component available named jqgrid. Can anybody show a comparison of boh these components in terms of features and which is easy to setup and get going.
Also if there are any options for grid in jquery suggest them too. Few tutorials links etc. too may be helpful. I am complete beginner in Asp.Net MVC3.
check these out :
Using jQuery Grid With ASP.NET MVC
ASP.net MVC JQuery Json and Paging
Get the free telerik MVC open source controls . Is the easiest and most full featured one out there.

Categories