Thursday, May 19, 2011

ASP.NET: Use sitemap to control menu in a page

While creating a web site we might have several pages and those pages might have several links in the menu. ASP.NET provides an easy way to manage this which is called sitemap. If you are looking for how to use sitemap in your application, this msdn tutorial has everything for you.

http://msdn.microsoft.com/en-us/library/ms178418.aspx

http://msdn.microsoft.com/en-us/library/ms178428.aspx


http://msdn.microsoft.com/en-us/library/aa581781.aspx

Have a look at it :)


** I believe when there are so many quality tutorials over the web, I do not really need to write one of my own unless the topic is something unique**

Tuesday, May 17, 2011

ASP.NET : Creating a Global Class

If you are wanting to create a global class in your ASP.NET application, then this is how it is done, check the following link:

http://www.dotnetperls.com/global-variables-aspnet

** I believe when there are so many quality tutorials over the web, I do not really need to write one of my own unless the topic is something unique**

Thursday, May 12, 2011

ASP.NET Gridview : Get the row number from the linkbutton in a grid cell

Hi All,

Suppose you have a link button. When you click on that, you want to navigate to a different page. Before that you want to detect which row's linkbutton has been clicked. This is how it is done:

http://forums.asp.net/t/1250848.aspx/1

** I believe when there are so many quality tutorials over the web, I do not really need to write one of my own unless the topic is something unique**

Thursday, April 28, 2011

ASP.NET: Change the default session timeout for an application.

According to MSDN, the default timeout for server session is 20 minutes. You might need t ochange it for tha sake of your application. Just make the following change in the applications root level web.config file.

<system.web>
<sessionstate timeout="30">
</system.web>

ASP.NET: Automatic redirect to login page after session expires

If you want to automatically redirect to a page as the session expires, this is how you can do it:

Just check the session's existance. If it is no more in the server , then redirect to the desired page. The code snippet is as follows:

if (Session["session_name"] == null)
{
Response.Redirect("the_page_you_want_to_redirect_to.aspx");
}

ASP.NET: Sending an email from application.

Hi!

If you are looking to send an email from your application, ASP.NET has a very easy way to do that. The details can be found under this link:

http://msdn.microsoft.com/en-us/library/5k0ddab0.aspx

** I believe when there are so many quality tutorials over the web, I do not really need to write one of my own unless the topic is something unique**

Monday, March 7, 2011

.NETand Java: Dictionary Object in both platforms.

While coding, we often feel the need for getting a value depending upon a key value. This can be accomplished through dictionary object. Thankfully C# came with dictionary object. A small example on how to use dictionary object can be found here:

http://www.dotnetperls.com/dictionary-keys


I searched through Java. They had this dictionary object before, but they have deprecated it for some reason. They have recommended using MAP object which works pretty much the same way a dictionary object works. A quick code snippet to know how Java Map object works can be found here:

http://www.easywayserver.com/blog/java-map-example/


** I believe when there are so many quality tutorials over the web, I do not really need to write one of my own unless the topic is something unique**