.net

ScriptManager.RegisterClientScript in a UserControl within a FormView inside an Async Panel.

I'm having an annoying problem registering a javascript event from inside a user control within a formview in an Async panel. I go to my formview, and press a button to switch into insert mode. This doesn't do a full page postback. Within insert mode, my user control's page_load event should then register a javascript event using Script...

.NET SOAP Common types

Is there a way when creating web services to specify the types to use? Specifically, I want to be able to use the same type on both the client and server to reduce duplication of code. Over simplified example: public class Name { public string FirstName {get; set;} public string Surname { get; set; } pu...

Common Naming Conventions

What are the naming conventions that you use while coding? ...

Dump CCWs and RCWs in a mixed managed/unmanaged process

I have a mixed managed/unmanaged environment (Visual Studio and ReSharper) and I suspect CCW or RCW leak. Is there any way to dump all currently allocated wrappers and identify their source/target? I have WinDbg, SOS & SOSEx, so I can see total number of RCWs and CCWs with !syncblk command. I just want to see objects, so I can call !gcro...

WPF locbaml-ed application and runtime language switch?

hi there, i wonder if there is a simple solution to change language of a wpf application during runtime. i used locbaml to globalize all the resources. Setting the Current Thread's UICulture in the App-constructor works fine, but when i try to chang it a little bit later, i doesn't reflect the changes anymore. This was actually quite ea...

WinForms in Excel (2002)

Good morning, I am about to start writing an Excel add-in for Excel 2002. The add-in needs to call a form. Obviously, I can write the form within VBA. My question is -- is there an easy/good way of calling a .NET (I am using 3.5) from Excel, and have the form be able to write stuff back to Excel the same way a native Excel 2002 form ...

Best way to register js for modularity in User Control

Hello i have a control that is organized like this and i want to have the javascript registered on the calling master pages, etc, so that anywhere this control folder is dropped and then registered, it will know how to find the URL to the js. Here is what i have so far (in the user control ) protected void Page_Load(object sender, ...

Compact Framework : any Finger Friendly GUI ?

i m developing a little tool on my Pocket PC using WM6 SDK but i would like to implement a finger friendly user interface (iphone-like). So i m looking for a free .NET framework that offers the possibility to easily integrate a finger friendly interface for Windows Mobile 6 Pro . Any ideas ? EDIT : Finger friendly means big icons, bi...

ASP .Net server control events order

Which are the events of an ASP .Net server control and how does their order relate to the containing page's events? The concrete problem is that I am looking for an event inside the server control that fires before the *Page_Load* event of the containing page. ...

Why Aren't All My WinForm Controls and Forms Localizing?

Greetings all, I'm trying to localize a .NET/C# project. I'm using string resource files and setting the "Localizable" property on all my forms to 'True'. The assembly culture is empty. The resx/resource files are successfully passed through Lingobit, resgen, and al. When running the localized executables, some of my forms are not ...

How can I write a unit test for a controller class that uses winforms for views?

Has anyone been able to successfully unit test methods that are, by necessity, coupled to the System.Windows.Forms.Form class? I've recently been working on a C# winforms application, trying to build it with an MVC structure. This is difficult enough, given that the framework isn't really built with this in mind. However, it gets even...

UI Performance with custom border.

I am creating a user control in C# and I am adding my own border and background. Currently the background is 16 small images that I change depending on the status of the object. Performance wise, would I be better off using GDI+ instead of the images? ...

Displaying tabular type data in .net winforms

Hi, I want to display tabular type data, but it will not be coming from a single datasource. I am currently using a label, but the alignment doesn't look that great. Any ideas? Again, the data is not being loaded from a datagrid or anything, each row is basically a label and a number e.g. Total Users: 10123 Total Logins: 234 What is...

What do I need in order to create 64 bit .NET applications

If I want to compile my .NET applications for a 64 bit environment. Do I need 64 bit OS version or 64 bit Visual Studio version Or both? ...

String Format Date - C# or VB.NET

Date coming out of a database, need to format as "mm/dd/yy" For Each dr as DataRow in ds.Tables(0).Rows Response.Write(dr("CreateDate")) Next ...

.NET currency formatter: can I specify the use of banker's rounding?

Does anyone know how I can get a format string to use bankers rounding? I have been using "{0:c}" but that doesn't round the same way that bankers rounding does. The Math.Round() method does bankers rounding. I just need to be able to duplicate how it rounds using a format string. Note: the original question was rather misleading, an...

Calling 32bit Code from 64bit Process

I have an application that we're trying to migrate to 64bit from 32bit. It's .NET, compiled using the x64 flags. However, we have a large number of DLLs written in FORTRAN 90 compiled for 32bit. The functions in the FORTRAN DLLs are fairly simple: you put data in, you pull data out; no state of any sort. We also don't spend a lot of...

How do I make ImageMagick talk to Ghostscript

I am on Windows XP. I am using ImageMagick (MagickNet) to convert PDF's to TIF's. My problem is that when I load a PDF in the MagicNet.Image object, it doesn't throw an error, but when I look at the properties, it is obvious it didn't load the PDF (it doesn't contain any data). My guess is that ImageMagick isn't talking to Ghostscri...

Modify config file based on build constants

I have an application dependent on some internal web services, and so we want our development and staging configurations to point to the development and staging servers for the web services. Right now, this means manually editing my app.config file to point to the appropriate URLs. This is not only a hassle, but prone to human error ("...

In a .Net winforms application, how do I obtain the path the current user's temp folder?

Seems so basic, I can't believe I don't know this! I just need a scratch folder to dump some temporary files to. I don't care if it gets wiped out between usages or not, and I don't think I should have to go through the hassle of creating one and maintaining it myself from within my application. Is that too much to ask? ...