.net

Why does not specifying view name cause my unit test to fail?

In my unit tests, I find that when I return from a controller action using View() with no view name, ViewResult.ViewName is set to string.Empty. In order for this to be set, it has to be specified as a parameter to the View() call. For example, given the following unit test: [TextFixture] public class MyControllerTests { [Test] ...

.net javascript master pages garbling element name is there a way around it?

Possible Duplicate: Any way to prevent master pages from changing element IDs? Hi I have a .net 2.0 web page that is using a master page. On the page in question is a form and I am trying to call one of the sub element. The form element name is: "contact_label" - its an asp:Label But when I look at the source I am getting ...

How do I match the last character in an arbitrary string using C# Regexes?

The obvious attempt is: Regex.Replace(input, @".$", "X", RegexOptions.Singleline); This doesn't always work though. Consider the string \r\n\r\n - the above produces the surprising result of \r\nXX. One might expect from reading MSDN (under Multiline) that $ should match just at the end of the entire string, but apparently $ actually ...

HttpWebRequest does not include "Pragma: no-cache" header when doing a POST

I'm using an HttpWebRequest that has a CachePolicy of HttpRequestCacheLevel.Reload. When doing a GET the "Pragma: no-cache" header is in the request (as tracked through Fiddler). But when doing the exact same request using a POST then the "Pragma: no-cache" header is not included. Is there a reason for this? Is it a bug? And is there a ...

Simple Webmethod times out

I have a very simple Webmethod (asmx) that creates a file. For some reason, it times out. When I step through the code, the code that creates the file takes < 1 second, but when I get to the last line of the method, it times out. Any reason why this might be happening? I use System.Speech in the webmethod. [WebMethod] public void Synth...

API's to extract 7z files in .net

Is there any API available, that can be used in .net that can read/extract 7z files ? ...

C# Image Gallery - Image Button Not Showing

Hey Guys, I'm making a C# image gallery for a website (I know there's many free ones out there, but I want the experience). I'm grabbing files from a directory on the website by storing them in a array. protected void Page_Load(object sender, EventArgs e) { string[] files = null; files = Directory.GetFiles(Server....

ReportViewer pdf export with embeded font

Is there any way to include an embedded font with a pdf export from the .NET report viewer control? ...

Should I start on ASP.NET MVC 1 or MVC 2 Beta?

I'm just starting to get into ASP.NET MVC, and saw today that the Beta of version 2 has been released. Should I start on MVC 1 given that there are already a lot of great resources and tutorials? Or should I go straight to MVC 2 to take advantage of whatever improvements have been made? I'm thinking about breaking this into another qu...

How to set the publisher in .Net msi installer

dear all , I created an installer in .Net , when i run that Installer (.msi) on windows 7, it show a popup unsecured publisher do you want to continue. How can i set the publisher. Kindly help. thanks ...

How do I deploy two ClickOnce versions simultaneously?

I would like the ability to have a test ClickOnce server for my applications where users can run both the production version and the test version in paralell. Is this possible? I first tried using the following in AssemblyInfo.cs and also changing the name in the ClickOnce deployment though all this achieved was overwriting the users pr...

What issues should I expect when porting an application from Genuine Channels to WCF

Genuine Channels is a set of 3rd party chancels for .Net Remoting. I have been given the tasks of replace the usages of .Net Remoting in a rick client and server with WCF. I am familiar with standard .net remoting but not Genuine Channels. So what problems should I expect and any pointers to the solutions? ...

ComboBox not populating correctly.

I use following code to populate a Combo Box. It displays: System.Data.DataRowView instead of the actual column values in it. What I am missing? string Query = "SELECT institutename FROM institutemaster"; DataSet ds = new DataSet(); MySqlDataAdapter da = new MySqlDataAdapter(Query, ConnectionClass.CN); da...

How to set the keyboardfocus to a textbox inside a UserControl programmatically?

I have a UserControl that incorporates a textbox. I want to set the keyboardfocus to this textbox programmatically when the user clicks a button. I tried this: private void Button_Click(object sender,EventArgs e) { Keyboard.Focus(MyUserControl); } no luck. Then I exposed the Textbox in the UserControl though a property of type TextB...

How memory is allocated to reference types in C#?

Hi I have some doubts in the memory allocation of the reference types.Please clarify my questions that are commented in between the code below. class Program { static void Main(string[] args) { testclass objtestclass1 = new testclass(); testclass objtestclass2 = new testclass(); ...

Disable StyleCop for specific lines

We're using StyleCop in our C# projects. In some cases we'd like to avoid the rules though. I know you can add // <auto-generated /> in the beginning of the file to make StyleCop ignore it. However, I don't want to ignore the rules for the whole file - only a block of code within it. Can I disable StyleCop for specific lines somehow? ...

Sharing components in .NET platform

Hi! I have an e-commerce website that is already up and running for some time. It's built on .NET 3.5. So far, so good. The "problem" is that now I need to start sharing functionality (products list, order mechanics, customer information, etc) from this project with new projects and external vendors. Since I know the thing is gonna be ...

Deploying using Setup project with update functionality of ClickOnce

Hi, I want to deploy a wpf client appllication, I need to allow the user to choose a directory for the install, eg. c:\program files\myapp. Unable to do this with clickonce, I need to use a setup project to deploy my app. How can I have the same update functionality as a ClicOnce app in my setup project? ie Have the app check an adddres...

Distributed Computing Framework (.NET) - Specifically for CPU Instensive operations

I am currently researching the options that are available (both Open Source and Commercial) for developing a distributed application. "A distributed system consists of multiple autonomous computers that communicate through a computer network." Wikipedia The application is focused on distributing highly cpu intensive operations (as ...

Commercial .NET CSV Parser/Library

Hi Our company has pretty much banned us from using open-source libraries in our commercial products due to licensing issues. We are currently looking for a commercial .NET library that can read and parse CSV files - does anyone have any ideas ? As far as functionality goes, I really need to be able to read a CSV file into a strongly ...