Showing Tag: "net" (Show all posts)

RazorTagHelper - DOTNET_HOST_PATH is not set -Error MSB4018

Posted by jineesh uvantavida on Wednesday, December 2, 2020, In : asp.net 

After updating VS 2019 16.8.2 There will be an error on compilation on any project:


dot net --version : 5.0.100

Severity Code Description Project File Line Suppression State

Error MSB4018 The "RazorGenerate" task failed unexpectedly.
System.InvalidOperationException: DOTNET_HOST_PATH is not set at Microsoft.AspNetCore.Razor.Tasks.DotNetToolTask.get_DotNetPath()
at Microsoft.AspNetCore.Razor.Tasks.DotNetToolTask.GenerateFullPathToTool()
at Microsoft.Build.Utilities.ToolTask.ComputePathToTool() a...


Continue reading ...
 

Can't access master page properties from content pages

Posted by jineesh uvantavida on Tuesday, October 24, 2017,
You can add the add this on your Content  page 

<%@ MasterType VirtualPath="~/Main.master"%>

and then simply use Master.YourPropertyName in code file or this.Master.YourPropertyName


Continue reading ...
 

How to only allow numbers in TextBox control in asp.net

Posted by jineesh uvantavida on Saturday, October 14, 2017, In : Tips & Ideas. 
You can simply use regular expression validator as

    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    <asp:RegularExpressionValidator ID="RegularExpressionValidator1"
        ControlToValidate="TextBox1" runat="server"
        ErrorMessage="Only Numbers allowed"
        ValidationExpression="\d+">

    </asp:RegularExpressionValidator>

Also you can use the below regular expression to make the text-field as 12 digit number to be added.(madatory)

    ^[0-9]{12}$

Also you can make the field ...

Continue reading ...
 
 

Translate This Page

 


Make a free website with Yola