.net-3.5

Creating Snippets of ViewPage ServerSide Code

Hi again, I am working on an ASP.NET MVC Project and I have a number of node snippets that I need to insert into multiple pages. I would very much like to know whether or not it is possible to have a snippet of code that can be placed in an external file and called from within a ViewPage. In a way this would be similar to calling a class...

What is the design motive behind extension methods in C#

I was wondering what is the design motive behind extension methods in C# ...

Wrong App.config being loaded

Hi all, I have a .NET 3.5 class library I built that reads an App.config file for values it needs. It can pull the config values just fine when I test it in Visual Studio. To test it, I just change the project to a console application and execute a method call. I have the need to call this class library from many other .NET programs,...

I need to change the style and control use of the asp:Login control button

Is it possible to get the source and code behind of the control so I can manipulate it myself? That way I can keep using the Membership and have the ease of functionality, but can use my own controls. I'm sure there is an easy solution to this. Thanks. ...

Factory Model in C#

I have a bunch of MDI child nodes that are all created in the same way and to reduce redundant code I'd like to be able to call a method, pass it a string (name of child node), have it create the node and add it to the parent. I can do all the stuff except create the class from a string of a class name, how can I do this? ...

Linq - what locale/collation it uses to compare objects?

When I call a Linq (not Linq-for-SQL, just simple in-memory Linq) - what locale it uses to compare objects, and how can I affect it? E.g. string[] a = { "a", "b", ... }; string max = a.Max(); What locale is used here - current, invariant? How can I affect it? The comparision seems to be case-insensitive, what if I want to find case...

How do I get the actual value of a DependancyProperty?

I have a small UserControl and it needs to know the Background Brush of the control on which it's being rendered. However, if I look in the Background property of the UserControl it comes back null. If I call GetValue(UserControl.BackgroundProperty) it also returns null even though up the Visual tree it is definitely being set. Seems...

z-Order of application windows - WPF

Is there a way to find out the z-order of all active windows in my application (application.current.windows) or any other way to find out what is the "parent" window of a modal window? I am trying to implement a "shader" functionality, that should fade the parent window when a modal window is shown. (the only way I have found so far i...

LinqToSQL Select and SelectMany vs Join

Are Select and SelectMany preferrable to Joins? The reason I'm wondering is because I use LinqPad and in one section there are comments that say: // Note: before delving into this section, make sure you've read the preceding two // sections: Select and SelectMany. The Join operators are actually unnecessary // in LINQ to SQL, and the e...

Distributing WPF apps to a legacy user base: How seamless is it?

I'm considering developing a WPF application, to be hosted by a legacy Windows app (C++), and I'm trying to get a better sense of how feasible it'll be to do so, given the broad user base I'm targeting. Knowing WPF targets .NET 3.5, I'm looking for some insight as to what the field looks like right now -- who's already got the runtime, ...

Using ASP.NET Forms Authentication, how do I get an image to appear on the login screen?

I am doing simple forms authentication for a small ASP.NET (3.5, C#) application and setting up my usernames and passwords in the web.config. I would like to apply the default stylesheet and include the header graphic (included on every other page) but the graphic and stylesheet won't apply, presumably because the anonymous user doesn't...

How do you stop windows from resizing and moving your window?

When I try to move my window(with a mouse) above my screen so that the title bar would be hidden windows will move it back. And If I try to rezise the window larger then the screen space, windows will resize it back to "fit" the screen resolution. It seems that windows is sending a wm_move message if it does not like the size or positio...

Installer custom Actions

How to Delete all the Folders Created by the Application in the Application Start Up Path (Program Files) at the Unistall. ...

What's the best way to call INotifyPropertyChanged's PropertyChanged event ?

When you implement the INotifyPropertyChanged interface, you're responsible for calling the PropertyChanged event each and everytime a property is updated in the class. This typically leads to the following code : public class MyClass: INotifyPropertyChanged private bool myfield; public bool MyField { ...

How can I get data from a list with a where clause to another list?

Hi, I have a list with multiple class that contain a Property that is an Integer (Id). I have a List of Integer too. Now, I would like to trim the List of my object to only those class that has the Property in the list of the integer. Example: List of MyObject [MyObjectA].Id = 1 [MyObjectB].Id = 2 [MyObjectC].Id = 3 [MyObjectD].Id ...

Linq Distinct on a particular Property

Hello, I am playing with Linq to learn about it but I can't figure out how to Distinct when I do not have a simple list (a simple list of integer is pretty easy to do, this is not the question). What if want to distinct a list of Object on ONE or MORE Properties of the object? Example: If an object is "Person", with Property "Id". How ...

ASP Required permissions cannot be acquired.

Hi, I'm developing an ASP.NET WebSite and I get an Exception Required permissions cannot be acquired. ... Is there a way to find out which permission(s) are missing? Kind regards christian I know the assembly that causes the exception, but I don't know which permission it requires. ...

import csv file/excel into sql database asp.net

Hi everyone! I am starting a project with asp.net visual studio 2008 / SQL 2000 (2005 in future) using c#. The tricky part for me is that the existing DB schema changes often and the import files columns will all have to me matched up with the existing db schema since they may not be one to one match on column names. (There is a lookup ...

Custom HTTP Basic Authentication for ASP.NET Web Services on .NET 3.5/VS 2008

I am refactoring a working ASP.NET Web Application to expose Web Services interface using ASP.NET Web Service. According to Web Services authentication - best practices, Basic Auth over https is the way to go. Let's assume it is, as opposed to doing WS-Security, X509, etc.. On .NET 3.5/VS 2008, what's the simplest way of implementing cu...

Could not find assembly System.ServiceModel

I'm deploying a webpart on sharepoint and getting some errors. The webpart consumes data from a Web Service and displays a chart using Microsoft Chart (Framework 3.5). When I try to acces it, I get the folowing error: Could not load file or assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e0...