Finding out if user is a member of Active Directory Group can be done using following snippet of code
Method 1: using PrincipalContext
public static bool IsGroupMember(string domain, string group, string login)
{
bool result = false;
PrincipalContext context = new PrincipalContext(ContextType.Domain, domain);
UserPrincipal userPrincipal = UserPrincipal.FindByIdentity(context, login);
...
public string aboutme {
var known = { { "C#" , "Javascript" }, { "ASP.NET", "MVC" } };
return known.ToJson();
}
Tuesday, 4 December 2012
Wednesday, 28 November 2012
Combining ASP.NET MVC + SignalR + KnockoutJs with WCF Dual HTTP service

Managing windows services for a server via a website seems like a good option instead of having to remote desktop or remote accessing services.
A simple ASP.NET website should suffice this requirement, Is that correct ?
No, here is a simple scenario to prove that.
User wants to start a windows service using the website, now there are...
Labels:
ASP.NET MVC,
KnockoutJs,
SignalR,
WCF
Tuesday, 20 November 2012
Unable to share user controls as a link between projects in ASP.NET
Sharing user control as a link between project is not advisable as per microsoft article How to: Add Existing Items to a Project. Look at note under "Adding an Existing Item as a Link" as it says
"Visual Basic Web projects, Visual C# Web projects, and other similar projects do not support links to items."
But if you still want to go with this method, then here it is how you can achieve it. Consider you have following projects...
Wednesday, 3 October 2012
DevExpress Unable to get value of the property 'usercontrol_dxcontrol_event' : object is null or undefined
I am getting "Microsoft JScript runtime error" when running web application that uses DevExpress controls.
I have got a user control hierarchy as follows:-
Default.aspx
|
-> Site.Master
|
-> LoadInvoiceTab
|
-> LoadInvoiceTabHeader
LoadInvoiceTabHeader has got some javascript code to handle client side events for DevExpress controls. script has been added...
Labels:
ASP.NET,
DevExpress
Tuesday, 25 September 2012
Measuring performance using Fiddler API

Having used Fiddler as one of the most useful tool as a developer, would it not be easy to actually use Fiddler to measure up website performance, throughput etc. Well!! FiddlerCore API can be used to achieve this. Refer to FiddlerCode API for some samples.
Pretty cool. I have been using DevExpress ASP.NET controls for quite sometime now...
Labels:
Fiddler API
Wednesday, 19 September 2012
DevExpress Input string was not in a correct format
I have started using ASP.NET DevExpress controls quite some time now. In last couple of days I have seen a strange error on pages with the following error message :
"Input string was not in a correct format"
Here is what my page consisted of a list of controls
- ASPxTextBox
- ASPxComboBox
- ASPxButton
- ASPxCallback
I want to pass the input data of ASPxTextBox & ASPxComboBox on button click to server via ASPxCallback...
Labels:
ASP.NET,
DevExpress
Wednesday, 12 September 2012
State management in ASP.NET for high availability of data
ASP.NET session is the correct answer for state management. Yes that's it developers have to just use session to maintain state ie.. any data relavant to a user's session. Ways to store session state can mainly be categorized into InProc and OutProc.
InProc
Session state stored as in-memory on the web server.
Websites running in "Inproc" mode is completely dependent on the resources of the server. Limitation for number of...
Monday, 16 July 2012
Various third party .NET Controls available on web
As of today there are many .NET controls developed for various technologies such as ASP.NET, Windows forms, HTML, Jquery, compression etc. Here are the list of controls available in detail.
Developed By
Controls for
Features
Comments
DevExpress
WinForms
ASP.NET
ASP.NET MVC
WPF
SilverLight
Windows 8
IOS
Touch Enabled Apps
Reporting
Charting
Data Grid & Rich Text Editors
Ribbon, Menu, Docking
Pivot Grid,Scheduler,...
Labels:
.NET Controls
Monday, 9 July 2012
Alert dialogue with DevExpress controls
Although DevExpress provides various set of ASP.NET control, but still sometimes all controls that are available out of the box might not be suited to what you would like to achieve. One such simple requirement is display customized alert dialog box.
Let look into detail explanation of how this can be achieved. All you need is to add ASPxPopupControl as the last element of your master page
...
Labels:
DevExpress
Display loading panel while page loads
Recently I started using DevExpress controls and am quite suppressed at how easy they are to be used. On one occasion the requirement was to show a loading text/gif until processing is completed on the server.
Here is how this can be achieved.
1. First place a "ASPxLoadingPanel" to show loading text
2. Add "ASPxCallbackPanel"
3. Add script block to show loading panel...
Labels:
DevExpress
Wednesday, 30 May 2012
DialogWidth and DialogHeight not working on chrome for showModalDialog
window.showModalDialog is ignoring dialogWidth and dialogHeight on Chrome but works fine on other browsers such as IE, firefox etc. After some tweaking I have found that dialogWidth and dialogHeight should not have "px" in the value ie.. "dialogWidth:100;dialogHeight:200" but other browsers need to have "px" such as "dialogWidth:100px;dialogHeight:200px"
Here is a simple function that can help
function ModalDialog(sURL, vArguments,...
Labels:
JavaScript
Thursday, 24 May 2012
TFS Helper package extension for Visual Studio 2010

VS2010 is well integrated to TFS and has all the features required on day to day basis. Most common feature any developer use is managing workitems. Creating work items is very easy as is copying work items, but what I need is to copy workitem between projects retaining links and attachments. I am sure this is not Ideal and against sprint...
Thursday, 3 May 2012
ASP.NET MVC login page throwing error "The resource cannot be found"

As per ASP.NET MVC getting the error message "The resource cannot be found" is as simple as verifying if the view/user control does actually exist or name of the view/user control is misspelled.
But in this case that is not the issue because the controller "AccountController" does exist and the view "Login.aspx" also does exist. So have...
Labels:
ASP.NET MVC
Tuesday, 1 May 2012
Unable to debug Visual Studio 2010 addin or suddenly stopped working

I have created a new addin for Visual Studio 2010 using standard addin template. The sample works fine, then I start making some changes and adding more dependencies. Yes got some compilation errors and have fixed them. Now after starting debugging a runtime error is thrown, so fixed that.
Now If I start debugging, the addin no longer...
Labels:
VS 2010
Sunday, 29 April 2012
Storing TFS Credentials in VS2010
Visual Studio 2010 have not got an option to store credentials of TFS login which make you really cranky at times. So to store the credentials and avoid the prompt when connecting to external TFS server please follow the steps below:-
Using windows 7
1. Go to Control Panel -> User Accounts and Family Safety -> User Accounts
2. Select "Manage your credentials"
3. Select "Add a Windows credential"
4. Specify the network...
Labels:
VS 2010
Thursday, 26 April 2012
Setting up FileZilla Server and Client for transferring files with FTP

FileZilla is a free FTP solution that allows you to setup an FTP site with in minutes. Refer to filezilla site for more details
Setting up the FileZilla Server
Installing FileZilla Server
1. Goto FileZilla Server and download the "FileZilla_Server-0_9_41.exe"
2. Run "FileZilla_Server-0_9_41.exe" and select Next
3. Choose components...
Labels:
FileZilla
Sunday, 25 March 2012
Sharing photos using SignalR

SignalR is the latest .NET library available for broadcasting data from a hub to its clients (similar to polling methods used for various sites such as facebook, twitter etc). More information about SignalR is available at signalr.net
I have tried a simple mvc application that can be used to share photos between friends which gets updated...
Labels:
SignalR,
SignalR Sample
Subscribe to:
Posts (Atom)