.net - Persisting Sharepoint EditorPart Settings
Jul 26, 2011
Inheriting from the System.Web.UI.WebControls.WebParts.EditorPart class I have been shown that it is possible to expose a public property in your VisualWebPart that when updated through the EditorPart will be automagically persisted in sharepoint.
The problem I have run into is saving strings and integers works great but when I attempt to persist the value of a collection such as List<String> the object is not saved.
The code looks like this.
Public Class MyCustomEditorPart
Inherits EditorPart
Public Overrides Function ApplyChanges() As Boolean
[Code].....
View 2 Replies
ADVERTISEMENT
Jul 1, 2010
In the top right corner of a SharePoint site the user can select "My Settings" to update their details etc.
I am currently writing an automated app that will update user profiles from an Export we are getting on a nightly basis.
My question is...can i add extra fields to the information that is stored and editable against each user?
For example if I might want to add an "Office Location" field?
I am using WSS 3.0.
View 1 Replies
Oct 15, 2008
I am using MS Access 2003 database and connecting to it via OLE DB for Microsoft
JetConnectionString="PROVIDER=Microsoft.Jet.OLEDB.4.0;" & "Data Source=c:httpDatabaseCisco_conf.mdb;" & "User ID = Admin; Password=;" objConn.Open ConnectionStringThen. I open a recordset and try to save it as XML fileIn order to persist data as XML when saving a recordset to a file, I have file in ADTG format not in XMLregardless my explicitly specifyingrs.Save "nyOrder.xml", adPersistXMLthe data saved do not seem as XML, they do seem as ADTGTG! 'т?ІПЌ# Є _юX ! Т*cцлПг Є ? @ ѕ"ИуО*е Є Dw= яя яяI Б<Ћлm Ќц Є _юX , " m y O r d e r " m y O r d e r U рЃЂ d e s c r i p t i o nAs was suggested in http://msdn.microsoft.com/en-us/library/ms810668.aspxI tried putting provider keyword as "Provider=MSPersist;" into my connection string...but I received an error message:Microsoft OLE DB Service Components error '80040e21' Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done. Please, say if it is because of MS Access DB or MS Jet provider that I can not save the recordset as XML file.
View 8 Replies
Sep 7, 2011
The purpose of the program is for text to be dragged between boxes to move assets around. I've managed the drag and drop functionality but need to persist the text in the text boxes once the program is shut down so that when reopened, the last location of all moved text is still present.
I've tried the easiest to understand suggestion to get me started but when I build and publish the program it says that I do not have access to the file to save the values!!
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim txtpersist As IO.TextWriter = New IO.StreamWriter("C:UsersHPDocuments
amestore")
[code]....
View 6 Replies
Apr 4, 2011
Alright, so here's my basic ASP.NET page setup: I've got a page with a GridView that has ContentTemplates in it. You can add a row and edit/remove rows at any time. There's a "New" button that creates a new row.
All of this data is bound to custom data objects. So if I have a GridView of "People" and each row has "FirstName", "LastName", and "Gender" (with TextBox and DropDown controls), I then have a "Person" object which has public properties for "FirstName", "LastName", etc. I have the binding set up correctly, and I can push data into the GridView from the object, and I persist the object with the Session variable. My page lifetime structure looks something like this:
Page_Load: Loads the List(Of Person) from Session()
Any events fire, and modify the List(Of Person).
After any event, the List(Of Person) gets saved back into Session(), and is then DataBound to the GridView (and any subsequent fields are also DataBound, such as the DropDownList.
My question is: Whenever I fill in rows in the GridView, and then add a new row (there is no database saving going on whatsoever), my fields clear out and don't persist across PostBacks. So, how can I persist my custom data objects with databinding across postbacks?
View 2 Replies
Feb 21, 2011
Dim List As New List(Of DateTime)
Then in my button click event:
If InputBookinglength.SelectedValue.ToString = "2" Then
Dim paramstring As New StringBuilder
If Session("SelectedDates") IsNot Nothing Then
[Code]....
This code works fine when selecting multiple days in one month. But when you switch to display a different month, the previous months selections are lost. how to persist the selections when the visible month changes.
View 1 Replies
Sep 22, 2010
In a MDI WinForm I want to save each child window position and state, per application user, that is different by the logged in Windows user. My application has its own users; so I won't use the user settings like my.Settings... etc.One option is to read/write directly to the database, but I don't like the idea to access the database for something so trivial as the windows positions. The plus is that I could store that information independently by the machine where the user works, wherever she logs in, her preferences will be remembered.Another option, that I'd like to follow, is to use Xml to store that information in a file locally on the user's computer. The structure could be something like:
<form name="form name">
<Top>120</Top>
<Left>100</Left>[code]....
how this could be done; maybe using Linq to Xml? I've found I can write something as simple as
Dim formPos As XElement = _
<User><%= My.Application.connectedUser.id %>
<form1>[code].....
2) How to write the XElement when finished building it. Should I use an XmlWriter.Create? Hot to pass it the XElement?
3) What happens when in the Xml file there's already a node with the same name, I want to overwrite the previous user settings if they are already there, but not append to the file, nor rewrite the entire file, of course.
View 1 Replies
Oct 12, 2011
Does anybody know how to persist (save and recall) a structure array when using a custom control? I don't want this data to show up in the properties window but it needs to be available "behind the scenes".
Right now, I'm writing the information to a file but this causes portability problems and may trigger the UAC.
[code]...
How can I persist this without writing to a file? Should I save it to the registry?
View 3 Replies
Mar 11, 2010
(I've answered the question below with a hack. I'm fairly confident in it unless MS change the way that codedom serializers the designer code.)ETA2:I've worked out what is going on. I wondered why sometimes it would work and not others. It boils down to the name that I give to the internal property and the collection.If I rename the property 'Annoyance' to 'WTF', it will serialize correctly because 'WTF' is, alphabetically, after the name of the collection - 'InternalAnger'.It looks like the serializer is creating instances of objects alphabetically and needs my internal property to be created by the time it comes to create the collection.I can fix this with a rename, but that's a hack and I fear that writing a custom serializer is a big job - which I've never done before.ETA: Jesus, I'm sick of this. This problem was specifically about persisting an interface collection but now on further testing it doesn't work for a normal collection. Here's some even simpler code:
Public Class Anger
End Class
Public Class MyButton
[code].....
View 4 Replies
Oct 30, 2009
I have a VS.net project where I need to add a reference to Microsoft.sharepoint.dll where can I find the dll. I am running my web application on XP Professional box and I cannot install WSS 2.0 on my machine.
I need to programmatically access a sharepoint site which is on WSS 2.0 from aSP.net application.
View 2 Replies
Oct 19, 2011
I am trying to manipulate SPListItem permissions on folders in a document library but I can't seem to add any new permissions, though removing security inheritance works beautifully.I've done my best to create a slimmed down version of the code for testing purposes. The function GetListItem returns the SPListItem we are working with based on the URL. The item.BreakRoleInheritance(False) works great and I've verified properly breaks inheritance and clears out any permissions, I've also tried it with the True flag and verified that all original permissions are copied from the parent.
The code below throws no exceptions and as far as I can tell appears to work fine, until I check the actual permissions on the folder in my document library and see that "Viewers" is not listed.
[Code]...
View 2 Replies
Jul 21, 2009
I've developed a Word template in VSTO. When published it consits of several files including a Setup.exe, several msi files etc.Due to the fact that my company's security policy won't allow me to store dlls and exes on the server I need an alternative way to provide all the necessary stuff to the end user. I thoght it would be enough if I:
1) execute the setup.exe file on each client machine (it says everything got properly installed)
2) upload the xxx.dotm file to sharepoint and register it
3) edit policy settings
but it doesn't. When a user creates a new Document inside sharepoint using "New"->"xxx" the requested document loads without any error message and show the document but Word won't load any extensions / ribbons etc.
View 1 Replies
Jun 9, 2010
I know this might sound a little silly. but I'm confused as to what language does sharepoint code behind uses? do they use vb or c#? or is it possible to use eithe
View 2 Replies
Oct 14, 2010
I'm trying to call the AddAttachment of the Lists.asmx SharePoint web service the below code works fine if I'm calling the web service over HTTP.
[Code]...
I will get the same 401 error (expected) so it appears the credentials are being accepted correctly over HTTP but not HTTPS. Can one help explain this to me and have any thoughts on how to fix the issue?
View 1 Replies
Jun 26, 2009
How to get file from SharePoint portal using VBA
View 2 Replies
Mar 8, 2009
OKay, I'm from a PHP background, but I've just been tasked with developing some custom Web Parts in SharePoint. I've figured out how to create and deploy a basic "Hello world" web part in VB. Okay so far.
how do I lay out things in a VB web part?
For an example, here's a label and a textbox:
protected overrides sub createchildcontrols()
mybase.createchildcontrols
dim mylabel as new label
[Code].....
How would I, for example, get mylabel and my textbox to appear on different lines, rather than running one after the other as they do now? In PHP I'd just wrap them in some top break them onto differnt lines, but how do I do it here?
View 6 Replies
Mar 1, 2011
I know this might sound a little silly. but I'm confused as to what language does sharepoint code behind uses? do they use vb or c#? or is it possible to use either?
View 5 Replies
Mar 1, 2011
I need to get hold of the Sharepoint DLL's. I understand that these are available from the Sharepoint server however the company I work for is quite large and the server is not anywhere I can get close to to copy the DLL's. Is there somewhere I can download these so I can start to develop my VB.NET application locally!
View 2 Replies
Mar 3, 2011
I have an application in vb .net that I would like to have access to objects in a sharepoint site. Some of the things I would like to do from vb is create folders in my sharepoint site, have access to files that are on my sharepoint site. We have sharepoint servers at corporate so that is where my site resides.
View 4 Replies
Sep 29, 2011
I am trying to add items in a SharePoint list and I would like to use vb. I have tried using this this from here: [URL] but i get this error: Type SPWeb is not defined.
[Code]...
View 15 Replies
Oct 6, 2010
How would I go about uploading an entire directory and all sub-directories and files to a SharePoint 2010 Server?
I don't think this function is specifically built into SharePoint (just uploading multiple documents in one folder). But the way I understand it, I can write something in VB or C# to accomplish this.
View 4 Replies
Jan 10, 2011
I have a project in VB .net 2008 and would like to communicate with a Sharepoint site on our companies SP server. Is it possible to interact with the SP site such as:
Create sub-folder
Upload and download files
Change authority levels on folders
View 5 Replies
Aug 24, 2011
Is it possible to connect to the SharePoint site /data list and query data from?
I want to create a data source from share point on my winform application.
View 5 Replies
Jan 24, 2011
i need to browser the folder in Folderbrowser dialog how to done this?
View 3 Replies
Sep 28, 2010
I am initializing a GridView, text box and a button via code to a Webpart in CreateChildControls()The above controls are declared as class variables but initialized only later.Next, I've given the handler for button click. The handler function is supposed to work as a search - perform some operations on the content entered in the textbox, load the results in the Gridview, display the Gridview.When I type something in the text box and hit the button, the same controls load again and the content entered in the text box is lost. I've tried ViewState() and ViewState() but to no avail. The grid doesn't show because my logic skips attempting to bind it since a proper search string was not available.My questions:
1) Where/how can I get the values postback from the textbox?
2) Will it make sense to populate the GridView in PreRender() or will Event Handling happen after PreRender()? [code]
View 2 Replies
Feb 2, 2011
I'm attempting to add a calendar to one of our VB.NET Web Forms-based websites which will be used for scheduling purposes. We want to have this calendar sync with our corresponding Sharepoint calendar.
My problem is this: I know that I can integrate a Web Part into a Web Forms page; can said Web Part use a calendar from our Sharepoint site as its data source?
View 1 Replies
Mar 21, 2012
I'd like to write an app that would allow users to modify existing records in a WSS sharepoint list and/or create new records.I feel confident that its possible, but I just don't know exactly how. Sharepoint access, for me, is accessed with domain credentials, so I"d need some method for getting those from the user, in the winform, and passing those along to the WSS server.
View 1 Replies
Jan 13, 2011
The company has been using Visual Studio 2008 and .NET Framework 2.0 for approximately 2 years. During that time we released several versions (4.x.x) of our program to the public and were able to preserve the user's settings using My.Settings.Upgrade.During the past development cycle we upgraded the program to Visual Studio 2010 and .NET Framework 4.0 and changed the version to 5.x.x. Now, when a user upgrades from 4.x.x to 5.x.x they lose all of their settings.However, in all upgrades after that point (ie 5.0 to 5.1) all the user's settings are once again preserved.I checked C:Documents and Settings<USER_NAME>Local SettingsApplication DataCompanyName and it contains two directories:
ApplicationName_Url_aaa ApplicationName_Url_bbb
where aaa and bbb are 32 character strings. All of the user.config files for the 4.x.x releases can be found in the ApplicationName_ Url_aaa directory. All of the user.config files for the 5.x.x releases can be found in the ApplicationName_Url_bbb directory.Based on this information it seems like something changed when we converted our program to VS2010 and Framework4 that is now causing a different 32 character string to be generated. However, we have been unable to track it down.
View 9 Replies
Jan 3, 2012
I have the following structure:OLD: frmMain (WinForm)uscStat (UserControl with Grid) In frmMain I'm able to make some settings and load the result of the settings via LinQ into the Grid of the uscStat.
[Code]...
View 1 Replies
Jan 14, 2009
I just wondered if you can or can't save arrays using the settings system object. There seems to be no way of entering it at designtime. It seems implied you cannot create new user settings.subobjects at runtime. I'm looking to find the easiest way to save a populated array of PictureBox's. If the only way is a self/custom made/managed .ini file then I need to know so i can start on that but I was hoping to use some of all this phaff in the new frameworks usefully.
View 3 Replies