May 2008 - Posts

0
Comments

ParseChildren in Templated Controls by zhirani

Well, I have been spending sometime learning about Templated controls at work. Hence I am slowly getting an understanding of common attributes that you would want to use on Templated controls. If your template control inherits from WebControl than you...
0
Comments

Instantiating Templates by zhirani

I thought to write a blog post telling what is the correct way to instantiate templates because on researching many blog posts and reading few articles, I saw couple of different usages and one of them is misleading and incorrect. Here is the most common...
4
Comments

Use TemplateInstance.Single to avoid FindControls by zhirani

If you have created templated controls, you would be aware that it requires you to implement INamingContainer. Only job of INamingContainer is to ensure that controls are unique within that Naming Container. However sometimes if you are using Templated...
0
Comments

When to instantiate templates by zhirani

Most of the examples that I saw on the net recommended to instantiate templates inside of CreateChildControls method but it does not work correctly. Basically I marked my Itemplate property to TemplateInstance.Single, so all the controls inside my template...
0
Comments

Using Pragma to disable warnings by zhirani

Lot of times, you have variables declared in your class that are never getting used directly and are accessed and their values altered using reflection. In those cases when you build you solution you get a warning saying that this particular field is...
3
Comments

Global Namespace in C# by zhirani

By default if you do not specify a namespace for a class it will go to default namespace. What happens When you are in particular namespace that has the same class that is also available in default namespace. How do you access the class that is available...
0
Comments

Callbacks in Asp.net Ajax by zhirani

Callbacks provide an ability to call a function passing in additional parameters that your function would need. In the past to achieve this objective, I have created global variables that can be referenced from any where in your code. . Instead using...
0
Comments

Moving Divs on the page by zhirani

Today I had a need to move my progress bar control on top of any control that was being updated asynchronously. Therefore I had to reposition my progress bar when an update happened. This lead me to investigate asp.net Ajax client side library and see...
6
Comments

Prevent Enter Key using Asp.net Ajax by zhirani

Today at work, I had a requirement where I had to prevent user from pressing enter key when they are on a particular textbox because it would cause the page to postback which I wanted to prevent. Using asp.net Ajax, you can register for the keypress event...
0
Comments

Debug Vs Release Version of JavaScript file by zhirani

When you are debugging application it is easier to work with debug version of js file because the code is indented and comments provide better readability. However when deploying it production debugs version would increase the load time of the page. ScriptManager...
More Posts Next page »