.net

HTML input not working correctly with AJAX update panels used else where on page

I have some update panels on my page that do some asyncpostbacks to keep some dropdownlists correctly populated. My problem is that on my page i have an HTML input that is handling some file uploads. With the AJAX on the page with asyncpostbacks, and while i step through my code behind, the files arent being uploaded. Using a postbacktri...

How can I enumerate methods that have MethodAttributes.PrivateScope using Reflection?

How can I enumerate methods that have MethodAttributes.PrivateScope using Reflection? ...

ASP.NET MVC FileNotFoundException error

I'm having a weird error which is related to an earlier post. I am checking if a file exists before downloading. This works for PDFs, but not for any other type of document. Here is my controller action and the typical path for a PDF and a PowerPoint file, the PowerPoint does not work, the File.Exists always returns false. Both files ph...

redirecting _top page from asp:login control in iframe onloggedin

So yeah, Im building a little authenticated content(.NET app) to a large html site managed by another group. They are only comfortable with managing html so all my app content will be contained in iframes. Everything is working fine as far as navigation and calling services and whatnot but i cant bust out of the frame with my asp:login c...

ASP.NET/.NET: Method to determine whether string is or contains HTML entity

Is there a method anywhere in the .NET framework or System.Web that will tell me whether a string contains an HTML or is one? Should I just Server.HtmlEncode(myString) and see if its length is longer than myString's length before encoding? ...

Silverlight 4 + MVVM + KeyDown event

I'm trying to build a sample game in Silverlight 4 using the MVVM design pattern to broaden my knowledge. I'm using Laurent Bugnion's MvvmLight toolkit as well (found here: http://mvvmlight.codeplex.com/ ). All I want to do right now is move a shape around within a Canvas by pressing specific keys. My solution contains a Player.xaml (...

In OpenRasta is it possible to Pattern match multiple key/value pairs?

Is it possible in OpenRasta to have a Uri pattern that allows for an array of values of the same key to be submitted and mapped to a handler method accepting an array of the query parameters. Example: Return all the contacts named Dave Smith from a collection. HTTP GET /contacts?filterBy=first&filterValue=Dave&filterBy=last&filterValue...

WinForms: finding the size of a minimized form without going to FormWindowState.Normal

Is there an easy way to determine the size of a Form it does have in WindowState=Normal, without actually changing the Form state? Here is what I do now (C# code): public class MyForm: Form { public void MyMethod() { // ... FormWindowState oldState = this.WindowState; this.WindowState = FormWindo...

creating link button dynamically and setting Click event to EventHandler...not working

I'm creating a paging class and trying to allow for some dynamic configuration for the method to call when Next/Previous links are clicked. The class looks like this: public class Pager { public int StartIndex { get; set; } public int Range { get; set; } public int NumRows { get; set; } public event EventHandler Paging;...

What are the benefits to using String[] over List<String>?

Possible Duplicates: c# array vs generic list Array versus List<T>: When to use which? I understand that there are several benefits of using List<>. However, I was wondering what benefits might still exist for using arrays. Thanks. ...

What is Dublin and how does it relate to WCF?

Going through some WCF hosting questions on StackOverflow, I've seen Dublin mentioned a few times as a technology from Microsoft that is forthcoming. It's only alluded to and not actually defined though. Can someone give me a good explanation of what Dublin is? Also, what is its release status and is it going by a different name now? (H...

Drawing layers in GDI

Hello, I am creating an application in .NET using winforms. That application must draw on a Panel. Is it possible to paint objects on different layers, and combine that to one image on the panel? One layer has many objects on it. ...

EF 4.0 Batch Inserts Vs Single Insert Exception

I have been encountering an issue with inserts in EF 4.0. During a migration from one system to another I migrate the values of three configuration tables into a database fronted by EF. The following code crashes: foreach (MyModel model in models) { if(entities.my_Model.Where(p => p.Id == model.modelId).Count() == 0 ) { ...

ASP.NET ListView - Scrollable with fixed headers using CSS

I am using an ASP.NET ListView control and, at the moment, I have a scrollable grid: (example below is simplified and contains embedded styling for sake of question) <asp:ListView ID="ListView" runat="server" DataKeyNames="Id"> <LayoutTemplate> <div style="height:225px; overflow:auto;"> <table runat=...

How can I avoid setting some columns if others haven't changed, when working with Linq To SQL?

In LINQ to SQL, I want to avoid setting some columns if others haven't changed? Say I have dim row = (From c in dataContext.Customers Where c.Id = 1234 Select c).Single() row.Name = "Example" ' line 3 dataContext.SubmitChanges() ' line 4 Great, so LINQ to SQL fetches a row, sets the name to "Example" in memory, and generates an upda...

What do the IL Prefix OpCodes do?

I've been playing around with IL and I noticed OpCodes like Prefix1, with documentation basically telling me not to worry about it. Naturally, this makes me quite curious as to what these various Prefix OpCodes actually do. A quick Google search didn't turn up anything, so I thought I'd ask the experts here. Does anybody know what the...

In WPF, how do I get a command in a Control Template to bind to a property in a parent?

I am relatively new to WPF and sometimes it makes my head explode. However, I do like the power behind it, especially when used with the MVVM model. I have a control template that contains a button. I use that control template inside of a custom control. I want to add a property on the custom control that will bind to the command proper...

Make DataVisualization Chart object zoom and scrollable by dragging the scroll bar

I'm using a System.Windows.Forms.DataVisualization.Charting.Chart control, and have the ChartArea's AxisX and Y both set Zoomable to true. When chart is zoomed in, I see the scrollbar, but cannot drag it. Is it possible to drag the scrollbar, and have the chart display move as I am dragging the scrollbar button? I want to make it intui...

passing an "unknown enumeration" to a method

I'm currently trying to make a class that can register strings as identifiers and accociate them with different types of Enumerations, these enumerations are being evaluated only in so much that I am ensuring that when it's used, that the parameter passed to broadcast (messageType) is an instance of the associated Enum Type. This would ...

Loose Coupling of Components

I have created a class library (assembly) that provides messaging, email and sms. This class library defines an interface IMessenger which the classes EmailMessage and SmsMessage both implement. I see this is a general library that would be part of my infrastructure layer and would / can be used across any development. Now, in my appli...