.net

Configuration file with ClickOnce deployment

I've been trying to modify my application to deploy and update using ClickOnce. I've managed to get the program working but I'm having trouble with the program configuration. My program uses a custom XML configuration file located in the application directory. This raises 2 major problems. 1.) The configuration file is very hard to get ...

Displaying design-time pop-up form for MaskedTextBox.Mask property in a run-time

Does anybody know if it's possible to open a pop-up form "Input Mask" which is displayed when you want to change Mask property of MaskedTextBox editor and you click on the details button on the right side of this property in design-time? I'd like to use the same form in run-time in an application and use its result for mask string. ...

Unity: passing an instance of the model state to the injected dependency

Hi, I'm refactoring the controllers in a .net MVC app so I can inject the dependencies using the unity container. There's this service that needs a reference to the controller's modelstate so I'm hitting a roadblock here. Is it possible to get a reference to the controllers's modelstate at the time of the injection? I'm currently registe...

Is there a SQL equivalent to Linq .Skip(1000).Take(100)

Is there a SQL equivalent to the Skip method of Linq? For example I would like to be able to select the 1000 - 1100 rows from a database table. Or am I going to have to select the whole table and then find the rows in memory? My problem is that the table can be quite big and I'd like to avoid doing that if possible. ...

Did Html.RenderAction make it into VS2010/ ASP.NET 4?

We are planning to use VS2010 later in the future, but currently working on 2008. Since the RenderAction is still a Future, we want to be sure it will be a "Production Quality" component later, when we do decide to move to VS2010... Does anybody knows if it made it into VS2010 b2? Thanks ...

InvokeMethod not working on windows form

I have a windows form containing a webbrowser that navigates to a site which sends data back in the form of a table. I would like to transfer the data on that table to a application that runs some calculations on the data and then reports whether the calculations were successful or not. If the calculations were sucessful the webbrowser...

JpegBitmapEncoder Image too big

I'm creating an image using the JpegBitmapEncoder.. it's a big image (70k px X 600px). When I try to save it I'm getting a "The image dimensions are out of the range supported by this codec". Is there another encoder i can use that will generate an image that size? Format isn't an issue... i'd prefer a format with compression, but it ...

Type-Forwarding

Can anyone provide a real life senario where Type Forward is use? ...

What event to use for a TextBox control to signal text change upon pressing enter?

TextChanged sends a notification for every key press inside the TextBox control. Should I be using KeyDown event? ...

Override (or shadow) a method with extension method?

Is it possible to override or shadow (new in C#) instance methods with extension methods? ...

Should i create urls in the view or the controler?

I have user friendly urls that are generated and stored in a database.. When I want to get a url I have a helper class that gives me the urls.. this helper method sometimes calls to the database to generate a url.. According to separation of concerns should i generate all the urls needed in a page in the controller and pass them to...

Switching from MDI to SDI and Back Again

This sounds like it would be a simple task, but I'm running into some issues. I have some fairly straightforward code for my C# application: private void SwitchToSdi() { MainWindow mainWindow = GetMainWindow(); for (int index = mainWindow.MdiChildren.Length - 1; index >= 0; index--) { Form f...

Disable Cell Highlighting in a datagridview

How to disable Cell Highlighting in a datagridview, Highlighting should not happen even if I click on the cell. Any thoughts please ...

Quick question regarding reflection and permissions. .net 2008

I have various projects that use reflection to access and invoke private or internal members in some of the framework classes. These projects all work fine on my machine (running visual basic express 2008), but are they guaranteed to work on another machine, or, say, over a network? I've had a look at ReflectionPermission, but I'm not ...

Can I use net.tcp bindings for protobuf-net WCF?

Can I use net.tcp bindings for protobuf-net WCF? Can I use ClientBase or I have to use ProtoClient? ...

Moving a control around on the UI

We are developing in C#.Net. We are dynamically changing a .Net control's location based on mouse movement. The control moves on the screen as expected, but, if the mouse moved too quickly strange redraw issues occur. The issues include only viewing part of the control and it not being fully visible until mouse movement stops. This occur...

How does .Net process get the Culture information

I have a windows service running (C#, .Net 2.0) on Windows 2003 R2. In one server the System.Threading.Thread.CurrentThread.CurrentCulture is {en-AU} and in the other {en-US}. This has caused a difference when calling ToString() on a datetime object. I want the Culture to be {en-AU}. I checked the "Regional and Language Setting". In bot...

.NET application to Mac OS X application?

Is there a way to convert .NET applications into Mac OS X applications? I am using Visual Basic 2008, and I want Mac users to use my application as well. Is it possible? If so please reply back with a link or source. ...

LINQ to SQL: EntitySet<T>.Assign

I have many-to-many relationship in LINQ to SQL scheme: Products table, Categories table and ProductCategories table (ProductId, CategoryId fields). Product prod; EntitySet<Category> cats = prod.ProductCategories; Now I have a list of category ids (catIds) and I want to set (overwrite) them as categories of a single product in one ope...

Button not picking up c# code behind event, what did I do wrong?

I have a button: <button type="submit" class="contact" onclick="click"> and I have a c# code behind function: protected void click(object sender, EventArgs e) { contact_label.Text = "tester"; } and there is a label on my page: <asp:Label id="contact_label"... The trouble is when I click the button the 'click' function is not...