.net

Choose button while pressing enter button

I have a submit button and back button in my asp.net webform. I need to use the submit button when pressing enter, but it's going to the back button instead. Please help... ...

Using OpenID for website Authentication

I'd like to implement OpenID in a new application using ASP.NET 2.0 and SQL Server 2005. I chosen Twitter, Facebook and Google as potential OpenID providers. I've found the Twitter implementation in .NET and I was studying Google's OpenID implementation, but I want to make sure that my design is (mostly!) flawless. Is my database sch...

Running ASP.NET website on Microsoft office Live?

Does MS Office Live allows user to upload and use asp.net websites? We have a specific requirements where we need to upload and use the our own modules.. I understand the security where it is dangerous for MS to allow user to port their ASPX and dlls into the server.. I would like to any other options to run custom ASPx on MS Office Li...

Base Class Library

I am new to C#, C++ and .Net. I am currently returning to programming from a stint in Networking and Cisco engineering. I used to program on IBM mainframes etc using Cobol, assembler, easytrieve, Rexx and clist etc so the command syntax is reasonably familiar to me as are programming standards and structures. However I am having quite ...

Immutable struct with collection

I'm making an immutable struct in .Net which contains a read only collection of a different immutable struct (I have full control over the entire design). I don't need a non-mutating Add method. What's the best way to do that? I could make the outer struct have a reference to a ReadOnlyCollection containing the inner struct. Are ther...

.Net authentication for both web and winforms

I have an ASP.NET web application I built for a client that uses default the ASP.NET forms authentication. They are now requesting a desktop (WinForms) app that works "with" the web application. I have created the webservices to access the data they want from the web app and put it into the desktop app. That works great.. but there needs...

How come resolve-QName() is an unknown XSLT function when using XslCompiledTransform ?

I try to transform a WSDL 1.1 to WSDL 2.0 using the XSLT 2.0 stylesheet from W3.org WSDL 1.1 to WSDL 2.0 convertor. I'm working in .NET (C#) using the XslCompiledTransform. Anyone has an idea why I get the "resolve-QName() is an unknown XSLT function" exception ? Any workarounds ? Thx ...

C# and ASP.NET MCQs

From where I can get multiple choice questions about C# and asp.net? ...

(Setup & Deployment) Create a folder & rename destination folder

Hi all, I've been using Visual Studio's Setup & Deployment Project to create an installer for a windows service and what i need is to create a folder within the application folder when the installer is run. How would i go about doing this? I tried adding a folder to the Application Folder in the File System on Target Machine bar, but th...

Can a .NET object actually have no constructors, according to reflection?

I'm writing a really simple IoC/DI container, and I've got the following code: ConstructorInfo[] ctors = concreteType.GetConstructors(); if (ctors.Length == 0) return Activator.CreateInstance(concreteType); // more code goes here... I can't come up with a test case that results in a type having zero constructors, even with this:...

Programmatically submit a form

Hi all, I've seen a tons of sample to how to programmatically submit a form (in .NET) but none of them has the specific requirements I need. The case I'm working on has a query string (http://.../index=?p=update), some hidden fields and a upload file. Does anyone has managed to submit this kind of form with a webrequest? Thanks a lot...

Oracle Update Hangs

I'm having trouble with an Oracle update. The call to ExecuteNonQuery hangs indefinitely. The code: using (OracleCommand cmd = new OracleCommand(dbData.SqlCommandStr, conn)) { foreach (string colName in dbData.Values.Keys) cmd.Parameters.Add(colName, dbData.Values[colName]); cmd.CommandTimeout = txTimeout; int nRo...

ICallbackEventHandler, HttpHandler, XMLHttpRequestObjext - which is the better method

Out of the the three (ICallbackEventHandler, HttpHandler, or XMLHttpRequest Object) Which is the better method to use? Are they essentially the same? Are ICallbackEventHandler and HttpHandler just variations of using the XMLHttpRequestObject? ...

Adding 'new' in front of the return type of C# method definition?

So I recently ran into this C# statement at work: public new string SomeFunction(int i) { return base.SomeFunction(i); } I searched the web but I think I can find a better answer here. Now, I'm guessing that all this does is return a new string with the same value as the string returned by the call to base.SomeFunction(i)... ...

What software do i need to install to use WPF in VS2005

Hi All, I have VS2005 and .net 3.5 installed on my machine I have heard of WPF and want to practice WPF solutions what other software should I install to write WPF program in VS2005 as it does not show any option for the same by default. Also any link for some cool stuff for beginners on WPF will be very helpful. Please help ...

How to I find the space a combo box needs to show all list items.

I have a WinForms combo box, I wish to set the width of the column box so that any selected item can be shown in full. (I do not know what items will be in the combo box at the time of writing the software) However when I call Combobox.PreferredSize, it does not seem to take into account the items that are in the drop down list. ...

Castle Windsor: Registering Generic Classes with a Non-Generic Interface

I have a class that has several dependencies: public class ThirdPartyDataSearchCoordinator<TItem, TSearchCriteria, TResult> : IThirdPartyDataSearchCoordinator where TItem : class, IThirdPartyItem { public ThirdPartyDataSearchCoordinator(IDataMiner<TSearchCriteria, TResult>[] miners, IThirdPartyItemRepository<TItem> repositor...

Is there an easier way to wrap every WCF method in a service with a 'using' block?

I'll take TransactionScope as my example for now. Imagine every method in your WCF carries out database activity, and you want every call to be in a transaction. You could include a using block in every one of your methods, and that would work fine. I'm wondering if there is an easier way to do this at a service, rather than method-leve...

Need good design for a multi-part form in .NET

I have a set of screens in C#/ASP where the user enters information. It's broken up into multiple parts to make it more user friendly. It used to be in separate pages, but that was very difficult to manage, as all the info is very related. So it was changed to be panels in one page that we show and hide based on the user's progress. ...

Is there support in the .NET Framework to map .NET data types to their corresponding SqlDBType?

I'm curious if there is support in the .NET Framework to map .NET data types to the corresponding enumeration SqlDbType that represents the data type in SQL. For Instance: dim mySqlDbType as SqlDbType = SomeFunction(GetType(myObject)) ...