Questions tagged as 'c#'

1
answer

Working with anonymous type

I have the following code snippet: var filter = new { categoria = 1, cond2 = foo, ... }; p = new ProdutoBusiness().listarProdutos( filter ).ToList(); I wanted to work with this anonymous type as a parameter to filter, but I do not know how...
asked by 12.12.2016 / 21:07
1
answer

How to open file with window.open in a post?

My controller returns two file types: pdf and excel. return File(stream, "application/pdf"); return File(new MemoryStream(ep.GetAsByteArray()), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", $"Relatorio.xlsx"); When t...
asked by 02.02.2017 / 17:04
2
answers

How to fetch a json value from the goo.gl API for C #

I'm trying to use the goo.gl API to shorten some link. The problem is that I do not know how to pull the generated URL from the json return. See below how it is organized: { "kind": "urlshortener#url", "id": "AQUI VEM A URL DO GOOGLE", "lon...
asked by 23.02.2017 / 14:00
1
answer

System.Runtime.Remoting.RemotingException in XAML Designer VS2015

I have a problem in Visual Studio. When I create a new UWP10 project in white, it comes up with the basic code. <Page x:Class="FoxMovieStoreMain.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x...
asked by 04.01.2017 / 22:10
1
answer

ActionLinkButton BoostrapMVC - Passing values to controller. "MVC - C #" [closed]

I'm trying to create a button with boostrap mvc, which when clicked will open a new tab with the data I want, but for this I need to pass an ID to my controller, someone could help me, because I can not pass this id using ActionLinkButton, would...
asked by 24.11.2016 / 19:14
1
answer

Hide form using F1 key C #

I have form more precisely a menu of options and wanted to hide this form when I pressed the F1 key and showed when I pressed F1 again. I tried following this tutorial from the link using hook keyboard . However, when I press F1...
asked by 27.02.2017 / 03:52
1
answer

Is it possible to pass the value of a Javascript variable to a C # variable?

The idea is as follows, use javascript to detect the screen resolution, and get the value of the variable of this javascript and move to the C # variable. The only thing that got into my head is to create an input to manipulate the variables, bu...
asked by 25.12.2016 / 19:50
2
answers

Getting information from a select and passing in an array

I want to get all fields of a select and store them in array . I thought about doing it, but it did not work. var lista = []; lista = $('#Model').text(); $('#Model').append('<option value="' + data.ModelID + '">' + data.N...
asked by 21.12.2016 / 22:57
1
answer

Fill class with bank result

Good afternoon everyone. I have a giant need to get things done. I have an object DataTable with the result with column "ID_CLIENTE" . I have an object Cliente with the property ID_CLIENTE . Is there any way to...
asked by 22.12.2016 / 22:01
1
answer

Exception 'The input string was not in an incorrect format' when doing calculation

I'm trying to do this calculation, using C #:    (x + 50) / 100) * 50 (x²-5x + 8)) I did it this way: double Morte = ((int.Parse(TextBox1.Text) + 50) / 100) *50*(Math.Pow(int.Parse(TextBox1.Text),2)-5*int.Parse(TextBox1.Text)+8); But...
asked by 20.11.2016 / 02:50