Questions tagged as 'c#'

1
answer

How do I assign a default date value to a TextBoxFor?

I have the following TextBoxFor @Html.TextBoxFor(model => model.data, "{0:dd/MM/yyyy}", new { @class = "form-control", @alt = "date", @placeholder = DateTime.Now.Date.ToString("dd/MM/yyyy"), @maxlength = "10", @data_val="false"}) As you...
asked by 24.05.2017 / 21:42
1
answer

HttpClient - WebException: The underlying connection was closed: The connection was unexpectedly closed

I created a very simple C # console application to test connection in an API, but I can not send the request. I tried with other APIs and they worked, but this specific one I can not. It would be a query in the CartolaFC API (it's commented on i...
asked by 24.06.2017 / 18:09
1
answer

Generic Method for REST Query

I need to refactor this method to make it work better. This method works flawlessly when calling an external API Rest return list. However, it gives an exception when the external API return object Rest returns an element only. publ...
asked by 24.06.2017 / 22:03
1
answer

Short date submission not working abbreviated asp.net mvc

I am creating a form in ASP.NET MVC and creating the field "DataMessage", at first I put the TextBox to load a date with the month in full, as below: Image of the form with the field "Message date" containing the month in full. Be...
asked by 28.06.2017 / 19:26
1
answer

Form zero values greater than 999.99

I'm going through a problem I've never seen before. I'm hoping someone has seen and can help me. I'm working with asp.net mvc 5, and sending a form via post to my controller. My model: <div class="col-md-6"> <form action="@U...
asked by 17.07.2017 / 21:38
1
answer

Automatic expiration cache time

I am using the function below to store the cache was working normal, but now when add the time of 60min is as if it expired automatic, now if I enter a time greater like 181min the cache is maintained. If anyone can help me, I'm grateful. H...
asked by 17.07.2017 / 22:50
1
answer

Error connecting to SQLServer database C # Web.config

I'm trying to make a .NET MVC application, but when I'm going to connect to the bank it's giving the following error:    An exception of type 'System.NullReferenceException' occurred in GerarXML.dll but was not handled in user code Add...
asked by 27.07.2017 / 01:08
1
answer

How to change the size of a screen through an event in C # WPF

How can you make a change in the size of a Window in WPF, changing its Heigth and Width and thus increasing and decreasing the screen according to the values reported? For example: I have a button (Increase Screen) and when the event refers to t...
asked by 21.07.2017 / 18:53
1
answer

When it does not have a string specification with the configured class where the Entity Framework creates the tables

I created a new project using Asp.Net MVC with EF, and did not configure the connection string property with the same name as the context class: DbContext in Web.config. Rodei enable-migrations - > worked successfully Rodei add-migratio...
asked by 28.09.2017 / 15:48
3
answers

How to make a string in AppSettings and use it later

How can I make a string in AppSettings, and then use it, for example, the string in AppSettings is this:    string example="example" And get the value that is in the AppSettings string and put it in a textbox, how can I do this?     
asked by 27.09.2017 / 15:53