razor Questions
6
Solved
How would I join two strings in Razor syntax?
If I had: @Model.address and @Model.city and I wanted the out put to be address city what would I do? Is it as simple as doing @Model.address + " " + ...
Litigious asked 19/4, 2013 at 13:49
8
Solved
I have a textarea control that accepts input. I am trying to later render that text to a view by simply using:
@Model.CommentText
This is properly encoding any values. However, I want to repla...
Mellow asked 18/11, 2010 at 22:42
6
Solved
We just upgraded all but one of our web app projects from .NET Core 3.1 projects to .NET 6 in our solution. These were ASP.NET Core 3.1 projects using Razor. Here are the results we're seeing with ...
Malva asked 18/5, 2022 at 23:6
4
Solved
I have a simple page index.razor with a button:
<a class="btn btn-login" @onclick="RedirectPage" >Log in</a>
<div
@bind-Visible="@InvalidLogin"
BodyT...
11
I have an editform using an editcontext:
<EditForm OnValidSubmit="HandleValidSubmit" EditContext="_editContext" Context="auth">
<DataAnnotationsValidator />
<input type="time" @b...
Buonarroti asked 29/3, 2020 at 16:26
2
Solved
How can I use Razor in CSS files?
I'm using Razor View Engine for some time and I was curious about using it on style sheets. I can use Razor in <style> blocks of .cshtml files but I was won...
Jailbird asked 23/4, 2012 at 11:43
3
Solved
Why when I have certain HTML in my C# statements does Razor complain about invalid expressions and terms?
And how can I fix this?
For example; in my _layout.cshtml:
@if (Team.Id == ViewBag.TeamI...
Corie asked 20/7, 2015 at 4:3
2
Solved
We are used to intellisense everywhere and suddenly it doesn't work.
To my frustration, this was only the case on my work computer, the installation at home does work. Both has been updated to vers...
Philipines asked 24/2, 2023 at 15:48
4
Solved
I have a razor component and I want to add an SVG to it.
Would It be best to create a component for each SVG so that I can re-use it pretty easily or would it be better to just include the SVG int...
2
Solved
is it possible extend a shared view with thymeleaf?
I saw that is possible use framents but is not what I want.
Instead I want something similar to .NET MVC, with something like @RenderBody() and ...
Canine asked 6/3, 2014 at 0:36
2
Solved
I want to pass in HTML to my partial view, like so:
@Html.Partial("_MyForm", "<button id='foo'>Process Data</button>")
This currently works, but passing in strings is inelegant. Prev...
Nibble asked 21/6, 2019 at 14:6
3
Solved
I'm using Chromatron theme for an admin panel in my application. There is a sidebar gadget that has HTML content and with a little CSS trick it can be shown completely different.
<section clas...
Fabiolafabiolas asked 6/3, 2012 at 17:22
2
Solved
well I am pretty new to Blazor. I have been working with NodeJS alot before. For a new use case I wanted to know more about Blazor, so I am currently investigating in that. Well, what am I planning...
Profanity asked 19/11, 2019 at 12:3
1
Solved
Passing Query String to the Razor component using SupplyParameterFromQuery attribute is not working.
QueryStringTest.razor
@page "/querytest"
<h3>Query String Test</h3>
<p...
Jemma asked 27/11, 2023 at 13:25
7
Solved
If I look at the Razor View Engine, then I see a very nice and concise syntax that is not particularly tied to generating html. So I wonder, how easy would it be to use the engine outside asp.net i...
Preform asked 2/9, 2010 at 15:58
2
I need a way to create an empty IOrderedEnumerable and
IEnumerable<IGrouping<string, DynamicNode>>
//above IGrouping DynamicNode gets stripped out by stackoverflow
Reason: I create 3 em...
2
Solved
I am having a blank here.
I need to output "nbsp;" via a variable:
string strSpacer = "&nbsp;&nbsp;";
So was trying:
@:strSpacer
Does not work, although I do get the following in th...
Holocene asked 18/12, 2013 at 11:56
7
Solved
Hello I am developing a solution in MVC in first time so I am facing a big issue,
When I logout from my application(mvc razor web application) it displays login page, but if i press browser back bu...
Counterforce asked 11/10, 2013 at 10:19
13
Solved
I have about 20 pixels of white space at the top of my page. I have inspected every element and nothing has padding or margin in this area. When I inspect the body element it does NOT include this ...
Snuffer asked 12/9, 2013 at 18:50
12
Solved
How to import a namespace in Razor View Page?
Reliant asked 13/7, 2010 at 16:3
2
Solved
I've an object:
public class Test
{
public string Prop1 { get; set; }
}
I'd like to serialize it to json in a view, so in my cshtml:
<script type="text/javascript">
var myJson = JSON.p...
Johanna asked 15/6, 2015 at 12:43
4
Solved
I believe I read somewhere there is a setting in one of the project files that will allow you to compile the .cshtml files when building your Visual Studio project.
Just getting started with MVC/...
Sententious asked 20/11, 2012 at 20:57
13
Solved
I want to set disable attribute based on a condition for Html.TextBoxFor in asp.net MVC like below
@Html.TextBoxFor(model => model.ExpireDate, new { style = "width: 70px;", maxlength = "10", id...
Circuitous asked 12/7, 2011 at 6:8
3
Solved
as per https://www.mikesdotnetting.com/article/343/improved-remote-validation-in-razor-pages
I followed the tutorial and implemented the PageRemote. However it does not work if applied to a propert...
Podgorica asked 14/12, 2019 at 13:48
6
Solved
Why does Request["parameterName"] returns null within the view? I know I can get it from the controller but I have to make a little check in the View. I am using ASP.NET MVC 3.
Transpicuous asked 28/6, 2011 at 23:37
© 2022 - 2025 — McMap. All rights reserved.