.net-3.5

Sending Client Certificate in HttpWebRequest

I am trying to pass a client certificate to a server using the code below however I still revive the HTTP Error 403.7 - Forbidden: SSL client certificate is required. What are the possible reasons the HttpWebRequest would not send the client certificate? var clientCertificate = new X509Certificate2( @"C:\Development\TestClient.pfx", "...

How to replace tokens in the master page in asp.net mvc?

I have a master page in my asp.net MVC project, which has code like this: <div id="menu"> <ul> <li><a href="#" class="current">home</a></li> <li><a href="#">add image</a></li> <li><a href="#">contact</a></li> </ul> </div> Depending on what page I am on, I'd like to move the c...

How to conditionally add a bit of CSS to a page in ASP.NET MVC?

I have a CSS stylesheet defined in the Master Page of my project. On one of the pages/views that inherits from the Master Page, I need to add another CSS stylesheet (I could also add it inline, though I'd rather not). However, how to do this escapes me. Is this even possible? ...

How to generate just the URL of the Controller method in ASP.NET MVC

So Html.ActionLink("Report", "SendMail", "Misc", new { id = Model.ImageID }, null) will generate a nicely formatted link. <a href="http://localhost:3224/Misc/SendMail/5"&gt;Send Mail</a> How can I generate just the URL of the link, short of parsing the output of Html.ActionLink? ...

How to handle relative paths in ASP.NET MVC?

I have a master page which references a style in the following manner: <link rel="stylesheet" type="text/css" href="../../Content/Style.css" /> All my pages inherit from this master page. And this works well when the URL is http://www.domain.com/home/details/5, however the URL is http://www.domain.com/home/create, then, of course, St...

How can I schedule tasks in a WinForms app?

QUESTION: How can I schedule tasks in a WinForms app? That is either (a) what is the best approach / .NET classes/methods to use of (b) if there is an open source component that does this well which one would be recommended. BACKGROUND: Winforms app (.NET v3.5, C#, VS2008) I'm assuming I will run the winforms application always, an...

Where do I find a list of changes and bug fixes for .Net classes from 3.5 -> 4.0?

I'm having trouble finding a list of the changes and bug fixes that have been made in the .Net framework for .Net 4.0. They're not easy to find, but surely they exist somewhere? Specifically I want to find out what changes and updates have been made for System.Net.HttpWebRequest and System.Net.CookieContainer, as both are quite bugridde...

WPF ToolBar: how to remove grip (dots on the left)

I use ToolBar for my WPF application. As I understand, there is no easy way to make it floating. I just want to remove element which I don't want to be displayed: several dots in the left side of ToolBar. Is there any Properties to customize view of ToolBar? Or, maybe, it's possible to redefine a ToolBar Template? ...

When can a == b be false and a.Equals(b) true?

I ran into this situation today. I have an object which I'm testing for equality; the Create() method returns a subclass implementation of MyObject. MyObject a = MyObject.Create(); MyObject b = MyObject.Create(); a == b; // is false a.Equals(b); // is true Note I have also over-ridden Equals() in the subclass implementation, which...

.NET 3.5: Dynamically adding classes without recompiling

I'd like to build an infrastructure that will monitor a server and check ping, response time, and more. The catch is that future checks (for example: does a certain file exist) will be added without recompiling the infrastructure. How do I build it in such a way that will enable me to attach inherited classes with different functional...

Databinding problem in dropdownlist box by generics in C#

I want to implement stack in my program by Genericx. I have a textbox and button to add elements in stack, a dropdownlist box and a button to bind total stack in dropdownlist box. I have generic class and the code is below: [Serializable] public class myGenClass<T> { private T[] _elements; private int _pointer; public myGe...

We are using EntityFrame work in a singleton class ? - Not reflecting the DataBase changes in the front End

Our application is using Entity Framework(.net 3.5) and singleton . When i update in the back end through procedure. It is not reflecting in the entity context. I tried with refresh - But it is not refreshing Foreign Key. How to refresh the entire context in Entity Framework ? ...

Using EF 4 on .NET 3.5 SP1

Hi guys, I was using the latest EF 4 bits in Visual Studio 2010 RC and have fallen in love with it. However, I have to develop a small web application using .NET 3.5 SP1 (VS 2008) for work... I was wondering if it was possible to somehow utilize EF 4 in .NET 3.5 SP1/VS 2008. Regards, Karan Misra ...

Download binary file From SQL Server 2000

I inserted binary files (images, PDF, videos..) and I want to retrieve this file to download it. I used generic handler page as this public void ProcessRequest (HttpContext context) { using (System.Data.SqlClient.SqlConnection con = Connection.GetConnection()) { String Sql = "Select BinaryData From ProductsDownload Wher...

How to get files from a device using USB

Im writing a WPF application that wants to get access to a digital camera, and have been madly Googling around for solutions and Im pretty happy with how its all going. This is what I have at the moment: private const decimal WM_DEVICECHANGE = 0x0219; private const int DBT_DEVTYP_HANDLE = 6; private const int DBT_DEVNODES_C...

The command "".\Bin\mt.exe" -nologo -manifest ... exited with error code 3 in CCNET

I am trying to build my VS 2008 project in CCNEt and getting the below error <message level="high"><![CDATA[".\Bin\mt.exe" -nologo -manifest "C:\MyProject\MyFile.exe.manifest" -outputresource:"C:\MyProject\bin\Release\MyFile.exe;#1"]]></message> <message level="high"><![CDATA[The system cannot find the path specified.]]></message> <e...

Localize node texts in treeview using resource files

For a project I need a tree view that allows the user to select a module, which then is displayed in a content area. The project relies heavily on localization and this is provided by the resource files. Now I discovered today, that the text that are assigned to preset tree view nodes are not contained in the resource files. So the q...

Dependent properties

Hi I am new to WPF.. Can anyone tell.. What exactly the depentent properties means?.. How it differ from normal properties??? and can i edit the design page in asp 3.5 while am i running the application, because the same is possible in asp 2.0. ...

Check if any item in a list matches any item in another list

A coleague asked me to write a one-liner to replace the following method: public static bool IsResourceAvailableToUser(IEnumerable<string> resourceRoles, IEnumerable<string> userRoles) { foreach (var userRole in userRoles) foreach (var resourceRole in resourceRoles) if (resourceRole == userRole) r...

Is there a declarative way to force a set of Buttons to be the same size?

I'm writing a form in XAML that has multiple buttons with content of different sizes (ie "OK" and "Save As...") Ideally, I'd like them all to be the smallest size possible to hold the largest content. In the example above, both buttons would be the width necessary to hold "Save As..." plus the margins and padding. If they were Grid cell...