May 21, 2012

Change Page Title dynamically in ASP.NET using C#

I din't have fixed Page Titles ,I needed to add them dynamically after fetching from DB.

First I used below code to add Page Title dynamically .
  
// Response.Write("<title>" + ds.Tables[0].Rows[0][1].ToString() + "</title>");

This worked in Google Chrome , but not in IE , I looked into Page Source and the title was being added on the top before <html> tag. this was the problem IE was not letting it work .

then below code worked well to add title dynamically in all the browsers

Page.Title = ds.Tables[0].Rows[0][1].ToString();

May 16, 2012

The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))

I got below  error while running a live application on godaddy shared hosting server, Couldn't figure what the exact problem was , But I Republished the  Application on Local Machine and Replaced the 'bin' folder of Live App on Hosting with this Republished 'bin' folder .
and the problem was resolved.


The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))