Fix : CSS background image not appearing in IE 8 and lower versions

by Sumant 16. December 2011 11:34
Older versions of Internet Explorer, older to IE 9, ignore the background clause if there is no leading space given to ‘no-repeat’. [More]
Share   

Tags: ,

CSS | Web Development

How to remove iFrame Border in IE

by Sumant 24. October 2010 13:59
How to remove iFrame Border in IE? The solution is simple, just have to add an attribute - frameborder="0" [More]
Share   

Tags: , ,

ASP.NET | Web Development | CSS

IIS 7 migration issue: Session state can only be used when enableSessionState is set to true …

by Sumant 19. October 2010 01:31
Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the \\ section in the application configuration. [More]
Share   

Tags: , ,

.NET | ASP.NET | Web Development

PageMethods - Nightmare!

by Sumant 27. August 2008 08:52
PageMethods - Missing or Not Behaving ..? [More]
Share   

Tags: ,

.NET | AJAX | ASP.NET | Web Development

SQLDataSource : Passing Null Parameters

by Sumant 26. August 2008 13:29
How to pass NULL values to parameters while using SQLDataSource and Stored Procedures. [More]
Share   

Tags:

.NET | ASP.NET | Web Development

ASP:Image auto generates - style="border-width:0px;"

by Sumant 16. May 2008 12:17
A resolution for making asp-image border visible using css. [More]
Share   

Tags:

.NET | ASP.NET | Web Development

ThreadAbortException while using Response.End

by Sumant 26. February 2008 01:05
Whenever there is a call to Response.End() method in your ASP.NET code, and there are lines of code following this call (which we expect not to be executed), then in such a case a System.Threading.ThreadAbortException is thrown which can be caught using a try-catch block. This exception can also be thrown while calling Response.Redirect or Server.Transfer methods as they also call Response.End internally. The resolution for this issue is - Response.End : use HttpContext.Current.ApplicationInstance.CompleteRequest instead of Response.End. Response.Redirect : use the overload Response.Redirect(String url, bool endResponse) where second parameter indicates if Response.End should be called or not. Server.Transfer : use Server.Execute While the requirement can be different and you may not want to just replace Server.Transfer with Server.Execute, handling the exception is a better solution in such a case. Also, calling ApplicationInstance.CompleteRequest or Response.Redirect with endResponse set to false, will still go through the complete page and application life cycle which may be expensive. In this case as well, when you may want the execution to be aborted immediately, instead of workarounding this issue as mentioned above, handle the ThreadAbortException and let all threads be aborted immediately. This issue is documented in Microsoft's KB at http://support.microsoft.com/kb/312629/EN-US/ . It states, it applies to ASP.NET 1.0 and 1.1, but it applies to 2.0 as well. Related Articles : PRB: System.Threading.ThreadAbortException Error Message When You Use Server.Transfer in HTTPHandler in an ASP.NET Application Indepth analysis of this issue and resolution by John S. Reid
Share   

Tags: ,

ASP.NET | Web Development | .NET

Upgrading existing ASP.NET project to AJAX Enabled Web Application

by Sumant 19. October 2007 11:37
If you want to convert existing ASP.net web application to AJAX Enabled web application then it is as easy as just updating your existing project's web.config file, other than adding a new reference. But you need to take care of certain things otherwise this simple change might give you a tough time before you can actually start using new ASP.NET AJAX features in the existing application. I am assuming that you have already installed ASP.NET AJAX 1.0 extension. Following these simple steps first to add ASP.NET AJAX power to your application - Open your existing application and add a new reference to 'System.Web.Extensions' assembly.   Now create a new ASP.NET AJAX enabled web application (we will use this new project to copy new settings to existing project).   Compare new application's web.config with your existing application's web.config.   Copy all new settings that you see in new project's web.config to existing application's web.config. Now take care of certain things which might actually make your application behave weirdly while using ASP.NET AJAX features - It is very important that if your existing application is still using Legacy XHTML conformance mode, then remove this declaration from your web.config - '<xhtmlConformance mode ="Legacy"/>'   If your application pages are still using non xhtml or old html DOCTYPE declaration then change it to use XHTML 1.0 (at least transitional) by using this declaration instead - "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">"   If after doing these changes, you face some issue with intellisense in Visual Studio then you will have to change the Tag Prefix for "System.Web.Extensions" assembly from 'asp' to anything else. For this locate this line in your application's web.config - "<add tagPrefix="ajax" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>"  and replace the tagPrefix="asp" with tagPrefix="ajax" (or anything of your choice). Now instead of using <asp:ScriptManager> or <asp:UpdatePanel>, you will have to use this new prefix (like <ajax:ScriptManager>). But this hack will get back your Visual Studio's intellisense working. If after all this you are still unable to upgrade your existing ASP.NET application to ASP.NET AJAX 1.0, please feel free to write to me. :)
Share   

Tags:

ASP.NET | AJAX | Web Development | .NET

ASP:GridView - making Pager always visible

by Sumant 30. July 2007 22:54
You would have noticed this while implementing ASP.net GridView control that if the record count in the grid is lesser than the grid's page size, then the pager doesn't appear. There can be times when you want the pager to be visible all the time (like when you implement custom paging). In such a case there is no property available in the grid which can directly let you do so. But, there is a workaround to make this happen. To make this happen, you will have to do following - 1. Handle the GridView's PreRender event. 2. In the PreRender event, fetch the GridView's 'BottomPagerRow' 3. Set BottomPagerRow's 'Visible' property to 'True'. Example :
Visual Basic-Code: Making Pager Row Always Visible
Private Sub gvItems_PreRender(ByVal sender As Object, ByVal e As System.EventArgs)Handles gvItems.PreRender 


Dim gv As System.Web.UI.WebControls.GridView = CType(sender, System.Web.UI.WebControls.GridView) 


    If Not gv Is Nothing Then 


        Dim PagerRow As GridViewRow = gv.BottomPagerRow 


        If Not PagerRow Is Nothing Then 


            PagerRow.Visible = True 


        End If 


    End If 


End Sub
Thats it!
Share   

Tags:

.NET | ASP.NET | Web Development

Using a Master Page in ASP.net

by Sumant 16. June 2007 23:51
The easiest & quickest way to get on with Master Pages Creating a Master Page : Create an aspx page, as you want the basic layout to be. Add a new Master Page to your web app. Copy all code from aspx page created in step 1, exclude @Page tag Paste everything by replacing default code in MasterPage, keep @Page tag as it is Wherever you want content to appear from content pages, place a <asp:contentplaceholder> control Master page is ready now The above method helps in previewing changes easily, though a master page can be created directly without using an aspx page first, and can be previewed using a content page. Using a Master Page : Add a WebContentForm to web app. {if its a web project, you will have to select WebForm and check 'select master page' check box while adding this page.} Select the master page for this page. That's it! {If a page already exist and you want to convert it to a content page, add "MasterPageFile" attribute in @Page directive of the wannabe content page and remove all html code from this page and pace <asp:content> control and the code you want to appear in content area.}  
Share   

Tags:

.NET | ASP.NET | Web Development

© 2008 Sumant Dubey

About this blog

Absolutely technical! The posts are about concepts, tricks, articles and links on technical subjects / problems which are not very obvious to understand / resolve. Purpose is to have this as the first-aid in the time of need.

RecentComments

Disclaimer

The opinions expressed on this website are my own personal opinions and do not represent my employer's view in anyway.