.net

How to reference a specific implementation of a generic type in the DataType attribute of a DataTemplate?

This question is strongly connected to this answer to "How to reference a generic type in the DataType attribute of a HierarchicalDataTemplate?" I followed the basic idea of that answer and created this data structure: <!-- for DictItemVM<string, Remote.Address> which is a viewmodel for a KeyValuePair<...> --> <x:Array Type="{x:Type sy...

Can an ASP.NET MVC2 site have an optional enum route parameter? If so, can we default that value if not provided?

Hi folks, can I have a route like... routes.MapRoute( "Boundaries-Show", "Boundaries", new { controller = "Boundaries", action = "Show", locationType = UrlParameter.Optional }); Where the action method is... [HttpGet] public ActionResult Show(int? aaa, int? bbb, LocationType locati...

Persisting Data from the UI

I am doing a little testing with EF4. I have built a simple DB which contains one table: Table: Person Column: Id Column: Name I have a windows form application that contains a form with a gridview. I have the Model.edmx all setup and works correctly (tested without encapsulating the context). I have now encapsulated the context int...

Update panel and script managar not working in .NET 4.0

I have converted my web application from 3.5 to 4.0. I have been getting the issue on update panel post back method. I have linkbutton and textboxes inside the same update panel, when clicking on linkbutton for fill the values system throw below JS error. Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6...

How to use obfuscation for clickonce?

If one will release clickonce version, how can it be obfuscated by dotfuscator? .net application ...

Sporadic windows service failure under .NET 4, followed by port blocked on restart attempt

About once a day, I am receiving the following error in our mission-critical trading service. Source: .NET Runtime, Type: Error, Application: Application.exe, Framework Version: v4.0.30319, Description: The process was terminated due to an internal error in the .NET Runtime at IP 000006447F281DBD (000006447F100000) with exit code 801315...

How to "really" down-cast a DynamicProxy back to its original type (to send over WCF)

OK, the situation is we have a class, PatientDto, and a DynamicProxy generated by Castle, PatientDtoProxy. We're using this proxy in the Silverlight client, then want to send it back to the server via a WCF service call. The WCF service Contract expects a PatientDto (ie not the proxy) and, as expected, blows up if you try to send anyth...

Regular Expression that Matches Any Number or Letter or Dash

Given searchString = "23423asdfa-''" This regular expression should evaluate to false but it does not! Any ideas? Regex rgx = new Regex(@"[\w-]*"); rgx.IsMatch(searchString) ...

Getting OutofMemoryException at runtime with the message "Insufficient memory to continue the execution of the program".

Hi, I am getting OutofMemoryException at runtime with the message "Insufficient memory to continue the execution of the program.". I am loading the images at the start of program. Each image is 50+ MB. If the images size goes to 277 MB plus, then I get this exception. I am loading the images at once because I have to display their thumb...

Better option for hosting MS Office documents in custom app?

I am currently hosting an IE Browser control in a .NET (2.0) Form and using it to load Office files such as Excel and Word thusly: _ieCtrl.Navigate("C:\\test.xls", False); The hosting and loading works well except whenever I navigate to a file I am presented with a dialog that asks whether I want to save or open the file. (This is sta...

Bar Chart in Framework 4 - Update issue

So I'm trying to update dataPoints programmaticaly in a column chart but whenever I do this, the column chart displays empty columns where there IS a number greater than zero, and displays a zero otherwise. Now the code below works for a pie chart but for some reason it does not work for the bar chart. barChart.Series(0).Points.I...

Best practices of sharing files between programs

The company I work for is looking to finally upgrade from VB6 to .Net, and hoping to start off on the right foot, doing things right. Currently, all of our VB6 programs share files with each other in common folders. It's a mess. Paths are hard coded in in some programs, and forced to App.Path in others. Installing a program where we don...

RequiredFieldValidator works on dev and stage environments, not production

We deployed our legacy ASP.NET application to production after successful test deployments to our staging environment. The application makes use of RequiredFieldValidators on one particular registration page. On our development and stage environments, the validators successfully detect empty fields when "Submit" is clicked, error messa...

help me to get started with .net?

Hi I am new to .net and i dont know even bits and pieces of .net can any one say me what are all the requirements for doing my first application in .net any help will be appreciable ..waiting for the reply ...

What Types of Video Can MediaElement Play?

I'm looking for detailed information on what decides the formats of media that MediaElement can play, I can't seem to find any definitive source. I've read somewhere that if it can be played in WMP then MediaElement can play it. Is this true? If it is, then my next question is where can I find the capabilities and limitations of WMP? And...

SortedSet<T> Contains vs Linq Query

I have a very simple SortedSet with a CompareTo method that sorts on the basis of two class fields. As it is used, this collection can get quite big (million+ objects) and grows and grows over time. I have been using a simple Contains method to determine if a new value already exists in the collection... As an academic exercise I am...

Microsoft-provided data provider classes, the good and the bad?

What are advantages and disadvantages of Microsoft-provided data provider classes in ADO.NET? are they fast? ...

WindowsFormsWebBrowser drag drop functionality.

Hi, I have a windows forms webbrowser (Windows.Forms.WebBrowser) I want to capture the drag drop event over it. I did not see any drag drop events on it that I can hook into ? It just has DoDragDrop() Could you please guide me as to how to capture the drag drop event on it? I want to handle these events in a parent control that hosts...

translate Perl regex to .NET

I have some useful regexes in Perl. Is there a simple way to translate them to .NET's dialect of regex? If not, is there a concise reference of differences? ...

How do you create a dynamic tab control in ASP.net that doesn't trigger a postback?

I want to create a dynamic, role-based tab control that doesn't trigger a postback when the user switches between tabs. Does anyone have any suggestions on approaches to accomplish this? ...