.net

Is a HTML Table better than a Gridview in ASP.NET MVC?

I am looking into binding some data. What method of output would be better. I usually use Gridviews, but I am unsure if the table would be better now. ...

What .Net controls automatically encode output data?

What .Net controls automatically encode output data? ...

Using GetCurrentMethod in (supposedly) high-performance code

For logging purposes, some methods in our application include the following line: Dim Log As ILog = GetLog(Reflection.MethodBase.GetCurrentMethod().DeclaringType) I have what might be described as an irrational fear of reflection, which I try to keep in check. However, calls like this in methods that are executed potentially a hundred...

asp.net Problem with assembly reference

Here is my code that tries to get a custom configuration object from web.config: LdapConfiguration ldapConfig = (LdapConfiguration)ConfigurationManager.GetSection("ldapConfiguration"); When that line of code is ran I get this error page. Here is screenshot showing that I have included the reference to the project that contains the co...

.Net COM Dll in Classic ASP on 64 bit: 800a01ad ActiveX component can't create object

I have a .Net assembly in 64 bit that has been successfully registered with regasm (yep, the 64 bit version). I'm running IIS7 and the application pool that it runs from is in Managed Pipeline Mode:Classic. I can run the object in a VBS script file and it works correctly, I can also do: $ting = New-Object -com MyObjProgId from PowerS...

.NET persistence framework that supports test data

We are currently using SubSonic as our persistence layer because it's light but also because it allows us to feed in test data so our DAL can be tested without hitting the database. I absolutely love that about SubSonic. However, because we are also running into other issues with SubSonic, I'm now looking for an alternative while our p...

Loading .dll/.exe from file into temporary AppDomain throws Exception

Hi Gang, I am trying to make a Visual Studio AddIn that removes unused references from the projects in the current solution (I know this can be done, Resharper does it, but my client doesn't want to pay for 300 licences). Anyhoo, I use DTE to loop through the projects, compile their assemblies, then reflect over those assemblies to get ...

Add a dropdown for an enum in custom component

I'm creating a .net Webtest Custom Extraction Rule. I want my users to be able to select an enum value from a dropdown list in the Property Edit view in Visual Studio. I Can manage to customize the DisplayName,Description,DefaultValues of integer/string properties without problem. However I can't manage to make ENUM values appear in the...

Executing VBSCript in COM dll using .Net and Interop

I have a VB6 application that I am converting to .Net in phases. The current phase requires .net to make a call to a VB6 dll through interop to execute VBScript using the MS Script control. Other than the process being "convoluted" are there any known issues with this setup? Sometimes nothing is executed or I get an error "Attempted to...

Consuming .Net web service from PHP - how to debug

I'm using PHP5 integrated SOAP Client. My web service method accepts around 30 parameters from string and int to bool and double. Upon calling the method I get the following error: Fatal error: Uncaught SoapFault exception: [soap:Client] Server was unable to read request. ---> There is an error in XML document (3, 983). --...

.Net User Control Interface

I have a very basic application that has buttons in a toolstrip. When a button is clicked it adds the appropriate User Control to my List<Control>. I then loop through that list creating either TabPages or mdi forms, with the user controls as children. I created an interface for these user controls so that I can ensure that they contain ...

Async Method calls calling Sync method call

I'm developing a thread safe class and I want to wrap async method call around a sync method call. Maybe I'm not looking for a definition of "asynccall" method, but something close to it. When calling AsyncToStartSearchPage() on the instance, I want the calling thread to block until the new thread obtains the lock on the object. That'...

In C# adding SelectMany extends linq to a new monad type, how do I do the same thing in VB.net?

An old Yet Another Language Geek blog post explaining monads describes adding a SelectMany extension method to C# in order to extend the linq syntax to new types. I've tried it in C# and it works. I did a straight conversion to VB.net and it doesn't work. Does anyone know if VB.net supports this feature or how to use it? Here is the C#...

Silverlight combo box with 1000 values.

I am having a sample Silverlight app that contains a combo box with thousands of values(~4000). The values are pulled from the web service and populated currently, which takes a lot of time and renders the UI unresponsive. The use case: - A field in the UI needs to be populated by the user - The field can have only certain predefined va...

Is it possible to wrap a .net Stream as an stl std::ostream*?

I have an unmanaged c++ library that outputs text to an std::ostream*. I call this from a managed c++ wrapper that is used by a c# library. Currently I pass the unmanaged code a pointer to a std::stringstream and then later call System.String(stringstream.str().c_str()) to copy my unmanaged buffer back into a .net friendly string. Is ...

.NET Configuration File Cache

I thought that .NET updates its cache every time the source configuration file gets updated without having to restart the application domain. I realize it doesn't. Or am I missing something? ...

Is there a performance difference by excluding an 'Else' clause?

Is there a performance difference between the following two pieces of code? if (myCondition) { return "returnVal1"; } return "returnVal2" and if (myCondition) { return "returnVal1"; } else { return "returnVal2"; } My gut feeling is that the compiler should optimize for this and there shouldn't be a difference, but I...

ClickOnce deployment location

Hi, We have some special requirements: From our application, launch a ClickOnce application. It will download ClickOnce app to user's cache. After it's done, the main app needs to access some file downloaded into ClickOnce app folder. Is there any way for the main app to know the location of ClickOnce installation folder? Thanks, y...

How do I Iterate controls in a windows form app?

SO this is a dumb question. I have added a bunch of textboxes to an options dialog in an app I've written. They are named textbox1 - textbox12. Is there a way to access the the names programmatically? I'd just like to iterate over them in a for loop. Right now I am accessing each one individually (shudders!). I know this is the wrong way...

Classes in different sub-namespaces all appear at top level in WSDL

I'm creating a web service with a variety of classes, many of which can contain references to other classes. Sometimes these "sub classes" have the same name (e.g. Customer and Customer), but are actually different, so I've placed these in different namespaces (e.g. MyRoot.Sub1, MyRoot.Sub2, etc.) When I build the service, the generate...