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

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

can the void main function be called all the time, when activated as a feature.

Posted By:      Posted Date: September 14, 2010    Points: 0   Category :SharePoint
Hi, I have a console application using C#, in which i have a custom code under the static void main. I would like to know, if the console application is made to a feature and activated, will the static void main function be called all the time, without waiting for any events to be trigerred. Thank you

View Complete Post

More Related Resource Links

Why do the aks master pages not get applied if the feature is not activated on the top site collecti


I installed AKS 2.0 and activated AKS feature. The problem I found was the aks master pages do not get applied if the feature is not activated on the top site collection. why is so?

example: If i activate the feature on http://<servername>/sites/<sitename> and apply the master page, I dont see any changes.

              But if i activate the same aks feature on http://<servername/ then everything started working on all sites.

              The reason i found is the CSS reference in the aks master pages.

              It reference should be given as follows:

                 for http://<servername>/sites/<sitename> ->  <link rel="stylesheet" type="text/css" href="../../Style%20Library/AKS/Aks_Band_Blueband.css"/>

                 for http://<servername>/ -><link rel="stylesheet" type="text/css" href="/Style%20Library/AKS/Aks_Band_Blueband.css"/>

So my question is, am i missing anything? am i supposed to activate the AKS feature on top level site collection at any cost? if yes, why is so? 

And after applying aks master pages, i see differnece in font sizes. Why the font size is getting changed?


WCF Service Function Getting Called Twice


I have a WCF Web Service.  I am trying to test the service from a web form.  The web form calls the service using WebOperationContext.  The call successfully sends, however the web service function gets called twice while stepping through the code.  Nothing happens in between the first and second function call.  Not even setup of the Service.  The function itself is building a Generic List<Of Type T> and adding objects to the list.  The odd thing that happens, if I do not make the call to the add function, the Service function doesn't get called twice.  I'm including the network log collected from the network layer.  I can provide more source code if need be.  

Execute a function for specific time (not at specific time)


I have a function that does large amount of processing.

I just want that if it executes in specific time (say 10 min) then it should return "execution successful".

But if now then i want to stop the execution of that function and return "unsuccessful" and rollback my transactions.

Returning and rollback is fine.

But i dont know how to stop the execution of a function at specific time.

I am using asp.net with C#.

Any ideas would be really appreciated.


Is there a function in Jquery which run only one time no matter load page or PostBack

In asp.net, I can use Method A to run somethings A one time, and somethings A will nor run when page is postback but In JQuery, I hope to run something B one time when the page is loaded, but if I use Method B, the "Somethings B" always run even the page is pastBack, how can I do? Thanks! ------------------Method A------------protected void Page_Load(object sender, EventArgs e){    if (!IsPostBack)    {       //Do Somethings A    } }   ------------------Method B------------$(document).ready(function () {   //Do Somethings B})

how jquery function one time writen and call many butoon


how to call this function in two or more button one time wirtten

<asp:Button id="Bu_DocShareSave" runat="server" Text="Add Share"  OnClick="Bu_DocShareSave_Click"/>
                                     <asp:Button id="Bu_DocRemoveShare" runat="server" Text="Remove  Share" OnClick="Bu_DocRemoveShare_Click" />

<script type="text/javascript">  
     $(function () {  
           $('#btnFoo').click(function () {  
               var commaSeparated = $('#<%= ListBox2.ClientID %> option')  
                .map(function () {  

ServerCertificateValidationCallback not called every time.


I'm using the ServerCertificateValidationCallback to help with invalid SSL certificates and it works fine for the first web service.  Then it seems like it just randomly uses the callback.  For most subsequent web service calls, it won't even hit my break point.  Then on occasion (and seemingly random) it might hit it with a different call.

Should it be called every time?  Is there a way to make sure it's called?  Even though I've accepted an "invalid" certificate once, there are times where I may change my mind and want to return a different result.



SSIS Version Control - Can the Smart Diff feature of the BIDS Helper VS add-in be activated without


Specifically, my question relates to the requirement of the Smart Diff feature of the BIDS Helper VS add-in, namely, that it can be activated only if the client is VSS or TFS Source Control. If one had Visual Source Safe installed on one's system, but did not use it to manage SSIS Packages, i.e., the latter are not Checked-In to VSS, can the Smart Diff feature be operable?

how to capture value of javascript function called by GridView Linkbutton Click



i have gridview with linkbutton.when i click linkbutton it should call javascript function which returns value would be input for database functions.

how do i capture javascript function retun value(i am using Registerclientscriptblock)? and that should be input for database function.

Inshort i need to call two function from link button click - one javascript function,one ado.net function which will update value in database.

output of javascript function will be input for database function.

function Getlogitudelantitude(address)


return "35.3434343,-74.334343"


Linkbutton_click(object sender,Eventargs e)


register javascript function .. which should return value

string s = "35.34343,-74.334343"

then call database function(s) - does database operation


please reply..



EndScene function is called with several Direct3D devices.How to find out which one is a WPF window,



I am working on a screen grabbing application, which has a feature of grabbing a particular window. To make my application working with WPF applications with a good speed, I have chosen a "Direct3D hooking" approach for grabbing image of a WPF window, which means that I install hooks for some Direct3D calls, specifically, EndScene function. This works because WPF uses Direct3D for rendering windows contents.

However I ran into the following issue:
EndScene is called with several Direct3D devices, not a single one. I have looked into contents of each device's back buffer and found out that in addition to main window rendering, there are separate devices which are used for rendering of menus and tooltips.
However EndScene is called just with a pointer to a D3D device which is used for rendering and no information about whether a main window is rendered or a menu/tooltip. Also no information is available about position of menu/tooltip relative to main window coordinates (so that with that information I could compose a single image rendering images of window and menus/tooltips together).

So my question is: given Direct3D device which is used for rendering a window, how to identify a window (WPF window) by ob

Running a feature activated code during new site provisioning.

I would like to be able to run some simple code that have in a feature whenever a new site is provisioned.  I created the feature and it works just like I want it to.  I left it activated and saved the site template.  Now when I create a new site based on the saved site template the feature activated code no longer runs unless I deactivate and then activate.  I know this isn't suppose to work this way, and after much searching on the internet I am finding the feature stapling (not what I want, that seems to be what I have already done) and SPWebProvisionProvider.  The provider might be what I want but I am not sure how it works and there are no good examples on how to get one created in code and where to place it so that a user can utilize it when creating a new site.  Can someone explain this concept to me in ad nauseum detail.  Thanks in advance.

Anonymous Access in site template or feature activated by the site template, is it possible?



I'm building a custom site template and my question is if it's possible to set the anonymous access level in the deployment action.

I tried to create an EventReceiver (FeatureActivated), but I doesn't change the anonymous access level at deploy time. If I deactivate and reativate the feature from the site it works, but I miss the point, because like this it's the same thing then going to Site Permission and change the permission from there.

I do not want to set Anonymous Access from the Site Administration every time.


SharePoint Server Publishing feature--Can't activate on site (activated fine at site collection lev

I have five site collections and one of them seems to have an issue with the SharePoint server publishing feature, which is activated at the site collection level. On any of the sites underneath that site collection, the Server Publishing feature is not activated and throws this error when I try to activate:


One or more field types are not installed properly. Go to the list settings page to delete these fields.

 Troubleshoot issues with Microsoft SharePoint Foundation.

Correlation ID: f1915aff-39e6-4e99-ba2f-34faf71f3102

If I try to create an Enterprise Wiki, I get the same thing:

One or more field types are not installed properly. Go to the list settings page to delete these fields.

I won't be able to create the wiki until I can get the SharePoint Server Publishing feature activated.

Any one have any ideas? the other 4 site collections are fine.

how to change infopath form time (function now())

my infopath form has a default time now() for the field. my sp2010 server has correct time and time zone, for example 4:11pm EST now, but when open the form in sp2010 web browser form, it shows 1:11pm. any idea how to fix it?
however, if I do preview, it shows correct ime 4:11pm

Round off time to the nearest minute

How would you round this up to the nearest minute? There isn't a built in function to do this so you have to use a little bit of maths to get there. There are 60 seconds in a minute. We already have 38 seconds on the clock. So we need to add on 60 - 38 = 22 more seconds.

Performance Tests: Precise Run Time Measurements with System.Diagnostics.Stopwatch

Everybody who does performance optimization stumbles sooner or later over the Stopwatch class in the System.Diagnostics namespace. And everybody has noticed that the measurements of the same function on the same computer can differ 25% -30% in run time. This article shows how single threaded test programs must be designed to get an accuracy of 0.1% - 0.2% out of the Stopwatch class. With this accuracy, algorithms can be tested and compared.

Using SharePoint Search feature in ASP.Net Application

Integrating ASP.Net application in to MOSS 2007 to utilize SharePoint Enterprise Search Feature can be done by using Business Data Search.

Date and Time Functions in SQLSERVER

Date and time functions allow you to manipulate columns and variables with DATETIME and SMALLDATETIME data types.

1 DATEPART Function
2 DATENAME Function
3 DAY, MONTH, and YEAR Functions
5 DATEADD Functions
6 DATEDIFF Function
7 More SQL Server Functions
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