blog
Do you know XmlDocument or XPathDocument creates an in memory representation of the entire XML document. And this typically consume memory equivalent to three or four times of the size of the XML document on disk.
On the other hand XmlTextReader, loads only 4KB (kilobyte) buffer into memory and give better performance and scalability.
The CTP1 of SmartCodeGenerator can be also downloaded from CodePlex.http://www.codeple... And the homepage for this project at Codeplex ishttp://www.codeplex.com/s... am also in the process of building the community site.http://community.smart... (very early stage) ......
Sometimes when you want to quickly tune asp.net application the following points can be checked (not in any particular order) as it requires minimal code changes to the application. 1. Analyze Database while running the application, via sql profiler. Identify which stored procedures are called and whether the database tables are properly indexed. And queries not performing Full table scan for any case. 2. Recommended Threading Settings for Reducing Contention Configuration setting Default value (.NET ......
Hi Guys I have started moving SmartCodeGenerator to CodePlexhttp://www.codeplex... For the time being please stick to the old links:Tutorials : http://www.smartcodegenerat... GotDotnet Link: http://www.gotdotnet.com/co... Myblog: http://www.geekswithblogs.n... Founder SmartCodeGeneratorShahed Khan"Code Generation has never been this easy" ......
Found these handy collection of regex expressions in this site:http://rgagnon.com/jsd... I did not test all of them though.... Use regular expressions to validate/format a stringThis is an impressive collection (that I found somehere on the Net) of various functions to validate or format string in Javascript. The code is very compact. /**************************... FILE: RegExpValidate.js DESCRIPTION: This file contains a library ......
All of the 4 Examples those will familiarize you with SmartCodeGenerator are compiled together and uploaded herehttp://www.smartcodegen... And please download the SmartCodeGenerator CommunityDrop1 from Gotdotnet ......
Download the CommunityDrop1 from here.Example 4 Generating Class from SqlServer TableSchema Step1 Opening Existing Template Open Example4 from Example_Projects folder, as a website project in Visual Studio 2005.Step2 Launching the Generator Run the project you have opened from Visual Studio 2005 and this will display the default.aspx page. Put your connection string in the connectionstring field and Click Scan Button. If the connectionstring is ok and this can connect to the database it will load ......
Example 3 Writing your First Template Objective We will write a template which will take two properties classname and propertyname and generate code like this based on the customized values entered for the properties.public class TestClass { public TestClass() { //Add constructor here } private string testproperty public string TestProperty { get { return testproperty; } set { testproperty = value; } } } Step1. Installing VS2005 Project and Item Template for SmartCodeGenerator. Make sure you copied ......
Example2: Generating Code from existing project/template. And getting familiar with the Asp.Net Profile object. Step1 Opening Existing Template, Launching and Generating Code. Open Example2 from Example_Projects folder, as a website project in Visual Studio 2005. Step2 Launching the Generator Run the project you have opened from Visual Studio 2005 and this will display the default.aspx page. Notice the property1 and the textbox to enter value. The properties lets you customize the generated code. ......
Example1 Makes you familiar with SmartCodeGenerator.Generating code from existing project/template. Step1 Opening Existing Template Open Example1 from Example_Projects folder, as a website project in Visual Studio 2005.Step2 Launching the Generator Run the project you have opened from Visual Studio 2005 and this will display the default.aspx page. Notice the property1 and the textbox to enter value. The properties lets you customize the generated code. Here we are collecting value for property1 and ......
I am very excited to share with you that I have finally released the CommunityDrop1 for SmartCodeGenerator at GotDotnet. SmartCodeGenerator is an Asp.Net2.0 website application and is a full fledged template based code generator that allows you to generate code for any text language. Templates are written in Visual Studio as asp.net UserControls. The code generation can be dynamically customised by using properties. SmartCodeGenerator Framework reads the asp.net Profile Object specified in web.config ......
I have come through lots of examples in the web using DataBinder.Eval but if we go and see whats happening under the hood, we will find Eval uses reflection to evaluate argument passed. <ItemTemplate><div... DataBinder.Eval(Container.D... %></div></ItemT... But explicit casting can reduce the cost of reflection. Imagine if there is 30 rows and each row has 6 Eval calls. So there will be calls to Eval 180 times. And we should take this pretty seriously. ......
Fiddler HTTP DebuggerHTTP debugging proxy Lutz Roeder's .NET Reflector.NET assembly browser, explorer, analyser and decompiler FxCop.NET best-practice code analyser C# Snippet CompilerLightweight C# code snippet compiler Sysinternals DebugViewMonitors debug output on a local or remote computer WinMergeVisual text file differencing and merging tool GhostDocVisual Studio add-in that automatically generates XML documentation CopySourceAsHtmlVisual Studio add-in that copies syntax-highlighted code to ......
For enabling Tracing we normally Tweak the config file right.... <configuration><sy... enabled="true" writeToDiagnosticsTrace="true" /></system.web><... But in asp.net 2.0 you can do a bit more... void Page_Load (object sender, EventArgs e){ Trace.TraceFinished += new TraceContextEventHandler (TraceHasFinished);} void TraceHasFinished (object sender, TraceContextEventArgs e) { foreach (TraceContextRecord traceContextRecord in e.TraceRecords) { ......
.Net Framework 2.0 makes life so easy with asynchronous calls from pages. I remember in asp.net1.x we had to do so much to achieve the same behaviour, but we are lucky that in asp.net2.0 its very easy. Again there are more than one ways to implement asynchronous calls in asp.net2.0 and you may be asking which pattern to use. The first way is to use the AddOnPreRenderCompleteAsync... ( new BeginEventHandler(BeginAsyn... new EndEventHandler (EndAsyncMethod) );The second ......
The assembly that is generated for .Net Framework has metadata that describes the structure of the assembly and its classes. By using reflection we can investigate the structure of classes and the data that assembly holds dynamically at runtime. Couple of days back in this project that I am working I had to dynamically get/set values from/to properties of object. The following code will give you a flavor of what I did. To Get value=============== foreach (PropertyInfo info in myObject.GetType().GetPrope... ......
Custom templates are sometimes very handy. For example if your pages are inherited from a custom base page. Normally you would have to tweak your pages to fit your framework. Sometimes its even boaring to go and change the new pages added to the project again and again. Say your framework require all pages to inherit from <YourProject.BaseClassNa... Then you have to change the codebehind of the new pages that you add to your project to something like this public partial class _Default1 : YourProject.BaseClassName ......
Asp.net 2.0 supports database cache dependencies. So changes in the Tables data can be notified and cache can expire. This is a very handy feature. Here is how we can do this <@ outputcache duration= "7200" varybyparam="CustomerID" sqldependency="DatabaseName... %> this means the cached page expires in 2 hours but also depends on database table. Any changes on the database table data will also invalidate the cache. Borrowed the following code from this link: Link to Improved Caching ......
We are aware that the complition process of Asp.Net 1.x Web page has two phases. 1. Code Behind files and other supporting classes compiled into an assembly.2. And Individual ASPX files are compiled at runtime in to temporary assemblies. This happens during the page request has been performed.So firstime when the user requests a page its slow. I have seen suggested approach like writing a precompile.aspx page which goes and fires requests [ (HttpWebResponse)myHttpWebR... ] to individual ......
Deleting duplicate rows when there is no primary key ProblemEvery once in awhile a table gets created without a primary key and duplicate records get entered. The problem gets even worse when you have two identical rows in the table and there is no way to distinguish between the two rows. So how do you delete the duplicate record? SolutionOne option that SQL Server gives you is the ability to set ROWCOUNT which limits the numbers of records affected by a command. The default value is 0 which means ......
.Net Role Checking Examples===================... following code fragments show some example role checks using programmatic,declarative, and imperative techniques. 1. Authorizing Bob to perform an operation:Note: Although you can authorize individual users, you should generally authorize based onrole membership which allows you to authorize sets of users who share the same privilegeswithin your application._ Direct user name checkGenericIdentity userIdentity = new GenericIdentity("Bob");if ......
source: http://www.aspnetpro.com/newsletterarticle/2006/10/asp200610mb_l/asp200610mb_l.asp
Working with Certificates
Create, Access, and Employ Certificates in Your Applications
By Michele Leroux Bustamante
If you havevn't seen and played with them yet... http://ajax.asp.net/ajaxtoo... can see all the following control extenders live in action:Accordion AlwaysVisibleControl Animation CascadingDropDown CollapsiblePanel ConfirmButton DragPanel DropDown (New!) DropShadow DynamicPopulate FilteredTextBox HoverMenu ModalPopup MutuallyExclusiveChe... (New!) NoBot NumericUpDown PagingBulletedList PasswordStrength PopupControl Rating ReorderList ResizableControl RoundedCorners Slider TextBoxWatermark ToggleButton ......