Questions tagged as 'c#'

2
answers

Script to make a div appear

I have a user registry in my application, when I click on register I wanted to display a message. This whole treatment I'm already doing and playing the message in my ViewBag.Message. How do I show this DIV by clicking the register button?     
asked by 11.08.2015 / 14:29
3
answers

Update to 2 tables

I can not make an update of the 2 tables. The problem is here. db.Entry(catequizando).State = EntityState.Modified; db.Entry(pessoa).State = EntityState.Modified; db.SaveChanges(); Any solution? Controller : [HttpPost] [Vali...
asked by 28.08.2015 / 18:18
2
answers

Quantity of a given character contained in a StringBuilder

I have a StringBuilder with these values: 12 ********** 3 * 4 *. Is there a simple way to return the number of asterisks without having to load a string on top of my StringBuilder? I'm using C # with Net Framework 3.5     
asked by 17.07.2014 / 19:12
2
answers

Having two dbContext for the same connection string is considered bad practice?

I initially had a DbContext with all DbSets of my entities. However, I needed to create a DbContext<T> that has a generic DbSet for methods that are properly generic. It turns out that the two DbContext point to...
asked by 08.07.2014 / 23:10
4
answers

Make a regex to remove characters

In a return of a jquery function, the returned date comes in this format. /Date(1401731794773)/ I would like to remove the invalid characters on this date, which are: /Date( and )/ I only need the date (remaining) compon...
asked by 16.06.2014 / 18:29
2
answers

create a file with content in C # and save to a folder on the computer

I need to create a report and save this report to a folder inside the computer's C: drive, I can only save the file without the content and the blank name. The save code: string folder = System.Configuration.ConfigurationManager.AppSettings...
asked by 11.05.2017 / 14:56
3
answers

VB.NET conversion to C #

I found this line of code: Try Dim WebReq As HttpWebRequest = HttpWebRequest.Create(GET_Data) Using WebRes As HttpWebResponse = WebReq.GetResponse Using Reader As New StreamReader(WebRes.GetResponseStream)...
asked by 16.05.2017 / 16:40
1
answer

MVC - Create a typed model being a generic list

I would like to create a typed Model with it being a list of type T . Using: ASP.NET MVC 5 Razor For example: My model in cshtml will look like this: @model List<T> @foreach (var item in Model) { <h1>@item.nam...
asked by 23.06.2017 / 03:03
3
answers

ASP.NET MVC Web - How to separate the performance between the modules of a project?

Explaining the doubt. Within my system there are some menus, let's use as example 3, naming them A, B and C, each being a CRUD module with some kind of report. If 300 people are using module A, it will impact the performance of module B, right?...
asked by 29.05.2017 / 01:29
1
answer

How to modify a window in Windows Forms? [closed]

How to change the appearance of the Window border, Title bar and button, and status bar in Windows Forms?     
asked by 18.05.2017 / 14:04