.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Application_Error event handler

Posted By:      Posted Date: September 18, 2010    Points: 0   Category :ASP.Net
I am using Application_Error in Global.asax to capture all exceptions thrown. I log the exceptions and redirect to a single error page. Meanwhile my <customErrors> has mode="off". I believe my application is secure from showing an exception page, including a 404 error. So far, everything shows my error page. I'd like to know if the experts consider this secure.  // this is pseudo code, not the actual code of my site protected void Application_Error(Object sender, EventArgs e) { LogException(HttpContext.Current.Server.GetLastError()); HttpContext.Current.Response.Redirect("~/Error.aspx"); }  

View Complete Post

More Related Resource Links

Creating Event Handler in Code behind


Hi, so I have a control that is created in the code behind and generates fine but I can't figure out how to create an event handler for it.  I've found plenty of examples for it in C sharp, but none of them seem to apply to VB.  What I want to do is essentially this:

myDropDownList.SelectedIndexChanged = "Event to do here"

but it doesn't seem to work for me.

Any suggestions are appreciated.

want to launch modal Popup from created User Event handler




I have a create user wizard on my page and in the event handler (Created User) I get extra information from the user

via textboxes within the aspx etc.


I then do a response.redirect to another page.

What I want to happen is this


When the CreatedUser Event is fired, I  want a Modal Popup to show up with a message Processing your registration.

once the registration code is processed it will close and the users get redirected.


On my ASPX I have the Modal PopUp and a Panel.

In the code behind in the handler I put ModalPop.show()


but this does not work.


thanks for any suggestions



InfoPath Workflow Task Form "Loading" event handler only being called after App Pool recycled.


I have a Workflow that is using an InfoPath task form.  In the "FormEvents_Loading" method event handler I have some code that needs to run each time the form is opened.   I recycle the App Pool and open the form the code runs perfectly, but if I close and try to re-open the form the code is not run at all.  I can then recycle the App Pool again and on the next load the code executes just fine.   The code that is supposed to be run is a very simple statement to set a field value, so I don't think it is interfering.

Does anyone know what this might be?


Event Handler Credentials


I made EH that checks out document when OOB Approval WF is finished successfully.

I want doc to be checked out by WF Initiator, but by default it is made by System Account.

How can i change Event Handler Account ?

Pre_Init event handler problem


Hi all my friends

   I have to masterpages for my home page.

1. The first is for the annonymous users which has the login controls. its name is General_Anonymous.master.

2. The second one is for the logged in users which has a logout button and it hasn't the login controls in it. its name is General_LoggedIn.master.

in my default.aspx page I wrote the following code

protected void Page_PreInit(object sender, EventArgs e)
            if (Session["SupId"] == null && Session["CustomerId"] == null)
                this.MasterPageFile = "~/Masters/General_Anonymous.master";
                this.MasterPageFile = "~/Masters/General_LoggedIn.master";

Event Handler & AD

My event handler is working fine until i add AD part. After this string it stops firing at all: DirectoryEntry dom = new DirectoryEntry(); I mean it compiles, deploys and doesnt react to anything ( Why ? PS VS2010, SP2010  

how to get values of list item being entered in ItemAdding event handler?

Hi,          i am trying to get the values being entered in a listitem in the ItemAdding eventhandler as follows, but it doesnt work. public override void ItemAdding(SPItemEventProperties properties)         {             base.ItemAdding(properties);             SPSite CurrentSite = new SPSite("http://mm-moss/np/");             SPWeb CurrentWeb = properties.OpenWeb();             SPList CurrentList = CurrentWeb.Lists[properties.ListId];             string vehicleNo = CurrentList.Items[CurrentList.Items.Count - 1]["Vehicle No"].ToString();             string  name=CurrentList.Items[CurrentList.Items.Count-1]["Name"].ToString(); } when i debug i cant get hold of the VehicleNo value. canyone help me in getting the values of the list item being entered? Thank you all.

Create a meeting instance with an event handler

Hi, i want to know if its posible to insert a new meeting instance in a meeting workspace automatically when you add a new event in a calendar.   i try to pass automatically the option of the template selection.   its posible with the objetc model or web services?   thanks

Event handler that will take an e-mail sent to a doc library and save it as an .MSG file within the

Hi All, I have a requirement to create an event handler that will take an e-mail sent to a doc library and save it as an .MSG file within the library? Any help/inputs on getting this done is much appreciated.  Hanif

Sharepoint Event Handler not firing

I have written an event handler for an ItemAdded eventfor a document library. I am trying to read an excel file being uploaded and extract a value from it which I write to a list column for the item. I have this working properly on my development machine which is a Windows Server 2003 machine.However, on a production Windows Server 2008 machine, the event handler never fires. I am doing a simple write to a log file to test and see if it runs at all even if the Excel parsing does not work but I get no indication that it ran. The event handler is being registered with a feature that I am deploying. I have verified that the event handler is registered to the library by using the u2u Event Handler Explorer tool.Is there any way I can determine if my event handlers are even executing? How can I debug this?

ItemAdded Event Handler not firing

Hi, I have created an ItemAdded Event handler that is linked to a content type. This event handler does certain custom validations and then sends Email to users. I have referenced this event handler in XML file as well but somehow the event handler is not getting fired...Following is the code.   Code Snippet            this.DisableEventFiring();            using (SPSite site = new SPSite(properties.SiteId))            {                 using (SPWeb web = site.OpenWeb())                {                    base.ItemAdding(properties);                     SPList nList = web.Lists["NList"];                    SPList IList = web.Lists["IList"];                     foreach (SPListItem listItem in nList.Items)                    {                        if (listItem["Topic"].ToString() == properties.ListItem["Topic"].ToString())                        {                            SPUser alertUser = (SPUser)(properties.ListItem["SUser"]);                            SPUtility.SendEmail(web, false, true,alertUser.Email,"New item added", "A new item has been added");                         }                    }                    this.EnableEventFiring();                }            }       The XML file is: Code Snippet  <XmlDocuments>      <XmlDocument NamespaceURI="http://schemas.microsoft.com/

Event Handler not picking up error

I have a connection manager which uses a Variable as part of a ConnectionString. I have tried putting an Event handler on the package to capture any errors with the connection string. Unfortunately the event handler does not pick up any errors. I would like to add some screenshot but i am not sure how to do it on this forum.  Mr Shaw

Event handler to delete minor versions in document libraries

Hi Is there a way we can capture the deletion of minor versions in document libraries using any event handler. May not be using the delete all the minor versions but at least when we use the option to delete the selected minor version. I do not see the ItemUpdating and ItemUpdated getting fired in this case. Thanks wpwije  

Sequence - Container Event Handler - send one Email

I have a sequence container which contains three data flows. Have placed a event handler on the sequence container which emails me OnError. When   an error occurs i only want to get one email but I get eleven. This equals the number of tasks happening inside the sequence container. How can I get just one email? Mr Shaw

Create an Event Handler to catch calls to Create.aspx

Hi, I want to research creating an event handler/reciever to catch calls (mouse clicks) to Create.aspx to prevent users having the ability to create new content. I've noticed in VS2010 the templates for Event Recivers you do not get anything similar that I could use as a starting point (List Events, List Item Events etc) Any ideas how I can define a new type of event receiver?

Execute Javascript from Sharepoint Event Handler

Hello, I want to execute a sample java script function from itemadding event of sharepoint event handler.  How can i achieve this? Please Help.   Thanks in Advance

Generate the event handler of a control directly in the markup view ?

Hi there, I was wondering if there is a way to generate the event handler of a control directly in the markup view and not in the design view. Thanks.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend