.net

.php to .aspx

Hello all, I had a project for developing a website for a NGO. I had a doubt: The website is already working with lot of flaws and had very few pages. This website is made in Php and They want me to make it more secure. So i want to make this website using Microsoft .NET Framework. If i make this website from scratch and then...

Practical WPF Programming

Hi, I think I have got some grasp over basic WPF fundaes. Now I want to go deep. However, apart from understanding how the classes work under the hood, I would like to learn practical aspects of WPF; that is, how to use it in real life projects. I have seen a number of such books for Web Frameworks and languages such as Django, PHP et...

HiddenField control maintaining viewstate

Hi, I have a strange problem. While populating formfields, the values are maintained when clicking a'submit' button that causes the page to proceed to the next stage. I try to populate a hidden field from the code behind on the event of a 'find 'button click (before clicking this 'submit' button and this works. But the value is not mai...

Is it possible to show a selection border rather than back-colour in a DataGridView?

My DGV has row BackColors set to various colours based on business logic. When a user selects the row the colour changes to the selected row BackColor thus obscuring the pre-set colour. I would like to preserve the original colour when a row is selected and indicate selection with (perhaps) a bold border around the selected row. Is this ...

.NET - Programmatic alteration of Project and Solution files (.vbprog, .csproj, .sln)

We maintain a large number of .NET Project and Solution files by hand; it's ugly tedious and should be automated. The files are all XML, so writing a tool for our purposes won't be hard, but I was wondering if anyone knows of either a VS or TFS API object that would let me work with these files as objects without having to create my own...

Publish option disabled in win Vista after converting a website to web application

I have converted a web site to a webapplication. In windows Vista, the option of publish is no more available. Any idea how to solve this problem. ...

Why would my Class Library not get referenced?

I have a class library file that is not is not getting picked up when I add it to the reference and bin folder. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data; namespace SecuritySettings { public class Security { ... public Security() {.....

.NET MVC jQuery relative path for window.location

Hi, I have a real simple problem, but can't seem to figure it out. The following doesn't work because of the way MVC builds the URL (It includes all the route information). I want pathname to return the virtual directory path only. All I'm doing is redirecting to a different route when a user selects an ID from a drop down list. $(...

ListBox.DisplayMember = [String] Can I somehow workaround it to be other than string in .NET?

The question is asked with respect to an Object DataSource. So Consider that I have a class public class Customer{ public String name; public int age; public Customer(String name, int age) { this.name = name; this.age = age; } } And I have databound a list box to a list of these objects. So I say ...

How to reference specific implementations of generic interfaces in XML comments?

Hi all.. Consider this scenario, 2 interfaces, 1 generic: public IGenericAdder<T> { T Add(T, T); } public IIntAdder : IGenericAdder<Int32> { } Is there someway that I can do XML comments on the generic add method, so that intellisense will show "Adds the Int32" if I do a: IIntAdder foo; foo.Add( //Show intellisense here ...

Can I impersonate a user on a different Active Directory domain in .NET?

I have two Active Directory domains, A and B. Users in domain A need to run an application on their desktops to view and manipulate a resource located on a server in domain B. Each user also has an account in domain B. Is it possible to impersonate each user's domain B identity to perform operations on the domain B resource programati...

GetHostEntry is very slow

I have a WinForms app, and I'm trying to get reverse DNS entries for a list of IPs displayed on the form. The main issue I've run into is System.Net.Dns.GetHostEntry is ridiculously slow, particularly when no reverse DNS entry is found. With straight DNS, this should be fast, since the DNS server will return NXDOMAIN. Internally, it's ...

Vista style explorer/folder view

I am trying to have a list of large (256x256) icons in a listview similar to vista explorer windows, but the winforms' listview control doesn't look like vista's listview. Before I dig into WPF, can someone tell me if WPF listview can do this? Basically I get this (solid blue selection): instead of this (semi transparent blue select...

Having two WCF application in the same pool cause weird problems

Hi, I have a WCF application, running on .NET 3.5 SP1, hosted in IIS7, on a Windows Server 2008 64-bit. In our architecture, there is 1 instance of the application per client, DLLs are copied in a separate directory for each client. In IIS, we host 5 or so clients per application pool, each client having its own application/virtual dir...

Writing Unit tests for a class that references UI controls

I have an abstract class that a User control inherits from, that I would like to write unit tests for. I understand I need to create a mock class to be able to test abstract classes. The abstract class has references to UI controls (ex: a base method that has web control as an argument). My question is, how would I write unit tests to an...

Newbie ASP.Net programmer needs help

I use c# and usually program winform/desktop applications. But; now I'm asked to develop some ASP.Net projects. So here goes my newbie question: I'm developing this project for device (lets say) 'Protoype X' and it has manufacturer provided .Net api. This api fires events (which I shoud subscribe to) upon receiving some special -signal-...

C# Logoff out a user via Windows Service

How do I logoff a user via a Windows Service? I found this example here but it will not work in a service. http://www.c-sharpcorner.com/UploadFile/thiagu304/desktopfunctions02112007140806PM/desktopfunctions.aspx ...

How do you populate a parent child data structure from XML where generic List<> objects are in parent and child structures using one LINQ query?

I have an XML configuration file that contains a list of documents with field maps for each document. I want to use LINQ to XML to populate an internal data structure which represents the documents as a hierarchy of List<> structures. An attribute called Include determines whether the field should be included. Here is a sample of what ...

Other than for Databinding, is INotifyPropertyChanging / Changed used in the .NET Framework?

If you have a BindingList<Person> for example and you bind it to a control, if your Person class doesn't implement INotfiyPropertyChanging / Changed, your changes to the underlying List won't show up in your control automatically. My question is, are there any other uses for these interfaces as far as the framework is concerned? I'm not ...

Debugging Property Settings in Visual Studio 2008 with INotifyPropertyChanged

I have a class with a property that gets set by another class. Inside this property setter the program blows up. I just need to know what class actually set the property. I thought I could just look at the stacktrace, but because I am using INotifyPropertyChanged I think it doesn't give me the full information I am looking for. He...