.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

Page_Load() events running before event methods.

Posted By:      Posted Date: September 27, 2010    Points: 0   Category :SharePoint

Iv come across this problem a few times.

As a simple example:

Why is when creating a simply Visual web part with a button onclick method, the page_load() event always fires before the event that caused the page to refresh (in this case the button onclick())?


This has become very anoying, one way iv found to over come this is to save any data i require within the application memory then reload it again within the method i activated if it exists.


This seems very time consuming.


Surely theres a way to stop this?




View Complete Post

More Related Resource Links

Event Tracing For Windows: Core Instrumentation Events in Windows 7, Part 2


In Part 2, the authors cover core OS Event Tracing for Windows (ETW) events as well as present simple scripts to demonstrate a few basic accounting techniques on some of the OS events introduced.

Alex Bendetov, Insung Park

MSDN Magazine October 2009

Event Tracing for Windows: Core Instrumentation Events in Windows 7


In the first article of a two-part series, the authors present a high-level overview of the ETW technology and core OS instrumentation.

Alex Bendetov, Insung Park

MSDN Magazine September 2009

Custom Grid View Header - Grid view Row Created event vs Gridview row databound events ?


Hi Gurus ,

It happened to add an extra Gridveiw Header in row_databound event , It did worked fine on !Postback but disappered on Page.Postback . Quick google search guided me to move the event to Row_Created event and every thing is okay .

Can any expert post some pointers , differnces between grid row_created vs row_databount with some sample table data created dynamically  behaviour of both the events in !Postback and page.Postback .

Thanks a tonne in Advance and  any inputs will be valued and appreciated .

Error while invoking wcf service and running its methods

Failed to invoke the service. Possible causes: The service is offline or inaccessible; the client-side configuration does not match the proxy; the existing proxy is invalid. Refer to the stack trace for more detail. You can try to recover by starting a new proxy, restoring to default configuration, or refreshing the service.    I am using a wcf service with some methods in it called by some layers wherein i am putting all my business logic.While invoking the service from wcftestclient  and when running few methods i am getting this error . I am getting output for some methods in the same service but for some other methods i am getting this error . I am using LINQ in the methods.    My solution has number of projects .For running the service ,i am right clicking on the project and viewing in the browser as i cannot build whole solution as i have few errors in some unit test projects.       As i am getting output for some methods ,this is definetly not about starting the service .  

Running code after site definition site creation in a event receiver or feature receiver

Hi guys I've got a site definition which is pretty much based on STS.This is it's own sharepoint project. Let's call this project SiteDefProj. Next in another SharePoint project (same solution though). Let's call this CustomListProject. In this project I've got a feature which provisions a bunch of lists based on custom content types - this feature is a site scoped. Let's call this feature: CustomListInstances. I have added a feature receiver to this feature to execute some custom code on the lists themselves (under feature activated) In my ONET.XML (part of the SiteDefProj) I have CustomListInstances feature ID as part of my <sitefeatures>. When I do a create site I can actually step through the code and see it actually being executed but after the site is created the list instances are created but it's like the code never run or did anything. The weird part is that stepping through the code while creating a site collection using my SiteDefProj the code runs great with no errors. All lists are there and the code runs smooth. If I manually create a STS site and activate my feature everything works and the code does actually run and the effects are visible after the feature is created. Again I can actually step through it in debug. My suspicion is that there's some sort of a race condition in the CREATE SITE functionality where maybe the web or site collection hol

Running async WCF methods within a WCF transaction?


Can someone please tell me what is the correct way of calling async methods from within a WCF transaction?

Normally, one would only call synchronous methods from within a WCF transaction.


Running SSIS job step as Proxy account does not find log provider for windows event log

When I run a ssis job step using a proxy account i get this error message:

Description: The log provider type "DTS.LogProviderEventLog.2" specified for log provider "SSIS log provider for Windows Event Log" is not recognized as a valid log provider type. This error occurs when an attempt is made to create a log provider for unknown log provider type. Verify the spelling in the log provider type name.  End Error  Error: 2010-02-02 14:43:03.88     Code: 0xC0010021     Source:       Description: Element "{028F8760-7E28-4F62-A204-66F33F4064BE}" does not exist in collection "LogProviders". 

If the account is a member of administrators group on the sql server the job step works fine.

Since the logprovider DTS.LogProviderEventLog.2 exists on the system I guess that this has something to do with access rights, probably to some registry key(s), but I cannot find out which part of the registry the proxy user does not have access to.

When running the same package using DTEXEC in a Command Prompt and using RUNAS <proxyuser> the package works fine and writes to the event log.

Kind regards


update 17-Feb-2010: Microsoft has reproduced this situation and I hope to get a workaround or fix soon :-

Calendar Web Part for SharePoint that displays and gives fetails of events from an event list: Value

Hi All,

         I have followed the following post to create the custom Calendat webpart, that displays the details of events from events list. 

But i am getting the following error when i click on the dates shown as there are some events. The error looks like the following,

Server Error in '/' Application.

Value does not fall within the expected range. 
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.ArgumentException: Value does not fall within the expected range.

Source Error: 

Error loading and running event receiver Microsoft.SharePoint.Workflow.SPWorkflowAutostartEventRecei


Hi all, i found the below error in event log. How can i fix this issue.

Event ID: 6875            Source: Windows SharePoint Services 3

Error loading and running event receiver Microsoft.SharePoint.Workflow.SPWorkflowAutostartEventReceiver in Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c. Additional information is below.

: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

Please help me out in this issue. Thanks in advance.


K2Blackpearl, Sharepoint, .Net

If I place an event handler on the package level will it capture all events?

If I place an event handler on the package level will it capture all events?
Mr Shaw

Import Events from Calendar Site to web part event.


Hey experts!

I'm having problem on which i want to view the events from this site navigation: Home>Calendar>Public Calendar to be appear on the Homepage. I tried to user Event web part, but the navigation is from Home > Events.

So, its difficult for my user when they have created events in the Public Calendar, and automatically can be view in the Homepage is not possible. I tried using workflow, but it does not work.

What i want is the calendar part in the Home > Calendar > Public Calendar can also be view in the Homepage. I dont mind if there is any paid web part to be use as long as it can meet my requirements.

Events and Overridden Methods


Simple Question about .Net processing:

Class A
 protected overridable Sub Method()
  Console.Writeline("Hello World")
 End Sub
End Class

Class B
 inherits A

 protected Overrides Sub Method()
  Console.writeline("GoodBye World")
 End Sub
End Class

Given the above, if you have a variable of Type A, you can assign MyVar = New B(), and you can proceed to Call MyVar.Method() which would print out in succession in the console:

Hello World

GoodBye World

Simple Class Inheritance.


Error loading and running event receiver: Object reference not set to an object instance


I'm getting the following error for my client's SharePoint production server.

Error loading and running event receiver myproject.Receivers.ListItem.ContentApprovalEventHandler in ..., Version=, Culture=neutral, PublicKeyToken=.... Additional information is below.  : Object reference not set to an object instance.    


I know there are few posts already out there explaining the problem but I've not got the one matching my situation. The event receiver is working on dev and staging server but not on production. Few points I can mention here:

1. My event receiver is not calling. I have put a log at the very beginning of the receiver and put the whole event receiver code in try/catch block. In catch block I have thrown a custom error. So if my code would be executed then the custom error would be in log file.

2. The same event receiver is working on development and staging server.

3. Production is a farm whereas dev and staging server is standalone.

4. The production farm has two severs one of which is not configured properly.

5. I have tested with code and made sure the event receiver is registered with the list.


Apparently the problem might be permission/configuration related. Does anyone have any idea what might be the cause?


Making google like event calendar and add events to database in asp.net


Hello everyone,


I need to make google like event calendar in asp.net with + (plus) i need that event generated on the calendar to be stored in the database also.

my database is SQL.

I need it very urgently , please help me out.


Thanks & Regards,

Krunal Panchal

SQL 2000 server has an issue after an unidentifed event and began running at a snails pace.


One of our SQL 2000 servers has an issue after an unidentifed event and began running at a snails pace.

     I know SQL 2000 is no longer supported.

We are running IIS on the same server and no connection can be made to the SQL server on the same machine.

     Microsoft OLE DB Provider for ODBC Drivers error '80004005'

     Specifed driver could not be loaded due to system error 5 (SQL Server).

A std query from outside the server works fine until a  Join is added then it runs forever.

A backup and restord did nothing as well as reindexing, shrinking and optimizing. 

After restoring the database on another SQL 2000 server we compared the speeds.

Bad server 4:22 minutes good server less then 1 second.

Any sugguestions??????  r.morrison@gerresheimer.com

The Decorator Pattern & Extension Methods

The decorator pattern provides a formal way to add new functionality to an existing type, without sub-classing. First question: What is wrong with classical inheritance? In and of itself, nothing is wrong with the good old Is-A relationship. It is very common to derive a new class from an existing base class in order to override a few virtual members, and add a pinch of new functionality.

Using jQuery to directly call ASP.NET AJAX page methods

Here I am looking to explain how to call page methods using jQuery. Using jQuery to directly call ASP.NET AJAX page methods
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