.net

How to fire server-side methods with jQuery

I have a large application and I'm going to enabling short-cut key for it. I'd find 2 JQuery plug-ins (demo plug-in 1 - Demo plug-in 2) that do this for me. you can find both of them in this post in StackOverFlow My application is a completed one and I'm goining to add some functionality to it so I don't want towrite code again. So as ...

How to return relationships in a custom un-typed dataservice provider

I have a custom .Net DataService and can't figure out how to return the data for relationships. The data base has 2 tables (Customer, Address). A Customer can have multiple addresses, but each address can only have on customer. I'm using Dictionary<string,object> as my data type. My question, for the following 2 urls how do i return t...

How to encode JavaScript text inside an XML attribute?

I have a piece of JavaScript string, coming from an untrusted source, embedded inside of an onclick tag and I'm not sure what the correct way of encoding this string is. Here is a simplification of the HTML: <input type="button" onclick="alert([ENCODED STRING HERE]);" value="Click me" /> I use the Microsoft AntiXss library which c...

memcpy fuction in c#

Possible Duplicate: C# memcpy equivalent Kindly tell me any equivalent function of memcpy in c#? ...

Installer won't remove windows service

When I try to install over a previous version I get the error "The specified service already exists" I stop the service before the installation and the services.msc snap-in is closed also. I use a visual studio setup and deployment project. ...

why grouping Design pattern in three parts?

Design pattern can separeted 3 important part: "http://www.dofactory.com/Patterns/Patterns.aspx". why three part? Creational Patterns Structural Patterns Behavioral Patterns How can i separete it into three part? According to what? ...

Cant add events for controls in WPF IronPython VS2010

I installed VS2010 and IronPython tools. When I start a VB.NET WPFProject everything works fine. But when I start a WPF IronPython project, it creates a button by default which fills all the window, and when you try to add an event to that control or another control dragged from the toolbox, you just cant do it. You double click on them,...

In .NET, how can I convert from "0.000" to a 'long'?

I have a string, "0.000" (or any similar string), that I would like to convert to a long. I am happy to "chop-off" anything after the decimal. What is the best way to go about this? I can convert to double and then to long, but I'm just wondering if there is an easier way. All the following statements throw exceptions: long l3 = Conv...

Self Tracking Entities with Pre-Generated Views

I am currently using the Self Tracking entities of the .NET Entity Framework, however I would like to speed up my execution of queries. The first thing everyone seems to suggest is generate the views for the model at compile time. Using the ssdl files etc, I was able to create a 'MyModel.Views.cs', which is compiled in my project. Howe...

Free .NET build system?

Possible Duplicates: Which Continuous Integration tool are you using? Best Continuous Integration Setup for a solo developer (.NET) Even though this is likely a dupe, I can't seem to find a list of free CI build systems for .NET. I've mainly used Hudson and TFS so far, but I was not exactly satisfied. Wikipedia lists quite ...

WCF authentication example using System.Web.ApplicationServices.AuthenticationService and mobile app?

I see many examples of using this by creating the standard .NET stub clients and consuming services that way. Can anyone point me in the direction of an example using the System.Web.ApplicationServices.AuthenticationService WCF authentication service being consumed by a mobile app? Thanks. ...

Any good source of explanatory documentation on ColorMatrix?

I'd like to try using ColorMatrix, but am only able to find examples that convert an image to grayscale. And even then, they tend to be presented as a chunk of 'magic numbers' code with no explanation. Does anyone know of a 'tutorial' on how to use ColorMatrix? For example I'd be interested in converting a grayscale image to a color ima...

.NET 4.0 slower than earlier versions, is that true?

Possible Duplicate: Are .NET 4.0 Runtime slower than .NET 2.0 Runtime? Hello All, We are planning to move to .NET framework 4.0 sometime soon... I don't remember the refernce or link, but recently, I read about the latest framework being a little slow in performance when compared to its predecessors. Is that true? has anybod...

Overflow exception while performing parallel factorization using the .NET Task Parallel Library (TPL)

Hello, I'm trying to write a not so smart factorization program and trying to do it in parallel using TPL. However, after about 15 minutes of running on a core 2 duo machine, I am getting an aggregate exception with an overflow exception inside it. All the entries in the stack trace are part of the .NET framework, the overflow does not c...

Visual Studio keeps inserting absurd default property value in designer file

i have a simple usercontrol with following properties: public partial class RichTextEditorControl : UserControl { public string EditorText { get { return richTextBox1.Rtf; } set { richTextBox1.Rtf = value; } } public string EditorPlainText { get { return richTextBox1.Text; } set { ri...

Visual Studio - how to create two projects using the same sources

My solution consists of 2 executable projects and a couple dlls. Project1 is a Smart Device Project, Project2 is a Windows Forms Project. Both projects use the same libraries, the reason of that is I want to test my libraries on PC before I deploy it on the device. The problem is that the DLL project type can be Smart Device Class Libr...

Digitally sign MS Office (Word, Excel, etc..) and PDF files on the server

I need to digitally sign MS Office and PDF files that are stored on a server. I really mean a digital signature that is integrated in the document, according to each specific file formats. This is the process I had in mind : Create a hash of the file's content Send the hash to a custom written java applet in the browser The user enc...

How to solve the "Growing If Statement" problem?

I've been doing some reading about design patterns and wanted some perspective. Consider the following: Dim objGruntWorker as IGruntWorker if SomeCriteria then objGruntWorker = new GoFor() else if SomeOtherCriteria then objGruntWorker = new Newb() else if SomeCriteriaAndTheKitchenSink then objGruntWorker = new CubeRat() end i...

VS 2010 unable to load references from previous .NET version and unable to change target framework for new projects

I have an in-house proprietary library developed in .NET 2.0 using VS 2008 . I upgraded to VS 2010 and using the library in a new project based on 4.0. I have added the library as reference but when I am trying to compile I get an error stating that namespace doesn't exists. In addition I tried to change the framework to 2.0 for my new...

Easily switching ConnectionStrings on publish to Azure

I'm currently building an Azure Web Role. I am testing this project against a local database server on localhost. Then, when confident that the project is working, I publish it to Staging on Windows Azure. However, I also have to remember to change the connection string to point to the live SQL server on SQL Azure before deploying, and ...