How to correctly use sitemap for top/left menus

Introduction

With this article i am trying to provide some guidelines on how to correctly use asp.net sitemaps to create menus. We will be covering following points in this article

  1. What are sitemaps?
  2. Why sitemaps are useful ?
  3. Sitemap in asp.net
  4. Using more than one sitemap
  5. Using Sitemap to create Menus
  6. Creating Left Menu using the child nodes of sitemap

What are sitemaps ?

sitemap

Sitemap is basically a structure that tells about a hierarchy. Imagine your grand dad. He has two children. And there children have two more out of which you are one. So if some  one draw this simply on a paper joining every person in order as i mentioned, you will basically form a family tree. This representation we basically call as a sitemap...

Read More

Buttons are not performing postback

asp.net

I am clicking the button, everything is set, runat server is there, id is there but still, the button just dont postback. Many times we do face this problem, specially with the newbies. Sometimes our page becomes so complex or say so distributed that you may get stick with failure of postback of one or more buttons.
80% of the time the problem will lies with the validators. If you dont define the validation group property for a section, each and every button on the page, whether it sits on master page or child page, will stop the click of buttons. Also we do copy paste the code many times from one page to another. Make sure that the validationgroup property is correctly set.
Important thing to note here is do not stop yourself from searching the issue in just the part you are working in i...

Read More

Using PushSharp to send notifications to iOS and Android devices

libraries and 3rd party tools

This article simply put forth the straight forward answer for how to send push notifications to iOS and android devices using PushSharp. To download dll and for raw information visit https://github.com/Redth/PushSharp.

Let me set the stage first. You have an page where the admin will write some message, on submit you require to push this message to all your ios and android subscribers. For this purpose i am using using pushsharp that i have successfully used many times. I take no credit in developing this library but i am merely trying to assemble things for ready to use.

Lets start.

Step 1 : Add namespaces

using PushSharp;
using PushSharp.Android;
using PushSharp.Apple;
using PushSharp.Core;

Step 2  : Getting the events ready

//Currently it will raise only for android devices
   ...
Read More

How to logout in asp.net application with session – abandon, clear or remove

asp.net

This is a basic question that should be clear in mind of every asp.net developer. Though this thing has been answered in many places, but i didnot found the collective ans that easily. I will try below to make the things simple and clear.

Normally when we store the session value for user we do some thing like this

Session.Add(“User”,Customer)

User becomes the key for storing session and Customer class object becomes the value. This is just an expample as we all know that you can know you can store any type, content, value with a key in a session(Note that there are certain good practices or key pointers on what kind of data should be stored in session, will cover that in a seperate article later)

What this statement does is, it adds a session variable with key value pair and you depend on ...

Read More

Base css for Devexpress GRIDVIEW for ASP.NET for download

DevExpressLogo

I saw many people crying over stylesheet of DevExpress gridview for asp.net. I am not doing anything special here. Just pasting here the base css for devexpress gridview , modifying which you can control the styling of your gridview. Download it from  here or copy from below
[cc escaped="true" nowrap="false"]

.dxgvControl,
.dxgvDisabled
{
border: Solid 1px #9F9F9F;
font: 11px Tahoma;
background-color: #F2F2F2;
color: Black;
cursor: default;
}
.dxgvDisabled
{
color: Gray;
}
.dxgvControl a
{
color: #5555FF;
}
.dxgvDisabled a
{
color: Gray;
}
.dxgvLoadingPanel
{
border: solid 1px #9F9F9F;
background-color: #E3E3E1;
font: 9pt Tahoma;
color: #303030;
}
.dxgvLoadingPanel td
{
white-space: nowrap;
text-align: center;
padding: 12px;
}
.dxgvLoadingPanelStatusBar
{
background-color: Transparent;
fo...

Read More

Classic problem between developers and UI designers

asp.net

As a developer, you must have faced a classical issue, the UI guy says “dude the control that you have used got converted into table (<tr><td>) structure and it has screwed up my entire styling/css, i have to do a rework”. And the timeline has to be extended. This is a classic problem when we work in group, startup or as a freelancer. In big companies there a specialist to create asp.net UI, but at smaller scale becomes very crucial.

My suggestion to developers and designers, that dont hate .net in terms of UI. You are already provided with lots of setting with each control. Some examples are as below

1. Radio button list and checkbox list :
repeat layout : table, flow , unordered list, unordered list
repeatDirection: horizontal or vertical
repeatcolumns : enter the number :)

2...

Read More

Why my event is not firing on click of controls

asp.net

Many a times this happens that we get stuck in issues for hours and later we realize how stupid that problem was. I am aiming this blog to cater these kinds of issues only. There is nothing new that you will learn here. But it might happen you are also stuck with some similar problem and help you get out of the struggle.
“Why the hell my event is not firing when I have done everything right”……. Classic problem which i have faced many times in my early days and now I find new guys babbling about the same. Most of the time the culprit is the Page Load event. After all this event is heavily bombarded with call to many initializations, methods, events, binding and god knows what. Just look for the following traps

  1. Look out for “if(!Page.IsPostBack)”
    Aahha you missed that right? Whether you are...
Read More