Lets Have a fun with Technology.

BTemplates.com

Follow by Email

Thursday, April 30, 2009

How to restrict a user getting access to pages after logout


Problem :- How to restrict a user getting access to pages after logout

Solution :-

First Solution :-

You need to stop the browser from caching your pages,
place the following code in the Page_Load function of any page that you want to prevent the browse from caching it.

Response.Cache.SetCacheability(HttpCacheability.NoCache);

If you are using Master pages then u can also put this code in master
So each page can not access after logout.

Second Solution :-

if you are using Session in application then call abondon metohd for Session Destroy and then Redirect to login Page.Check Session in Master Pages if It's Not Exists then u can redirect user to other Page.


But First One is good One for this.

Failed to access IIS metabase.


Problem 

Failed to access IIS metabase.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase.

The process account used to run ASP.NET must have read access to the IIS metabase (e.g. IIS://servername/W3SVC). For information on modifying metabase permissions, please see http://support.microsoft.com/?kbid=267904.
Solution :-
This Error Caused Because You Not Have Register ASP.Net with IIS.Please Follow Following Step to Regiser ASP.Net With IIS.
-> Go to Start - >  Run -> Cmd.

-> GO to Your System Drive Mostly C Drive.

-> Type C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -i
Just wait And Message comes Successfully Register.

Prev Post                                                      All Post                                                           Next Post

Wednesday, April 29, 2009

It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level


Problem :-  It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level

 

Solution :- There Are Mainly One of the Two Reason Why you Got this Error Message.

1.   If you Have Not configured your asp.net application in IIS.  If you have not Configure your application to run on IIS First Configure your Site to Run on IIS.For that Create Virtual Directory From IIS and Give Permission to Application (Read,Write)

 

2. If Above is Not Problem Then There are Mainly Problem of Two or many Web.Config Exists on your Site.When you Open Some Site and if Software Crate Backup of that Application then Software mainly Do Create Subfolder and Copy All Files + Web.Config in Application.Just Remove this Subfolder web.config from Subfolder. 

 

Let me Know if You Know Anything More or want to Know More .....

 . 

 

Prev Post                    All Post                           Next Post

Tuesday, April 7, 2009

DataBinding Method Such as Eval(),XPath(), and Bind() can Only be used in the Context of a databound Control.


 
Problem: - DataBinding Method Such as Eval(),XPath(), and Bind() can Only be used in the Context of a databound Control.

Solution :-   Use  DataBinder.Eval(Container.DataItem,"field_name")  Method

                    Instead of  Eval(“field_name”)

Description :- 

This Error Mainly Cause Because Of using Eval(“field_name”) Method to bind Control in Grid view.  Instead of Eval Method if we use DataBinder.Eval(Container.DataItem,"field_name") the Error Got Solved. I am Using Grid view from Last 2 Years but never got this Error before. But One Day When I use Nested Grid view this Error throw by .Net Compiler. If there is Only One grid view then Eval method is ok. Please if you have any extra Information Comment On this. In Comment Please Write How’s u got this Error and Solution you have done for this.


Thank you.