.net

Handling post requests in ASP.NET MVC

Recently I started working with MVC, before that I used "classic" ASP.NET. After using Ruby on Rails (RoR), I wonder how to implement POST request handling in MVC similar to how RoR operates. In RoR you use the Post method, so you need only one function for a view. In ASP.NET MVC I need to use 2 separate functions for GET and for POST,...

access WIA/TWAIN from .NET web application

We are developing C#.NET web application, which MUST have possibility to connect to front-end user's scanner, webcam or sign-pad (http://www.signotec.com/) device and execute their actions. This should be embedded with browser. AS far as I know it's possible with Java, AIR, Silverlight4 (it's still beta). What do you prefer it's best ...

How to secure Elmah working with ASP.NET and IIS 5.1 URL Routing

This question builds on the following question: How to get Elmah working with ASP.NET and IIS 5.1 URL Routing The solution suggested there worked, as long as elmah.axd is off of the root of the site. What if you want to secure the site as blogged here: Securely Implement ELMAH For Plug And Play Error Logging? Moving elmah.axd to /admi...

Testing on foreign Windows, is this possible?

I have a need to test an app (.Net) on a Taiwanese version of Windows. Problems: I can't read or speak Taiwanese I don't know if it would be the same if I installed a version of Windows from MSDN on my computer and said I'm from Taiwan Does anyone have any experience with this? How would I go about setting up an appropriate environ...

Printing problem in C# windows app - Always prints to default printer

I have the following code to throw up a printer dialog box but no matter what printer I choose, it always prints to the default printer. How do I assign the users selected printer? (from the dialog window) PrintDialog pdlg = new PrintDialog(); // Show the PrintDialog if (pdlg.ShowDialog() == DialogResult.OK) { PrintDocument pd = n...

Regular expression multiline validator

Hi! I believe it is a simple question. :) In my ASP.NET Web Form I have a multiline TextBox which should be validated with RegularExpression Validator. Text box should contain one ore more strings "a" (just 'a' char, nothing else). So far I got these regular expressions for my RegularExpressionValidator object: (?m:(^a$)+) (?m:\A(^a$...

Implementing a Single Sign On solution for web applications?

I am wanting to test run a Single Sign On web authentication for my University (currently a student employee), I have been reading a lot about WebAuth used by other Universities. While I think the solutions are great, we are a very 'small time' University, but the current login system and authentication is horrible for the user experi...

Entity Framework - Is it possible to create a table containing strings of alternative names to generic types?

I have recently been trying to learn more about the Entity Framework technologies from Microsoft. I have found a situation which I am not sure if it is possible (or correct) to solve using EF. I have lots of entities that can be referred to by lots of different names. For example, a persons occupation maybe described as "Coder", "Progra...

Evaluating static methods (with parameters) using MDbg

How do you evaluate a static method that takes parameters using MDbg on the command-line? To call Assembly.GetCallingAssembly(), this works: mdbg> funceval System.Reflection.Assembly.GetCallingAssembly How would you call the Assembly.Load method? eg. Assembly.Load("Foo.Bar") ...

Need a library that generates WAVE from Midi

I have about 80 compositions written in MIDI and I want to convert them in to WAVE using a sound library. So they can be played on all computers and sound the same. Is there a library that can automate this? Preferably in C#, but other programming languages are fine too. ...

Visual Studio 2008 Debug is launching my .NET WPF app with old source files

This started happening randomly yesterday. When I press F5 to test my project, an old build of the program (circa yesterday afternoon) launches. No changes (and I've tried in a few different files) are reflected in the project. However, and this is truly perplexing, if I go to Build --> Build from the Menu bar, the output .exe in the ...

Resharper Live Template Macro that changes variable name upon exit

I would like to create a Resharper Live Template that changes all spaces to underscores ind my "fact" Live template variable $testname$: <Fact()> _ Public Sub $testnames$() ' Arrange $END$ ' Act ' Assert End Sub I have this: [Macro("applyRegex", ShortDescription = "Run on {#0:variable}", LongDescription = "")] ...

What kind of application would benefit from being written in F# opposed to the more conventional languages?

Possible Duplicates: What is F# being used for? What are the benefits of using C# vs F# or F# vs c# I have recently studied C#, WPF, a little bit of WCF and now I have read that Visual Studio 2010 will also support F#. My question is: what kind of application is likely to need F# instead of C# or Visual Basic? Is F# necessary...

How can I produce a "print preview" of a FlowDocument in a WPF application?

Various WPF applications of mine display FlowDocument's. I'm able to print them, using the approach described in the answer to Printing a WPF FlowDocument. Now I'd like to add a "print preview" capability. In the normal case, I am printing the FlowDocument that is displayed in the Window, and so I wouldn't need a Print Preview then....

Remove duplicates from a List(Of T) in VB.NET

I fail to remove duplicates from my List. What am I doing wrong? Dim Contacts As New List(Of Person) ... ' remove duplicates ' Contacts = Contacts.Distinct(New PersonEqualityComparer).ToList my equality comparer: Public Class PersonEqualityComparer Implements IEqualityComparer(Of Person) Public Function Equals1(ByVal x As ...

C# MySqlParameter problem

(int) faultsGroup is 0 or 1 but i always get this error: Column 'FaultGroup' cannot be null Does anyone tell me why? Syntax looks ok. MySqlCommand cmdAdd = new MySqlCommand("INSERT INTO Faults (" + " FaultGroup, Text, Date, IP" + ") VALUES (" + " @FaultGroup, @Text, @Date, @IP" + ")", conn); MySqlPar...

Using the RadComboBox button, is it possible to populate a different combobox when one combobox makes a selection?

I have two combo boxes that are cascading. I would like to have it so that when I select something in ComboBox1, it will fire off a web method that automatically filters the list in ComboBox2. At the moment, I'm adding the value of ComboBox1 to the context key of the ComboBox2 web service when I'm firing it, however, I've noticed that...

Why do I appear to have a memory leak when user "Server" garbage collection?

Here's my situation. I want an explanation of why this is happening. I am reading about GC here but I still don't get it. Workstation case: When I run with workstation garbage collection, my app ramps up to use about 180MB of private bytes and about 70MB in ".NET CLR Memory #bytes in all heaps". Memory continues to be stable for seve...

Change Management practices: How to use TFS ensure that we release what was tested and approved

How do teams ensure that the code that was approved in QA is the same code that is released to production? What automated controls does TFS provide to ensure this? Also, how do you cross reference compiled code to source code so that you never have to wonder if you need to recompile again? We come from a Classic ASP shop where sour...

Is it possible to group/isolate tasks in ThreadPool when using WaitHandle.WaitAll?

The scenario I am facing is as below. Because ThreadPool is 1 instance per process so my question is that would method 1 cancel tasks queued by method 2 after 3 seconds? http request comes in *method 1 gets executed first*: ThreadPool.QueueUserWorkItem x 3 WaitHandle.WaitAll for 3 seconds *method 2 gets executed after method 1...