.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

.NET GUI Bliss: Streamline Your Code and Simplify Localization Using an XML-Based GUI Language Parse

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

While Windows Forms in .NET has lots of cool features, if you're used to MFC, there are a couple of things you'll find missing, like doc/view, command routing, and UI update. The .NET answer to this is a code generator that writes new code for every single element. But there's a better way. In this article, Paul DiLascia shows how to develop an XML-based GUI language parser for .NET that lets you code resources, menus, toolbars, and status bars in XML instead of with procedural code. He also shows how a user interface based on XML can easily be localized using standard .NET techniques, and introduces his very own library, MotLib.NET, with lots of GUI goodies for your programming pleasure.

Paul DiLascia

MSDN Magazine November 2002

View Complete Post

More Related Resource Links

Language Localization



I want to make my website into world's different  laguages.Im very new to it .

plz help

creating a code based on the evaluation


I would like to create a simple program, like a game, but so far without any graphical interface. Only a code, supported with some numbers, so that the user will know whats going on in the background.

I was thinking of creating a racing game (like formula 1 or sometihng similar), with available data (attributes) like:

Driver: age, agility, concentration, experiance, stamina,...

Car: engine, chassis, tyres

Know Thy Code: Simplify Data Layer Unit Testing using Enterprise Services


If you want to employ unit testing and test-driven development techniques in your database application development process, you'll have different factors to consider than you do when you're not involving a database. For example, you have to maintain a consistent state within the database and be able to roll back transactions when necessary. This article shows you how to get the best of unit testing for your database apps in a safe, usable manner.

Roy Osherove

MSDN Magazine June 2005

C++: Write Faster Code with the Modern Language Features of Visual C++ 2005


The next version of Visual C++ has a new syntax that is both elegant and powerful. It has new optimization technology that has improved the speed of Microsoft. It has new compilation modes that ensure Common Language Infrastructure compliance and verifiability for the .NET Framework, and it has new models for interop. In this article Stephen Toub explains these and other improvements to Visual C++.

Stephen Toub

MSDN Magazine May 2004

Code Name WinFS: Revolutionary File Storage System Lets Users Search and Manage Files Based on Conte


One of the monumental problems organizations face today is aggregating information that's stored in disparate formats. Knowledge workers have long wanted to be able to search for content independent of format. The next version of the Windows operating system, code-named "Longhorn," boasts a new storage subsystem that makes that task easier. That subsystem, code-named "WinFS," allows the user to perform searches based on the metadata of the stored item, regardless of what type of file it is or which application created it. This article covers the basic architecture of WinFS and explains how to use the WinFS managed API.

Richard Grimes

MSDN Magazine January 2004

XSLT: Simplify Development and Maintenance of Microsoft .NET Projects with Code Generation Technique


Code generation techniques using technologies such as XSLT are playing an increasingly important part in software projects as they support the development of a rapidly maintainable code base. This article discusses some of the benefits and possible applications of code generation.To demonstrate these techniques the author develops a Web Forms application that supports the maintenance of records in a SQL Server database, using the database's own metadata to drive the generation process. The SQL Server database schema is extracted using SQLXML 3.0 data access and processed through XSLT stylesheets that generate both a database access layer and a Web Forms user interface with query and update pages.

Peter Ashley

MSDN Magazine August 2003

Security in .NET: Enforce Code Access Rights with the Common Language Runtime


Component-based software is vulnerable to attack. Large numbers of DLLs that are not tightly controlled are at the heart of the problem. Code access security in the Common Language Runtime of the Microsoft .NET Framework addresses this common security hole. In this model, the CLR acts as the traffic cop to assemblies, keeping track of where they came from and what security restraints should be placed on them. Another way the .NET Framework addresses security is by providing preexisting classes which have built-in security. These are the classes that are invoked in .NET when performing risky operations such as reading and writing files, displaying dialog boxes, and so on. Of course, if a component calls unmanaged code, it can bypass code access security measures. This article covers these and other security issues.

Keith Brown

MSDN Magazine February 2001

Beyond ASP: XML and XSL-based Solutions Simplify Your Data Presentation Layer


The combination of XML and XSL can provide a powerful alternative to ASP development. This article presents arguments for building even small-scale Internet applications on the XML model. An example written with traditional ASP programming is compared to the same example written with XML and XSL in order to show the benefits of this approach. The example is followed by nine good reasons to make the switch. These reasons include separation of presentation and data, reusability, extensibility, division of labor, enhanced testing, and legacy integration. The XML/XSL solutions described hold the promise of greater simplicity, flexibility, and durability than ASP solutions built the traditional way.

Scott Howlett and Jeff Dunmall

MSDN Magazine November 2000

Control this objectdatasource programatically from the code behind based on different button clicks

I have a page where you can search and display other data, very simple layout. 1 Gridview and 1 objectdatasource. But i have 4 possible buttons that can populate the gridview.. i would like to control my objectdatasource from the code behind based on the button you click. here is what i have right now.. but if possible, can this source not be hardcoded like this and only built in the code behind? <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="SelectDVRInfo" TypeName="DataAccessCode"> <SelectParameters> <asp:ControlParameter ControlID="ddlDVR" Name="dvrInfo" PropertyName="SelectedValue" Type="String" /> </SelectParameters> </asp:ObjectDataSource> I found this site with a solution to this persons issue, but i cant seem to get mine working this way. http://stackoverflow.com/questions/2404264/overwriting-controlparameters-of-datasources-in-code-behind I have  this as the code behind right now when you press the button.. what other parameter settings am i missing and is this the right order to populate them for the source to acknowledge my values?   ObjectDataSource1.SelectMethod = "SelectDVRInfo"; ObjectDataSource1.SelectParameters["MyParameter"]

Enable a button based on a list via code behind


I've got a ListView with textboxes inside (bound to a property) and a button behind it.

I'd like to make the button enabled only when:

1) Each TextBox is not empty (each property has got a value)

2) Each TextBox has not got errors

How can I do it via code behind?


[Sharepoint 2007]Parse error when I add code behind the page to a normal aspx page ?


Hi all,

I dont need this form to be embedded into Sharepoint. I am adding this webpage into Sharepoint because i has issues due to cross-domain permission. I cannot call refresh sharepoint from my op up window  webpage. Therefore i want to add my webpage into the same domain as sharepoint.

I have added the webpage aspx form into Sharepoint from the sharepoint designer 2007. I would like to add code behind the page too.

What i have done at the moment was to create a project in visual studio for the code behind the page. I folloed this article :



Then i have added the dll intothe bin of my sharepoint site. i have also added in webconfig the dll.

However i got the following error :

Parser Error Message: The codefile attribute on the page directive is not allowed in this page.

Source Error: 

Line 1: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="FormOragniseMeeting.aspx.cs" Inherits="FormOrganiseMeeting.FormOrganiseMeetingCodeBehind" %>
Line 2: 
Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">





Claims-based authentication w/ SP2010 Foundation and performing a web request in code


Hey all! Using VS2010 and SP2010 Foundation on Win2008R2 dev machine, the following code within a custom LDAP provider class originally worked using OOB authentication until I switched to claims-based authemtication. The purpose behind the code is to check a url for access using the existing user and return a true or false.

HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(Url);
myRequest.Method = "GET";
myRequest.UseDefaultCredentials = true;
myRequest.Timeout = 8000;
myResponse = myRequest.GetResponse();
streamReader = new StreamReader(myResponse.GetResponseStream(), System.Text.Encoding.UTF8);
string result = streamReader.ReadToEnd();

After switching to claims-based auth, I now get a 403 error in code regardless if the user has access or not. Here's the web.config:

<membership defaultProvider="i">

        <add name="i" type="Microsoft.SharePoint.Administration.Claims.SPClaimsAuthMembershipProvider, Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />

        <add name="CustomLDAPMembership" type="[custom ldap class]" server="[omitted]" port="

How to replace path in SQL script based on OS language?


I have a sql script to attach my DB as follows:


(FILENAME = 'C:\Documents and Settings\All Users\Application Data\myDB\mydb.mdf')

(FILENAME = 'C:\Documents and Settings\All Users\Application Data\myDB\mydb_log.ldf')


Now I want to run this script on a computer installed with a German OS but SQL Server installation is English. do I have to make a different script for each language replacing the DB location folder. Because 'C:\Documents and Settings\All Users\Application Data' in english is not the same in German. Is something similar to Environment.SpecialFolder.CommonApplicationData available in SQL?

How to parse html code from Webpages and password protected Webpages

Hello i am making a programme to retrieve all the links to files (ex : www.mysite/file.zip) and embedded pictures frome a webpage

I tryed 2 ways

Method 1

I started with a webbrowser control and htmldocument class. that work perfectly but the webbrowser load everything like a real web browser whereas i only need to parse the html code.

for exemple when I use my program on this web site http://www.annabella.net/music.html I can heard the background music :-/....(even if my control is Visible=false)
the webbrowser.stop() method doesnt work (doesnt stop the music)
So i have a first question

How can i use the HtmlDocument class (to parse my code) without the annoyance of the  webbrowser control (that load everything when i only need a html document) or at least sidestep the music issue :-/

Method 2
after many days diggin the web i found other way to grab html code from a page and parse it easily
I use the microsoft html library from COM and the .createDo

Hash-based Message Authentication Code in WCF 4.0 RESTful service


What is an ideal way of implementing "Hash-based Message Authentication Code" in WCF 4.0 REST, with out putting logic inside each service operation logic?  Can you give me an example of using ServiceAuthenticationManager or some kind of service behavior to accomplish this?


How to make a Bangla language based database and software ?


I want to create a software using C#.NET which is a Spell Checker for Bangla Language. For this, I need to build a database which will store the 'Bangla' words and by programming, it will check the spelling.
I also asked the same question in Codeproject.com .Anyone replied me "Make sure your database is Unicode capable and aware".So which which are Unicode Capable database.Is SQL Server?

So how can I do it?

How to simplify the code


    if ((String)e.CommandArgument == "oValue") 
                     BettingSlip_DataTable.Rows.Add(new object[] { lblTimePart.Text, lblClubName1.Text, lblClubName2.Text,  ltOValue.Text } );

                    if ((String)e.CommandArgument == "Xcolvalue")
                     BettingSlip_DataTable.Rows.Add(new object[] { lblTimePart.Text, lblClubName1.Text, lblClubName2.Text, ltXcolvalue.Text });

                    if ((String)e.CommandArgument == "2colvalue")
                     BettingSlip_DataTable.Rows.Add(new object[] { lblTimePart.Text, lblClubName1.Text, lblClubName2.Text, lt2colvalue.Text });


I want to simplify this code, so that it will be better maintained.

Currently I use three IF statements. It just did not like me.
I want to simplify the code.

In the the sentences are changing only one value: "oValue", "Xcolvalue", "2colvalue.

Is it possible to simplify the code?
I have no idea how ...

Please help

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend