Category: DotNet

W

WebRequest.GetResponse() throwing SSL secure channel error

Problem Statement: WebRequest.GetResponse() is one of the most common ways we adopt to perform a HTTPWebRequest from our server side. This case was a specific one, although the error appeared to be more generic in nature. In fact it happened only in SharePoint and not in my .Net application. The error observed in the GetResponse() ...

G

Generate JSON string output in C#

This is one of the most widely used and very useful script that you could use in your web services/ WCF services/ Handlers or any place wherein you require a JSON string to be passed to the client/ consumer. We make use of the Serialize method in JavaScriptSerializer class in C# under the following namespace: ...

A

ASP .Net Performance Improvement Tips

I was just going through this site checking for Performance improvement tips in .Net Web Application, for my project. It was pretty good and useful. Check out the link below: Seven Ways To Do Performance Optimization Of An ASPNET3.5Web2.0Portal Some of them are pretty cool and there are possibilities that you might miss out on ...

_

__doPostBack and Object expected error

The best way to understand the working of the __doPostBack function is to dissect the function into small pieces and explore each piece one at a time.  Let us take a look at the function. <input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" /> <input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" /> function __doPostBack(eventTarget, eventArgument) { if (!theForm.onsubmit || (theForm.onsubmit() ...

A

ASP .Net Menu using ordered list – ul, li concept

I give a different approach to menu creation, in my ASP .Net project. The main wins being the performance and ease of use. Asp menu is pretty messy when you look at the code behind and the page size it adds. But use this concept only if performance is a critical factor. Concept: •    Use ...

H

How to determine whether Javascript is enabled?

There are a lot of approaches to this. Lets take them one at a time: Using NOSCRIPT tag: You can write a noscript tag just before your script tag to display the user a warning message. Check the code below, wherein the user will be redirected to another page if javascript is disabled: <html> <head> ...

D

Difference between Convert.ToString() and .ToString()

The main difference between these both are the fact that Convert.ToString() can handle NULL and avoid ObjectReferenceNullException, while .ToString() would break in such case. It is always good to use the Convert object than the ToString() Let's have a look into the Convert.ToString() method. Using a reflector, i got hold of the Convert object below: ...

j

jQuery not working from external js file?

I had faced this issue in one of my development projects. I used jquery lavishly in every bit of my javascript code. Since during development, i used to write the scripts in the page itself, i didn't have to bother much. But later when i decided to move the scripts to another external ".js" file, ...

.

.Net Coding Standards Part2 : Coding Practices

This post is in continuation to my previous post ".Net Coding Standards Part1 : Naming conventions and style". If you wish to go through it again, you can access it here. Here i will be taking you through some Coding practices in DotNet coding. I would request you to go through them slowly and with ...

.

.Net Coding Standards Part1 : Naming conventions and style

As .Net developers we tend to forget this key ingredient in our lives. Quite frequently, we end up in a coding mess. It would be good to take into account of coding standards before you start writing your first letter. It took me a lot to understand them. In no way you could learn them ...