How to add custom error message with “required” htmlattribute to mvc 5 razor view text input editor
I am naive to Asp.Net MVC. I have a partial view(ASP.Net MVC) in which I have some required fields I want to show custom error message if any of the required field in not provided. Below is the compl...
- Modified
- 6 Jan at 07:26
Java 8 optional: ifPresent return object orElseThrow exception
I'm trying to make something like this: ``` private String getStringIfObjectIsPresent(Optional<Object> object){ object.ifPresent(() ->{ String result = "result"; //som...
- Modified
- 5 Jan at 12:57
Mount current directory as a volume in Docker on Windows 10
I am using Docker version 1.12.5 on Windows 10 via Hyper-V and want to use container executables as commands in the current path. I built a Docker image that is running fine, but I have a problem to...
C# LINQ select from where value is not contained in array / list
New to LINQ and not sure on the correct syntax for what I want to do. I have a "Blocklist", an array or list (could be either) of bad codes that I don't want put into this new "keys" list that I am ma...
Clearing an input text field in Angular2
Why is this method not working when I try to clear the text field? ``` <div> <input type="text" placeholder="Search..." [value]="searchValue"> <button (click)="clearSearch()">Clear</butto...
- Modified
- 12 Nov at 11:38
Can I combine these three similar functions into a single function?
Can I combine the three very similar functions below into a single function? All three functions update a particular column in the database. The anonymous object in the update statement is used to u...
- Modified
- 5 Jan at 10:46
EF & Automapper. Update nested collections
I trying to update nested collection (Cities) of Country entity. Just simple enitities and dto's: ``` // EF Models public class Country { public int Id { get; set; } public string Name { get...
- Modified
- 5 Jan at 10:22
How to refresh a Page using react-route Link
I am trying to refresh a page using react-route Link. But the way I have implemented it goes to the URL one step back.(as an example if the URL was ../client/home/register and when I press the reload ...
- Modified
- 5 Jan at 09:37
Life cycle in flutter
Does flutter have a method like `Activity.resume()` which can tell developer the user has gone back to the activity. When I pick the data from internet in Page-B and go back to Page-A, how can I let ...
- Modified
- 15 Feb at 15:28
Remove or replace spaces in column names
How can spaces in dataframe column names be replaced with "_"? ``` ['join_date' 'fiscal_quarter' 'fiscal_year' 'primary_channel' 'secondary_channel' 'customer_count' 'new_members' 'revisit_next_day' ...
Best place to store environment variables for Azure Function
I'm testing an azure function locally with several api keys. Whats the best place to store environment variables and how do I access them? I tried ``` System.Environment.GetEnvironmentVariable("name")...
- Modified
- 19 Oct at 22:31
Vue v-on:click does not work on component
I'm trying to use the on click directive inside a component but it does not seem to work. When I click the component nothings happens when I should get a 'test clicked' in the console. I don't see any...
- Modified
- 5 Jan at 03:31
ServiceStack: Change DefaultNoProfileImgUrl
I need to change the profile photo by default, anyone knows how to do it? [https://github.com/ServiceStack/ServiceStack/blob/master/src/ServiceStack/Auth/AuthMetadataProvider.cs](https://github.com/S...
- Modified
- 4 Jan at 22:52
Nested routes with react router v4 / v5
I am currently struggling with nesting routes using react router v4. The closest example was the route config in the [React-Router v4 Documentation](https://react-router.now.sh/). I want to split my a...
- Modified
- 1 Mar at 03:46
Add a msbuild task that runs after building a .NET Core project in Visual Studio 2017 RC
Is there something like the AfterBuild Target in msbuild with .NET Core in Visual Studio 2017 RC? I tried to add the following snipped to the .csproj file, but it is not excuted during a build (Contr...
- Modified
- 4 Jan at 21:27
Can a TCP Socket SendAsync operation complete without transferring all the bytes in a BufferList?
On Mono 3.12, I'm using [Socket.SendAsync(SocketAsyncEventArgs)](https://msdn.microsoft.com/en-us/library/system.net.sockets.socket.sendasync(v=vs.110).aspx) with a TCP Stream `Socket` to implement a ...
ViewComponent tag helpers not working
I have updated my asp.net core web application from 1.0.1 to 1.1.0, but tag helpers for my viewcomponents are not working: ``` <vc:login-form /> ``` it outputs the tag. It works using old syntax: @...
- Modified
- 11 Feb at 13:36
Akka.net vs Orleans performance
Hi I'm in the early stage of choosing an actor framework for a project I'm about to start. As far as I know Orleans was meant to relief the developer of as much pain as possible, at cost of some perf...
"pip install json" fails on Ubuntu
Cannot install the json module. As far as I know I shouldn't use sudo. what's the matter? ``` pip install json The directory '/home/snow/.cache/pip/http' or its parent directory is not owned by the c...
- Modified
- 4 Jan at 14:37
Convert a string to ordinal upper or lower case
Is it possible to convert a string to ordinal upper or lower case. Similar like invariant. ``` string upperInvariant = "ß".ToUpperInvariant(); string lowerInvariant = "ß".ToLowerInvariant(); bool inv...
Servicestack client compression fails with generic lists
This question is a follow-up to [ServiceStack client compression](https://stackoverflow.com/questions/41428857/servicestack-client-compression/41447014) Servicestack natively supports client gzip/def...
- Modified
- 23 May at 12:8
Angular2 - Input Field To Accept Only Numbers
In Angular 2, how can I mask an input field (textbox) such that it accepts only numbers and not alphabetical characters? I have the following HTML input: ``` <input type="text" *ngSwitchDefaul...
- Modified
- 17 Sep at 19:39
Returning a 404 from an explicitly typed ASP.NET Core API controller (not IActionResult)
ASP.NET Core API controllers typically return explicit types (and do so by default if you create a new project), something like: ``` [Route("api/[controller]")] public class ThingsController : Contro...
- Modified
- 19 Jul at 21:18
Typescript react - Could not find a declaration file for module ''react-materialize'. 'path/to/module-name.js' implicitly has an any type
I am trying to import components from react-materialize as - ``` import {Navbar, NavItem} from 'react-materialize'; ``` But when the webpack is compiling my `.tsx` it throws an error for the above as...
Adding the "Produces" filter globally in ASP.NET Core
I'm developing a REST Api using ASP.NET Core. I want to force the application to produce JSON responses which I can achive decorating my controllers with the "Produces" attribute. Example: ``` [Produ...
- Modified
- 4 Jan at 11:16