.net

How can I access the underlying libraries that .NET uses for ViewState signing and encryption

I need to thread state through the client, but only for particular get requests (aka links). As such, I don't want to add this state to the client's ViewState, cluttering it up. The state needs to be encrypted. How can I create a new ViewState-like dictionary and encrypt it with the key and settings from MachineKey in machine.config? If ...

session management in web services?

is it possible to manage sessions in web-services? if yes, how to manage session in it? is it similar to sessions we maintain in JSP or PHP? where does the info about the session will be stored, Client or Server? ...

ContractFilter mismatch at the EndpointDispatcher (error handling)

Hello, my problem is following: While updateing service reference of my WCF client (simply by clicking Update Service Reference in Visual Studio 2008), I'm getting following error: System.ServiceModel.FaultException: The message with Action 'http://schemas.xmlsoap.org/ws/2004/09/transfer/Get' cannot be processed at the receive...

WCF Data Service SaveChanges problem

I've published wcf dataservice project to IIS7 with .NET 4 installed on that server. Everything worked fine, but when i called SaveChanges from client, service returned error: Server Error in '/' Application.Description: An error occurred while accessing the resources required to serve this request. You might not have permiss...

Intensive graphics application in C# (with .NET/Mono)

Hi, If you were writing a 2d graphics intensive application in C# (like animation software or a music sequencer with automated graphics control), which one would be a better choice for graphics library? I'd like to develop a cross-platform application (at least portable on Windows 7, Linux), and I'd like to use only C#, avoiding mixing...

How to check if a radiobutton is checked in a group

I have group of radio buttons, each group ranges from 5 - 27 radiobuttons. And if any radio button in a group is checked I store 1 in db else I store 0. Now I'm checking each radiobutton using if loop to see if they are checked and set database value. I'm also trying to use the code below. Is there a good/better approach to check if they...

public inner classes

Can anyone explain, why we can do such thing and why we need this public class OuterClass { public class InnerClass { } } Why we need public inner whatever: struct, class, enum or static class? I think that if it is inner then it must be only private or protected. ...

How do I compare two AssemblyName instances?

How do I compare two AssemblyName instances to figure out whether they represent the same assembly? The 'Equals' method isn't overriden. One way I can think of is compare the 'ToString()' results of both the instances but I would prefer an 'Equals' syntax since I need to prepare a list (List) of 'unique' AssemblyName instances and would...

How to efficiently overwrite parts of a string by index in .NET ?

Hi, In my .NET program I allow a user to define "fields" which are values calculated by the business logic. These fields have a position and length, so that they can all be inserted into a single output string at a given index. I also allow a user to specify default content of this output string. If no field is defined to replace a give...

Dynamic Variable Name Use in C# for WinForms

Not sure what is the best way to word this, but I am wondering if a dynamic variable name access can be done in C# (3.5). Here is the code I am currently looking to "smarten up" or make more elegant with a loop. private void frmFilter_Load(object sender, EventArgs e) { chkCategory1.Text = categories[0]; chkCateg...

ASP .NET DynamicData Custom Provider

I'm implementing a custom DynamicData provider for ASP .NET, but for the life of me, I can't figure out where in the API to define how my custom provider should do saves/updates/inserts... For my custom provider, I've created: DataModelProvider TableProvider ColumnProvider AssociationProvider and an IDisposable DataContext (which is ...

How to use linq to object to hide or show some control in asp.net page

I am creating a function to hide all the gridview controls except the control whose name is being passed in the function. Here this.Controls referes to controls present in the page (At compilation error is thrown although). I want to fetch all the controls of type GridView with Name property not equal to the one passed in the funtion. ...

Using the "Using" Statement with Typed Dataset Table Adapters

Simple Question. Is it important to use the using statement when working with typed dataset table adapters? Most examples I have seen on the net never use the using statement. using (Data_ItemTableAdapter adapter = new Data_ItemTableAdapter()) { DataItemTable = a.GetDataByDataItemID(DataItemID); // more code here } Thanks...

Fluent nHibernate returns null from nvarchar field map & sets to null

Hi, Got a weird nHibernate problem. I have a table called AssetRule which is being mapped with the following code: Public Class AssetRuleMap Inherits FluentNHibernate.Mapping.ClassMap(Of AssetRule) Public Sub New() Id(Function(x) x.Id) Map(Function(x) x.PageType).CustomType(Of PageType)() Map(Function(x) x.Path) Map(Fu...

Auto-capitalizing all method names for port from Java to .NET

I am using IKVM to compile a large Java library project to a .NET DLL. In so doing, however, the method names are staying according to the Java convention of method names NOT being capitalized - but I want the .NET dll to be used in .NET projects and so would like the method names to be capitalized. The only exception would be methods w...

.NET Web browser component that allow you to capture the GET and POST data

I'd like to develop an .NET application, where you navigate in a website and the app records the GET and POST data you send to the server, so later on you can reproduce it programatically. I've been taking a look on the WinForm's WebBrowser component but I see no way to get the POST data I'm sending. Do you know of any component (even ...

ComboBox causes strange behavior on a Windows Form

I'm noticing some strange behavior when I add a ComboBox to my Windows Form: when I resize the Form without a ComboBox, it behaves correctly and the File menu stays where it's supposed to stay even when I drag the right corner as far left as possible. When I add the ComboBox and I try to do the same thing, then the File menu gets pushed ...

Configuration-Based Activation Problem In My Wcf Service

Hi, I want to use new .Net framework 4.0 feature "Configuration-Based Activation". I wrote that lines into web.config. <system.serviceModel> <serviceHostingEnvironment> <serviceActivations> <add factory="MyCompany.Core.Hosting.WcfHostFactory" relativeAddress="Greeting.svc" service="MyCompany.Core.Services.Gree...

If null.Equals(null) why do I get a NullReferenceException

I have the following line of code --> var selectedDomainID = lkuDomainType.EditValue.Equals(null) ? string.Empty : lkuDomainType.EditValue; that is, sometimes, generating a NullReferenceException What I don't understand is why. Isn't the whole point of my code to check for null and if so assign string.empty?? When I check in DEBUG ...

Is string value type or reference type

Is string a reference type or a value type? Can anyone give a corresponding description? ...