Top ".net" questions

Do NOT use for questions about .NET Core - use [.net-core] instead.

How to escape braces (curly brackets) in a format string in .NET

How can brackets be escaped in using string.Format. For example: String val = "1,2,3" String.Format(" foo {{0}}", val); This example doesn't …

c# .net string parsing formatting
How to disable postback on an asp Button (System.Web.UI.WebControls.Button)

I have an asp button. It's server-side so I can only show it for logged in users, but i want …

.net asp.net javascript ajax
Convert List into Comma-Separated String

My code is as below: public void ReadListItem() { List<uint> lst = new List<uint>() { 1, 2, 3, 4, 5 }; string str = …

c# .net
Routing with Multiple Parameters using ASP.NET MVC

Our company is developing an API for our products and we are thinking about using ASP.NET MVC. While designing …

c# .net asp.net-mvc routing
Remove the last three characters from a string

I want to remove last three characters from a string: string myString = "abcdxxx"; Note that the string is dynamic data.

c# .net
"The given path's format is not supported."

I have the following code in my web service: string str_uploadpath = Server.MapPath("/UploadBucket/Raw/"); FileStream objfilestream = new FileStream(…

c# .net webforms upload stream
How to get object size in memory?

I need to know how much bytes my object consumes in memory (in C#). for example how much my Hashtable, …

c# .net performance memory profiling
How to recursively list all the files in a directory in C#?

How to recursively list all the files in a directory and child directories in C#?

c# .net
How to handle click event in Button Column in Datagridview?

I am developing a windows application using C#. I am using DataGridView to display data. I have added a button …

c# .net winforms datagridview
Getting the first and last day of a month, using a given DateTime object

I want to get the first day and last day of the month where a given date lies in. The …

c# .net winforms datetime