I need to convert a SharePoint List to ASP.NET, including its column filters etc.
Aside from the underlying data which will be housed in a SQL Server table, what are good control choices on ASP.NET side for this? (I'm not sure if ASP.NET Gridview will have all the necessary features.)
I want to export sharepoint list to excel, I also posted question on another sharepoint forum(http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/f890abb6-5558-4e47-925e-e1a026804d58)
i was wondering if there is a way to prepopulate sharepoint list item values into a webform fields if the loggin user's information is matched with the information in the list item.
what i have done is that i made a query function to determine if info is matched, and then i try to pull some infomation out from list item. this method works fine for printing these values to some labels on the form, however, it is not working for prepopulation, which happens in the page_load function.
I have a form built using the wizard control in VS 2008. I need this form to collect data and publish them to a sharepoint list or page?is this possible?
in order to prepopulate some user information, i used query to search the sharepoint list. my question is how to search loggin user's info in the list. i used following testing query function. it works fine. however, it can only search specific text, cannot be changed according different user.
I am creating one new silverlight webpart from VS Sharepoint 2010. If i am creating the silverlight application its asking for the sharepoint local site url, i gave the valid url but its showing the ["could not contact sharepoint server for list of document libraries. check your sharepoint URl"].
I'm doing some custom code for a SharePoint webpart in C#. Specifically, I'm making a quiz, my main point here addressing the list that holds the question, answer choices, and correct answer.
At the last stage of the quiz I need to check the answers selected by the user against the correct answer in the list. Currently, I'm doing the following to check if each is correct, which I'm assuming isn't very efficient because it iterates through each question. Is there a method, specifically for the SPList foreach loop, that would be more efficient?
// 1. Store questions and answers in class List<submittedAnswers> answeredQuestions = new List<submittedAnswers>(); // 2. From POST pull answered question IDs and answer IDs (which correspond to the question primary key and answer choice number both stored in the list) // INSERT BEAUTFIUL AND EFFICIENT WHILE LOOP HERE // 3. Loop through each question is list, if question was given, test if correct/incorrect using (SPWeb myWeb = mySite.OpenWeb()) { SPList answerList = myWeb.Lists[questionList]; foreach (SPListItem quizEntry in answerList.Items) { int pullAnswerId = int.Parse(quizEntry["Answer"].ToString()); // Pull answer number from list int pullQuestionId = int.Parse(quizEntry["ID"].ToString()); // Pull primary key of question submittedAnswers result = answeredQuestions.Find(delegate(submittedAnswers e) { return e.questionId == int.Parse(quizEntry["ID"].ToString()); }); if (result != null) { if (result.responseId != pullAnswerId) // If the response was different from the answer incorrectAnswers++; else correctAnswers++; } } } // C# quiz grading magic here....
I've created a quiz web part in SharePoint 2007, but am stuck on one permission. It needs to write the quiz score to a list, which it's throwing an error now when trying. I'm under the assumption that if the web part has the appropriate permission level, the user's permissions (the quiz taker) don't matter. Is there a particular permission that should allow the webpart to write to a list? Specifically:
I have a sharepoint event handler attached to task list. This work fine but I have 3 task list in my site and I want that handler trigger only to one task list.I already used the listtemplateId 107.
I have to save a fileshare link in a sharepoint list and i want that file to be opened when the link is clicked, the normal sharepoint hyperlink column does not work for me in this case as it embeds the http:// with the url. How can I handle this scenario? the link i want to save is in the format 192.168.1.2myservermyfile.pdf and the text to be shown in the column is "myfile"
I am converting my datatable to LISt using LINQ how do I handle nulls coming from database
List<Port> portDetails = new List<Port>(); DataTable dt = ds.Tables[0]; portDetails = (from q in dt.AsEnumerable() select new Port { PortCode = q.Field<string>("Code"), ExtCode = q.Field<string>("Nb"), Name = q.Field<string>("Name")) }).ToList();
In the above query if Code is null I do not want property portcode to be set to the value it should only set if it is not null or not blank PortCode = q.Field<string>("Code"),
What should be syntax I was trying somethign like this which doesnt work Portcode = q.Field<bool>("Code") == null ? null : q.Field<bool>("Code")
To convert the above data into unordered list based on depth, I'm using the following code
[code]...
But the resulting unordered list doesnt seem to be forming properly(using which i am constructing a tree).For example "Site " with id '180' is supposed to appear as a direct child of "Televisions" with id '1',is appearing as a direct child of 'Flash' with id '191' using my code.so in addition to considering depth,I've decided to consider itemid as well in order to get the treeview properly.Those rows of the table with itemId not equal to null are not supposed to have a child node(i.e.,they are the leaf nodes in the tree) and all the other nodes can have child nodes.
Update:
The 'itemid' column refers to the id of an item which is present in another table.This column just in identifying if an item has any sub items(i.e., 'name' in my data in this case has any other unordered lists under it).
I have deployed a custom SharePoint Web service on Farm A. I am trying to access this Web service from a SharePoint timer job on Farm B. On Farm B, I am creating Class Library project, packaging it (wsp) and then deploying to GAC. The problem is I'm unable to access the Web Service using the following code. TodaysNewSVC is a service reference
//getNewsFromInsite is a WebMethod which returns the DataTable.
Note: Both farms use the same active directory authentication. I have also done the debugging for Timer Job and feature activation and they are working fine. The problem occurs during the call i.e. getNewsFromInsite The asmx and wsdl files are accessible from Internet Explorer and also from Windows Console application. Here is the code which I use from console application:
GetTodaysnewsfromInsiteSoapClient objWSClient = new GetTodaysnewsfromInsiteSoapClient(); objWSClient.ClientCredentials.Windows.ClientCredential = System.Net.CredentialCache.DefaultNetworkCredentials;[code]...
Here is the error message:The request failed with the error message: -- <html><head><title>Object moved</title></head><body> <h2>Object moved to <a href="%2fPages%2fproblem-with-page.aspx%3fc%3d500">here</a>.</h2> </body></html>
I want to create a custom web part in SharePoint 2007 that allows me to take items from an existing custom list (i.e. Title, Hyperlink, Description and photo) and then render it in a format of my choice. How can I do this using C# asp.net and a web part?
I'm having difficulties getting XslCompiledTransform.Load method to take a server path. I googled around and found that I need to do something like:
xslt.Load(System.Web.HttpContext.Server.MapPath(xslPath), XsltSettings.Default, new XmlUrlResolver());
But it returned an error saying HttpContext is null.
I also tried:
xslt.Load(System.Web.HttpServerUtility.MapPath(xslPath), XsltSettings.Default, new XmlUrlResolver());
That also returned an error saying an object reference is required for the non-static field, method, or property 'System.Web.HttpServerUtility.MapPath(string)'
The xslPath has a path that points to a xsl file in Sharepoint Web. I just want XslCompiledTransform to load the xsl file with the server path. Is it possible? If so, what is the proper way or hackish way of doing it?
EDIT: I have access to a SPWeb object which contains the path to the xsl file. However when I check the ServerRelativeUrl, it just says "/MyTree/xsl.xsl". The problem here is I couldn't get the XslCompiledTransform.Load to load the file from SharePoint list.
Following error comes when creating a WebPart In sharePoint 2010 Server.
Web Part Error: Unhandled exception was thrown by the user code wrapper's Execute method in the partial trust app domain: System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.TypeLoadException: Could not load type 'Microsoft.SharePoint.WebControls.SPGridView' from assembly 'Microsoft.SharePoint, Version=14.900.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'. at ListMenuSample.ListMenuSample.ListMenuSample.CreateChildControls() at System.Web.UI.Control.EnsureChildControls() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace --- at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at Microsoft.SharePoint.UserCode.SPUserCodeWebPartWrapper.ExecuteHttpRequest(SPUserCodeWebPartHttpRequestContext webPartExecutionContext, SPUserCodeWebPartHttpResponse httpRequestResponse) at Microsoft.SharePoint.UserCode.SPUserCodeWebPartWrapper.Execute(SPUserCodeExecutionContext executionContext) at Microsoft.SharePoint.UserCode.SPUserCodeApplicationHostAppDomainRef.Execute(Type userCodeWrapperType, SPUserCodeCachedAssemblyGroup userAssemblyGroup, Guid siteCollectionId, Byte[] binaryUserCodeToken, Byte[] proxyOperationToken, SPUserCodeExecutionContext executionContext)
Last year, we had installed Visual Studio 2008 and I had started to develop some web sites with ASP.NET 3.5.
Now I was told that our Intranet will be moved to SharePoint and built on MOSS. I've started to look at our SharePoint server and learn how to create ASP.NET 3.5 Web Parts for SharePoint site.
What I learned about the Windows SharePoint Services (WSS) 3.0 is that it consists of SQL Server, ASP.NET 2.0,IIS, etc. I don't quite understand what does this really means, especially for ASP.NET 2.0? I know on our Windows Server 2003, the WSS 3.0 was installed. We have SQL Server 2005 installed at our Intranet Web server,where I developed my ASP.NET 3.5 web pages.
My question are:
1. To create ASP.NET Web parts with WSS 3.0, I have to create ASP.NET 2.0, not ASP.NET 3.5? 2. My co-workers told me they don't need Visual Studio when creating SharePoint aspx page.
Is it true that with SharePoint, we don't need Visual Studio any more? I think creating SharPoint WebParts they have to use Visual Studio. Am I right?