.net

How to show a custom 404 page in ASP.NET without redirect?

When a request is 404 in ASP.NET on IIS 7 i want a custom error page to be displayed. The URL in the address bar should not change, so no redirect. How can i do this? ...

Consuming a PHP SOAP WebService with ASP.NET

I'm having some major issues trying to consume my PHP SOAP webservice using ASP.NET. The webservice in question is based on the PHP SOAP extension and is descibed by the following WSDL: <?xml version="1.0" encoding="UTF-8" ?> <definitions name="MyServices" targetNamespace="http://mydomain.com/api/soap/v11/services" xmlns:tns="http:/...

How to bring Windows Taskbar on foreground while running maximized?

I've got an app running maximized in a borderless window and need access to the windows taskbar on a given user event. How would I bring the taskbar in foreground in .NET while running maximized? Also an hint with regards to how to make it reliably go away wouldn't hurt! :) EDIT: please note that I don't want the taskbar always on, I ...

InkPicture control on scrollable control 'jumps' when clicked?

I tagged this with C# because that's what I'm working with. Might be true in VB, too. Doesn't really matter for me wiht this project, though. Apologies in advance for the wordy-ness. If any one would prefer, I have a small project I mocked up to isolate this very weird behavior. To observe: 1) Create a simple windows form project 2) ...

What causes a form to close without triggering any of the usual events?

I have a form that is closed unexpectedly immediately after showing it. I hooked all the usual events that occur when a form is closed, but none of it is fired (including Closed, Closing, FormClosed, FormClosing, VisibleChanged, Disposed). How can that happen? What can cause a form to disappear without any of the mentioned events firing?...

how to display selected page1 rows in page 2??

hi , i m new to asp .net page 1 : It showing some table records in UltraWebGrid and a command button Page 2: To display the selected rows in page1. I dono how to display the selected rows in page 2?? could some one tell me with an example code?? thanks in advance ...

System.FormatException: String was not recognized as a valid DateTime.

Hello all, I am using c#.net. Thanks in advance for any help. I am using a Repeater and a ObjectDataSource. I use LINQ to connect to the database. This requires a parameter to be passed through (used within the WHERE clause) public IQueryable<comments> GetComments(DateTime todaysDate) { return (from c in dc.comments ...

WPF Toolkit - Fit datagrid height to content height

Hello, I have a WPF datagrid and would like it's height to equal the sum of the heights of it's rows + header. i.e. if my datagrid header is 100px and I have 4 rows, each 50px in height the total height of my datagrid should be 300px. Is there a way of declaratively specifying that the height should match the sum of it's contents? T...

What will be the most performant and Why ?

Hello, i just have a little design question. If i got this code public Interface Test { void Xyz(); } public class1 : WebControl , Test { public void XyZ() { // do someting } public OnLoad() { ((Test)this).Xyz(); // or Test ctrl = this as Test; ctrl.Xyz(); // or Xyz(); } } Did the code will have a ...

Windows 2003 crashing with .NET 3.5 SP1

I have a product I developed based on Linq and Entity Framwork. Before they upgraded to SP1 I got an exeption when I tried to find the Entity Framework DLL. I asked the customer to upgrade to SP1. After that, they are getting bluescreen. Are there any known problems with .NET 3.5 SP1 and Windows 2003? I have a dump file. I downloaded ...

Get HTML element informations in .NET

Hi, I'm just thinking if there is any way how to get information about element in HTML in my .NET application. The input is HTML page and path to CSS files etc. I want to take e.g. H1 tag and found what will be the CSS for it. Is there any code or can I use IE and try to take this information from it automatically inside of my applicati...

Performance of Sorting Reference Type vs Value Types

We were trying to sort a collection of FileInfo objects in .NET. We implemented our IComparer to ensure that FileInfo objects were sorted based on our criteria. We then noticed that performance of sorting the FileInfo objects was many times slower than just ints. On a hunch (and remembering how references work in C) we were able to im...

Transfer/Transform Data From SQL Server 2008 DB to Another

I have rewritten an old program and designed a new database for it. I need to transfer the old data to the new database. The new database has a new schema, so I will have to manipulate much of the data that is going to be transfered. I have thought about writing a console app with 2 linq to sql contexts, one for each database and coding...

ASP.Net web site gets burst of requests that crashes IIS worker process

I'm running a fairly high volume asp.net web site across a two serve cluster. Typical load is around 20 requests/second per server as logged by the ASP.Net Apps performance object. At periodic times during the day the performance counter logs anywhere from 2,000 to 9,000 requests/second. The worker process dies at this time and reports ...

Ajax refresh messes up jqModal functionality

I am trying to use jqModal in my .net/mvc app to do simple jquery modal popups. I have a table where I list out records and have an "edit" button to popup a modal dialog to do the edits. When I submit, I hide the modal popup and refresh the table listing below using the .ajax() method. However, now when I click on the "edit" page, jqM...

When should I use implicit casting?

When is it safe to use implicit casting? Use Case: I'm working with a set of com objects that need to be taken care of specially (Marshal.ReleaseComObject). Is it OK to create a wrapper class that implicitly converts back to the actual com object wrapped? What are some situations when I shouldn't use implicit casting? ...

Why can't DateTime.ParseExact() parse "9/1/2009" using "M/d/yyyy"

Hi, I have a string that looks like this: "9/1/2009". I want to convert it to a DateTime object (using C#). This works: DateTime.Parse("9/1/2009", new CultureInfo("en-US")); But I don't understand why this doesn't work: DateTime.ParseExact("9/1/2009", "M/d/yyyy", null); There's no word in the date (like "September"), and I know t...

How to add wsse:Security header

I am trying to call a web service in a .net client. The web service requires the wsse:Security header. I've added the service reference, how do I go about adding the header? I'm doing this in c#, .net 3.5 ...

How to detect when main thread terminates?

What I need to know: I would like to detect when a the main thread (process?) terminates so that I can ensure certain actions are performed before it is terminated. What I have found myself: I found the events AppDomain.DomainUnload and AppDomain.ProcessExit. AppDomain.DomainUnload seems to work with non-applications like MbUnit. App...

Why is my local WCF client's IP not 127.0.0.1?

I have a WCF client and service using HTTPS over the wsHttpBinding. One common setup has the client and server components on the same machine. The client has to set the endpoint address to include the server's machine name, rather than localhost for SSL reasons i.e. https://mymachine/myservice/service.svc The problem is, that the defau...