.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

Webpart properties getting empty after IIS Reset

Posted By:      Posted Date: December 04, 2010    Points: 0   Category :SharePoint

HI All,


I created a custom webpart property for my SharePoint webpart. The property has a textbox which is getting empty after an IIS reset. Can anyone tell me how to solve this issue!!!

View Complete Post

More Related Resource Links

Rowlimit and PageFirstRow properties of listview as parameters to Listview Webpart


Hi ,

 I need to set the  Rowlimit  and PageFirstRow properties  of  listview  as  parameters to Listview Webpart

 And these parameters  will be passed from the custom provider webpart


name of the list will be provided in custom webpart's toolpane.

and i need to save this as list content type of list defs


Please provide me the guidance on this.



WebPart has empty viewstate on postback

I have a simple weather web part in the form of a user control.  This usercontrol has an update panel and a textbox to allow the user to enter in a zip code/ city etc and an ok button.  The problem comes in when the webpart is added or dragged outside of Zone 1.  If this webpart remains in Zone 1 everything is fine.  If it is in Zone 2 or 3 after entering a zip code and hitting ok and posting back the value of the textbox is always blank.  It seems like the viewstate is cleared or the control is loading for the first time.  I have checked the Page.IsPostBack property and it is indeed True.  What would cause my control to loose the value entered in the textbox only when it resides outside of Zone 1?

Make a webpart properties customizable only by an Administrator

I am developing a sharepoint 2010 visual webpart that will show some sort of ajax content. I have a property on the webpart for the refresh rate, but I want this property to be set only by an Administrator (or any specific group). What is the best way to achieve this? Thank you.

Changing Properties/Attributes of a Webpart in inline code block - Error 'System.Web.UI.WebControl

I'm trying this code below, but gettting error: System.Web.UI.WebControls.WebParts.WebPart' does not contain a definition for 'FilterValue1' I need to change the value of the FilterValue1 properties of a content Query WebPart with title = Applicant Files. Thanks in Advance!
protected override void OnLoad(EventArgs e) {  base.OnLoad(e); SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite SiteCollection = new SPSite("https://somesite/")) { SPWeb myWeb = SiteCollection.OpenWeb(); myWeb.AllowUnsafeUpdates = true; Microsoft.SharePoint.WebPartPages.SPLimitedWebPartManager mgr = null; mgr = myWeb.GetLimitedWebPartManager("default.aspx",System.Web.UI.WebControls.WebParts.PersonalizationScope.Shared); foreach (System.Web.UI.WebControls.WebParts.WebPart myWebPart in mgr.WebParts) { if (myWebPart.Title == "Applicant Files") { myWebPart.FilterValue1 = "/13"; mgr.SaveChanges(myWebPart); break; } } } }); }

Change webpart properties programmatically

I am attempting to modify the properties of another webpart when my webpart's button is clicked. The code compiles and runs, and stepping through it shows that the properties do change. However, they don't stay changed. This example attempts to toggle the visibility state, but other properties won't stay changed either. Any help is appreciated.     SPSecurity.RunWithElevatedPrivileges(delegate() { // get the site in this context using (SPSite SiteCollection = new SPSite(mySiteGuid)) { // get the web in this context SPWeb myWeb = SiteCollection.OpenWeb(myWebGuid); myWeb .AllowUnsafeUpdates = true; // Hide/display another webpart. Microsoft.SharePoint.WebPartPages.SPLimitedWebPartManager mgr = null; mgr = myWeb.GetLimitedWebPartManager( "default.aspx", System.Web.UI.WebControls.WebParts.PersonalizationScope.Shared); foreach (System.Web.UI.WebControls.WebParts.WebPart myWebPart in mgr.WebParts) { // If this is the webpart we want to modify... if (myWebPart.Title == "Other Webpart Name") { // Toggle the visibility state. myWebPart.Visible = ! myWebPart.Visible; myWeb.Update(); break; } } } });

Accessing SelectedItem of DropDownList in WebPart Custom Properties



I've made a simple Visual Web Part using an AJAX timer to count down to dates.

I have added a custom property which is a list of events, but I cannot find the Selected Item value in my ascx.cs file.

Here is how the property is set:















 VisualWebPart1 : WebPart




 EventList myEventList;


), Category("Configuration&quo

Trying to start second animation from completion point of first animation, but, properties are reset


Trying to use two arcsegment-based geometries to move an image along a semi-ellipse in, well, two segments.

So, the image at 270 degrees for example, upon event, will translate clockwise to 180 degrees. Finish, stay there. Then another event will have it translate (continue) clockwise to 90 degrees.

I have all the arcsegments, path figures, path geometry, storyboard stuff working. In fact the second translation works correctley, i.e. correct rotation angle and "relative" path.

However, it seems that the myStoryboard.Begin(this,true); statement first sends the image element back to the first (original) starting point, but, then translates correctly but relative to that first starting point ... not where the first segment ends.

Using the image's RenderTransform property's X and Y to translate.

Like I said all that is working, but, the second time doesn't start from the end of the first, even though the image stays there. On call the image moves back to the original starting point, then does what it should, essentially ending at 0 degrees, not 90, since it does the second segment from 270, not 180.

I've tried all kinds of stuff for days (feeling a bit inept frankly :( Learned that animations hold properties at bay, so I've tried Remove, FillBehavior.Stop, and manually setting the new starting point. I've looked for GetC

Content Editor WebPart error "Cannot retrieve properties at this time"


I've found a similar post: http://social.technet.microsoft.com/Forums/en/sharepointadmin/thread/fc9b388c-2a16-436c-afb4-b6d06b2f5fe5...but i don't have the same errors on the event log.

- SP2 installed already

- Recyle Application Pool works but only temporarily ... it keeps happening again

I have the following and any help would be much appreciated!!!


Event Type: Error
Event Source: Office SharePoint Server
Event Category: Office Server Shared Services
Event ID: 6482
Date:  10/13/2010
Time:  4:13:34 PM
User:  N/A
Computer: XX1
Application Server Administration job failed for service instance Microsoft.Office.Server.Search.Administration.SearchServiceInstance (a21cc2ec-8b2b-4ee1-bcc6-d971a5dcc263).

Reason: The trust relationship between this workstation and the primary domain failed.

Techinal Support Details:
System.SystemException: The trust relationship between this workstation and the primary domain failed.

   at System.Security.Principal.SecurityIdentifier.TranslateToNTAccounts(IdentityReferenceCollection sourceSids, Boolean& someFailed)

Reset All PeoplePicker Properties


How do I reset all People Picker properties that I set with STSADM?

I lost my documentation and now I need to reset to the way it was.

Check Empty WebPart Using JQuery


Hi All,

Is it possible to identify a empty webpart in the page?

For e.g, we have an annoucement webPart that has no item, The webpart will display an default OOB Message.

Our Requriement is to identify those empty webpart and hide them. Whether this is possible using JQuery/ Javascript?

Note: Solution should in either in JQuery or Javascript or any those OOB option. We should not do any Coding?

Please let me know whether this is possible?


Ganesh Moorthy S

Content Editor WebPart Cannot retrieve properties or save changes


When a content editor webpart is open for editing - if they use the Rich Text Editor the error message is "Cannot retrieve properties at this time

If they use the Source Editor - they can make changes but it give them the message "Cannot save changes"

Sheryl L Fackler

Can i change the webpart zone properties according to the sharepoint group?



Is it possible to change the webpartzone 'AllowLayoutchange' property for each sharepoint group.

when i am trying it is giving me error that i "cannot change the property when it is added to page"




Cannot view webpart in browser after adding Group Properties


Ihave a customized web part, this can be shown properly in browser.

however, in the dataview, if I added "Collapse group by default ", it looks fine in sharepoint designer. But, when it goes to browser. i got the following error:

Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Windows SharePoint Services-compatible HTML editor such as Microsoft Office SharePoint Designer. If the problem persists, contact your Web server administrator.

Please help ! ! !

Webpart causing authentication error when cache is empty - showing just fine, when a lokal admin has



I'm having some trouble with a webpart and some rights, I think.

I have created a webpart, showing some data from at database. Based on which Active Directory group the user is in, some part of the webpart is either show or hidden.

My problem is now, that every morning, the webpart causes an error, saying you need to logon. When I open the same page from the local machine with a local admin, the webpart shows up, and the webpart is now show as it should for everyone.
This behaviour happens next morning.

The webpart is deployed to the GAC.
I also sometimes se the problem when a user, who is in a group that enables them to se the "add comment" part of my webpart, they get the error, but the user, which are NOT allowed to se the "add comment" part see the webpart just fine.

I hope it is clear, what my problem is, but I will gladly try to explain deeper, what the issue is.


WCF Tip: Using Properties in Service Contracts

you'll notice all of the Service Contracts are implemented with interfaces containing only methods. For the longest time I thought that's all that was supported, until I thought about it a little more. In C# land, properties are simply wrappers around a get method and set method, so why wouldn't we be able to use properties in a service contract? Well the answer is we can.

Automatic vs Explicit Properties

If the reason that motivated the change from automatically implemented property to explicitly implemented property was to change the semantics of the property then you should evaluate whether the desired semantics when accessing the property from within the class are identical to or different from the desired semantics when accessing the property from outside the class.

Dependency Properties

When you begin to develop appliations with WPF, you will soon stumble across DependencyProperties. They look quite similar to normal .NET properties, but the concept behind is much more complex and powerful
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