Tuesday, March 31, 2009
SessionID changes with every request in the asp.net 2.0 application
According to MSDN the reason/solution is:
"When using cookie-based session state, ASP.NET does not allocate storage for session data until the Session object is used. As a result, a new session ID is generated for each page request until the session object is accessed. If your application requires a static session ID for the entire session, you can either implement the Session_Start method in the application's Global.asax file and store data in the Session object to fix the session ID, or you can use code in another part of your application to explicitly store data in the Session object."
Click here to view the article.
Enojy...
Exploring session in ASP.NET
Enjoy.....
Monday, March 23, 2009
showModalDialog and postbacks in ASP.NET
Finally I found a solution which is very simple by just including the below tag in the section of the modal Window.
<base target="”_self”/">
And also we need to set the output cache property to “1″ otherwise next time when you try to open the modal window, it will take it from cache.
<%@ OutputCache Duration=”1″ VaryByParam=”none”%>
Enjoy..
Friday, March 06, 2009
Visual studio keyboard shortcuts
Monday, February 09, 2009
ASP.NET Best Practices for High Performance Applications
Hi All,
I found some great articles on Best pracites and improving the performance of ASP.NET application. Check out these great articles.
Enjoy....
Sunday, February 08, 2009
SubmitDisabledControls - A New Property in ASP.NET 2.0
In one of my previous post, I blogged about ReadOnly and Enabled property of TextBox, One of the issues with disabled controls is that if controls are marked disabled on the client-side, the values are not posted back and therefore any changes are lost from the previous visit.
ASP.NET 2.0 add a new property “submitdisabledcontrols ” to HTMLForm Class, that when set to true will submit the disabled controls to the server also.
Enjoy…
ReadOnly and Enabled property of TextBox
One of thing about textbox that confuses me is the Enabled and ReadOnly Property. Both the property makes the text content non editable but there are couple of differences in the way they work. Here they are:-
Difference No. 1
When we use Enabled Property to false, Textbox’s text is grayed out and we cannot focus on the control and when we use ReadOnly property to true then you will see that the textbox’s content is not grayed out but the content is non editable.
Difference No. 2
When Enabled = “false” is used, control renders the HTML element as disabled=”disabled” and in case of ReadOnly=”true” then the HTML element is readonly=”readonly”.
I have read on some blogs that disabled controls values are not sent back to the server on postback but that’s not true. If you have disabled any control on client side then only its value will not be sent back to the server. Disabling on client side means either through JavaScript or by adding attributes to the control like
txt.Attributes.Add(”disabled”, “disabled”);
Enjoy…