Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))


Error in Application.

Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))



From error it’s look like Program which you are trying to access
either not registered nor properly installed on machine.

You can repair this program and try once again.

If this program is not register you can register it via Regsvr32.exe.

Other problem may be you are trying to use 32-bit dll in the 64 bit machine. for this you have to do below setting in your visual studio.

properties -> build -> Platform Target = x86

Similar configuration you have to do in your IIS (when you deploy your application. 
In IIS we have setting to run 32 bit application on 64 bit machine.)

Let me know if your problem still not resolved.

Enjoy !!!!!!!!

Posted in | 0 comments

Redirect website into IFrame.


Below is code to redirect website url to IFrame.

Add IFrame in webpage.

<iframe id="IframeID" runat="server" height="100" width="100"></iframe>

Here note that we have frame with runat="server" attribute. so we can use from code behind.

IframeID.Attributes.Add("src", "");


Posted in | 0 comments

Session state has created a session id, but cannot save it because the response was already flushed by the application.

This happens because sometimes (depending on the web.config configuration) the SessionID is not set in the cookie when Session_Start event executes in the global asax.

You encounter this error because at somepoint in the pagelifecycle a variable is set in the session. after the request ends, ASP.NET tries to set the SessionID too, but if the Request was flused 
(eg. this can be done by Response.Write or AJAX itself flushes the response) this exception will be thrown.

Add following code in the global.asax file:

      void Session_Start(object sender, EventArgs e) 
          string sessionId = Session.SessionID;
 //This code run when new session is started.

Posted in | 0 comments