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>
Thursday, April 28, 2011
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");
}
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**
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**
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**
ASP.Net : Load XML from String
If you are interested to know how to load XML from a string rather than from a file, then this tutorial says it all:
http://www.xmlplease.com/create-xml-parse#s2.
The first line is very important, don't miss 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**
http://www.xmlplease.com/create-xml-parse#s2.
The first line is very important, don't miss 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**
Friday, March 4, 2011
ASP.Net: Printing raw xml .
I was trying to print a raw xml string. Browser was omitting the xml tags at the time of display. Then I searched through the internet and found that ASP.Net has a pretty cool widget named Literal. Using this widget, it is very simple to print xml string without the xml tags omitted by the browser. Here is an example code snippet:
1) Add the literal object.
2) Then just use this literal object like a label:
Literal1.Text = XMLString;
Is not it cool!!!
1) Add the literal object.
2) Then just use this literal object like a label:
Literal1.Text = XMLString;
Is not it cool!!!
Thursday, March 3, 2011
ASP.net : Post data to another page programmatically without a form submit button.
I was working on a project where I had to pass some value securely to a php script from an ASP.NET page. I found that .NET web request and web response class is there to do this task. Here is the MSDN provided tutorial on how to use these two classes to sent the data through post method and get the response.
http://msdn.microsoft.com/en-us/library/debx8sh9.aspx
In the receiving page, I need to write the data through Response.write (for ASP.net) or echo(for php). The response is automatically sent to the requesting page.
Is not it cool!!
** 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**
http://msdn.microsoft.com/en-us/library/debx8sh9.aspx
In the receiving page, I need to write the data through Response.write (for ASP.net) or echo(for php). The response is automatically sent to the requesting page.
Is not it cool!!
** 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**
Subscribe to:
Posts (Atom)