.net

T4 Templates - SubSonic 3 - Running at Build Time

How do you get the SubSonic 3 T4 templates to rerun prior to building in VS2008? I don't have to continually "Run Custom Tool" on each one? ...

What is your opinion on uploading HTML?

I am building a control in .net 2.0 to allow users to write HTML into a textarea and then upload it. .NET won't allow them to upload it unless I set the page ValidateRequest=false. Of course, this opens up potential security threats. But, my plan is to uplaod the code, scan it for only the basic tags I would allow (like <B>), possibly in...

.NET XML serialization in 2009

Possible Duplicate: Replacement for XML Serialization Is something new besides old XmlSerializer on the world of xml serialization in .Net universe? Update: This is probably duplicate of better asked question. ...

How can I tell if httponly is set in my application

Without looking over the shoulder of a developer, how can I tell if HTTPonly is set properly from the front end of my web application? ...

How to Decide Whether To DataBind a Control or Not?

What are some good guidelines to follow when deciding whether or not to databind a control (for example, bind a combobox to a List)? Are there situations where you should always or never databind a combobox? How do you decide? ...

Alternative to storing with CryptoAPI

Synopsis: We are making a software that will be installed on many computer of a single network. The installation will most probably be made using a machine ghost. The users group consist of students and teachers. The software has to store a license key, along with an username and a password. These information are used to retrieve some ...

Setting ComboBox.SelectedIndex Breaks OneWayToSource Binding On ComboBox.SelectedItem

Hello All, The following appears in a data template: <ComboBox IsSynchronizedWithCurrentItem="False" SelectedIndex="0" SelectedItem="{Binding Path=Value, Mode=OneWayToSource}" ItemsSource="{Binding Path=EnumeratedValues, Mode=OneTime}"/> With SelectedIndex being set (as shown above), the OneWayToSource b...

.Net 3.5 Logging

I'm a pretty new C# programmer. I was wondering if someone can fill me in with more information on how to use a logging Framework into a already existing solution (if that's what you call it). I am trying to get logging for my Project i am doing. I was wondering what good & easy frameworks there are and how are they supposed to be imple...

Where does CLR store static classes?

Here a lot of people is confuse, Normal class store it's data in the heap right? And the reference(Pointer) to the stack. When the stack fall out of scope, Next time the GC(I bet you know what it's mean this time) kicks in and removes the memory from the heap. Now in case of static classes, the memory can't be clean by GC because it n...

Custom .Net MembershipProvider in n-tier environment?

I am working on splitting out an existing, working application that I currently have in order to better understand n-tier structures. This app uses a custom membership & role providers w/ forms authentication. All Data access and business logic are all within the same ASP.Net solution currently. I have built a Business Logic Layer (...

WinForms: NumericUpDown (.NET CF 3.5) and real numbers

NumericUpDown seems to be only dealing with integers. How can I modify it (?), so I can use doubles as Value and Increment? ...

How should I create an algorithm for the centroid of any System.Windows.Media.Geometry object?

I plan on having to split up the Geometry object into a series of simpler shapes, and combine their centroids using this formula: Mathematical details of this formula can be found in this Wikipedia article. NOTICE: Don't be suprised if my view of the mathematics is incorrect. I haven't done any complex math past trigonometry, and I'v...

What's the best way to enter numbers in Windows Mobile? (.NET CF 3.5)

There must be a better way than a constrained numeric updown control. ...

How to render an ASP.NET MVC View in PDF format

I'm working with ExpertPDF's Html-to-PDF conversion utility for this question (although I'm open to other libraries if there's sufficient documentation). In short, I have a view that is formatted a specific way and I would like to render it as a PDF document the user can save to disk. What I have so far is a PrintService (which impleme...

Architecture for WinForms applications?

I have started a WinForms project a few weeks ago and as I did not really know what features I wanted, I just added them along the way. This now caused a horrible mess where my MainForm is a big ball of mud and where for example some important state changes are triggered by UI elements to the point I have to call the OnChange Event of a ...

SubSonic 3 ActiveRecord Issues - Blank Data

When I examine the .Columns property of one of my business entities I had missing values for Table and PropertyName. I get the right count of records back from things like Take(5) but all 5 objects will be full of empty strings and 0 values. Just tried it with another SQL connection and same thing? Where should I start troubleshooting t...

Filtering collection with LINQ

Let's say we have a collection of Person objects class Person { public string PersonName {get;set;} public string PersonAddress {get;set;} } And somewhere in the code defined collection List<Person> pesonsList = new List<Person>(); We need to have a filter that need to filter the collection and return the result to...

Can you explain this bizarre crash in the .NET runtime?

My C# application sends me a stack trace when it throws an unhandled exception, and I'm looking at one now that I don't understand. It looks as though this can't possibly be my fault, but usually when I think that I'm subsequently proved wrong. 8-) Here's the stack trace: mscorlib caused an exception (ArgumentOutOfRangeException): sta...

.Net 2.0 Prerequisite Installer

What is the best way to ensure that a user who wants to install my application has .Net 2.0 installed on their computer? I don't really want to use a normal setup project created using Visual Studio, because my application is a portable application and does not use the registry or need an Add and Remove Programs entry. It needs to be a...

Extending C# .NET application - build a custom scripting language or not?

I need to build a scripting interface for my C# program that does system level testing of embedded firmware. My application contains libraries to fully interact with the devices. There are separate libraries for initiating actions, getting output and tracking success/failure. My application also has a GUI for managing multiple devices a...