Posts

Showing posts with the label AJAX

IE9 rendering issues table offset at random columns

Today while developing an ASP.NET application using AJAX to display the Search Result, I encountered a weird issue. My aspx p age contain a Repeater control with ItemTemplate to display free flow data in HTML Table .  Issue What seems to happen though, is that one or two rows in the loaded table, will have its data offset at a random column.   You can find the details of issue in following articles: http://stackoverflow.com/questions/7267014/ie9-table-has-random-rows-which-are-offset-at-random-columns http://social.msdn.microsoft.com/Forums/en-AU/iewebdevelopment/thread/28d78780-c95c-4c35-9695-237ebb912d90 Resolution The problem was with extra white space between td nodes causing IE9 render a dynamically generated table incorrectly, in my case to misalign a cell within a table.  Same code rendered perfectly fine in IE6, IE7, IE8, FireFox 4, Chrome 10, but not IE9.  Try one of the following Adding to the head element [me...

Exporting DataTable To Excel using ASP.NET

In continuation to my previous post which addressed Export to Excel issue in ASP.NET ( click here ), here is another post which is a solution for Exporting a DataTable to Excel using ASP.NET. Many times we come across scenario where we don't need to show the grid and just export data which is available in DataTable to Excel. You can use following method by passing the DataTable as parameter, which in turn export the data to Excel. I have implemented with AJAX also without any issue. Note: While using AJAX on a button click, do not forget to Add a PostBackTrigger to your UpdatePanel that points at the button, otherwise it will give "Sys.WebForms.PageRequestManagerParserErrorException"  Exception because of violation of using Response.Write bypasses the normal rendering of ASP.NET control. private void ExportGridToExcel(DataTable dt) {         StringWriter strwriter = new StringWriter();         HtmlTextWriter htmlwriter = new HtmlTe...