Web Forms :: Prepopulate Information From Sharepoint List?

Oct 15, 2010

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.

here is my query code:

[Code]....

here is the read from list code:

public void readFromList()
{
SPSite oSiteCollection = SPContext.Current.Site;
SPList oList = oSiteCollection.AllWebs["/en/admin"].Lists["TTCVIP"];
SPView oListView = oList.Views["All Items"];
SPListItemCollection collectListItems = oList.GetItems(oListView);
foreach (SPListItem oListItem in collectListItems)
{
SPWeb web = SPControl.GetContextWeb(Context);
SPUser loggedinUser = web.CurrentUser;
LabelFirstName.Text = SPEncode.HtmlEncode(oListItem["First Name"].ToString());
//LabelLastName.Text = loggedinUser.Name;
LabelLastName.Text = SPEncode.HtmlEncode(oListItem["Last Name"].ToString());
}
}

View 1 Replies


Similar Messages:

Web Forms :: Current Logged In User's Information In Sharepoint List?

Oct 8, 2010

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.

[Code]....

View 1 Replies

Web Forms :: Converting A SharePoint List To .NET

Oct 1, 2010

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.)

View 3 Replies

Web Forms :: Export Sharepoint List To Excel?

May 18, 2010

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)

View 2 Replies

Web Forms :: How To Create A Form That Submits To A SharePoint List

Jun 29, 2010

How do I create a form for a public site that submits to a sharepoint list on a protected site? I am trying not to use InfoPath form.

View 2 Replies

Web Forms :: Collect Data - Publish To Sharepoint List / Page?

Feb 22, 2010

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?

View 1 Replies

Web Forms :: Error - Could Not Contact Sharepoint Server For List Of Document Libraries

Feb 15, 2011

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"].

how to resolve this error.

View 1 Replies

C# - Reload The Information Of The Sharepoint 2007 Webpart After A Button Is Clicked From Another Webpart?

Dec 29, 2010

I am new in sharepoint development. I have 2 webparts attached on a page. The first webpart (MyTestingWebpart1) basically it does only inserting of data and the other webpart (MyTestingWebpart[2]) displays the records from the database. Now my problem is when I try to click on the save button, somehow I don't know how to refresh the webpart that displays the newly inserted record. Is this possible?

I have added a query at the page load event of MyTestingWebPart[2]. Both of the webparts attached are web user controls.

View 2 Replies

Most Efficient C# SharePoint List Iteration?

Mar 8, 2011

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....

View 4 Replies

Javascript - Prepopulate Few Fields In A Form In A Survey?

Feb 9, 2011

I have a share point survey. When we responding to the survey, as we know, it will open NewForm.aspx. this page contains a ListFormWebpart in which questions from survey list will be displayed. Now, i need to add few labels before the questions and these label values should be prepopulated from query string. What i am trying to achieve from this is, i wll created a link with some values in query string and send to specific users. different users might have different values in query string. Whenever they click on the link, it should open the survey with prepopulated label values along with questions in list.

I am not sure, how to do it. I have tried to add some html control to web part(using share point designer) and through JavaScript i have tried to set query string values. Then i tried to put asp controls and trued. it didn't work. I am trying since last 2 days. No progress. I am using SharePoint 2003, WSS2.0

View 2 Replies

VS 2008 - Prepopulate Form View Values

Sep 10, 2012

I have a formview that I want to prepopulate some values based on some dropdowns that the end user chooses.

The formview is in insert mode tied to a datasource so the insert will be easy because it is tied to a dataset.

Just thinking of best way to prepopulate these fields. I am going for a best practice these days.

The one way I planned on doing it, was after they selected the dropdowns I will grab the values from the datasource and do a findcontrol on the formview to populate them.

View 1 Replies

SharePoint Web Part List Write Permission

Mar 14, 2011

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:

View 1 Replies

Forms Data Controls :: List Not Displaying Any Information

Apr 20, 2010

I am using mobile list control inside that i inserted a label when i bind any dataset to that list it is not displaying any information. In msdn it is mentioned the mobile list control is equivalent of web control is datalist. The code as follows.

<mobile:List Runat="server" ID="List2">
<Item>
<mobile:Label runat="server" id="lblStudentName" Text='<% #Eval("StudentName") %>'>
</mobile:Label>
</Item>
</mobile:List>

in code behind

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
MTestDataContext dc = new MTestDataContext();
List2.DataSource = dc.Students;
List2.DataBind();
}
}

View 12 Replies

Web Forms :: Display Information On Label Based On Dropdown List?

Nov 12, 2010

I have a table that has 3 columns, ID NAME DESCRIPTION at the moment, i have a drop down binded to name(bring back a list of names) simple enough!

now i want to put a label next to the drop down so that what ever is selected , it would show a label description next to it...

View 5 Replies

Have A Sharepoint Event Handler Attached To Task List?

Aug 23, 2010

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.

View 8 Replies

Saving A File Share Link In A SharePoint List Column?

Sep 23, 2010

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"

View 2 Replies

How To Customize XSLT List Form Webpart Using SharePoint Designer 2010

Dec 7, 2010

This query related to SharePoint Designer / XSLT List Form Webpart Customization in SharePoint designer 2010

I am using SharePoint designer 2010 to design my page.

I am trying to add list and customize it.

Following is customization task.

in my list I have two columns Title and Short Description . when I add list on my test page it show one by one following manner.

[code]

Problem is I want show it following manner .

[code]

How I Customize it ? I tried almost options from ribbon but didn't success.

View 1 Replies

Get The Valid EmailID From The List Appended With Some More Information

Apr 27, 2010

I want to get the valid emailID from the list.If I use the emailaddress from the address book of any mail account then the name of the user get appended with the emailID .eg:"Ayushi Soni" <asoni@[URL]>,.. and then copy these address to a textbox in an asp.net application.

Now I want to retrieve the actual EmailID from the list ignoring the name that is appended.Is there any utitliy that we can use to filter this out and validate the filtered email. I donot want to use regex for this.

View 10 Replies

Unable To Call The SharePoint Custom Web Service From Another SharePoint Farm

Jan 12, 2011

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

TodaysNewSVC.GetTodaysnewsfromInsite objGetNews = new TodaysNewSVC.GetTodaysnewsfromInsite();
objGetNews.PreAuthenticate = true;
objGetNews.Credentials = CredentialCache.DefaultCredentials;
objGetNews.Url = "http://insite-dev.portal/_vti_bin/todaysnews.asmx";
DataTable dt2 = objGetNews.getNewsFromInsite(true, true);

//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>

View 1 Replies

Mobiles :: List Not Displaying Information - Inserted Label

Apr 20, 2010

I am using mobile list control inside that i inserted a label when i bind any dataset to that list it is not displaying any information. In msdn it is mentioned the mobile list control is equivalent of web control is datalist. The code as follows.

<mobile:List Runat="server" ID="List2">
<Item>
<mobile:Label runat="server" id="lblStudentName" Text='<% #Eval("StudentName") %>'>
</mobile:Label>
</Item>
</mobile:List>

in code behind

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
MTestDataContext dc = new MTestDataContext();
List2.DataSource = dc.Students;
List2.DataBind();
}
}

View 2 Replies

DataSource Controls :: How To Update Data Information In The Database Using Dropdown List

May 19, 2010

I build a webpage to edit the data entry, all the textbox wroks fine. However when I update the value originally took in using dropdown list , I get error and couldn't get correct update.

View 2 Replies

C# - How To Create A Custom Web Part From A Custom List In Sharepoint 2007

Dec 19, 2010

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?

View 1 Replies

Security :: Display A List Of Registered Users Alongwith Their Profile Information And Image?

Jul 22, 2010

I have a profile page where a user can edit their name, city, image, etc.

How can I display the profile database as a list of users, their information, and their image?

As you know, the profile database is not the same as a custom database. The strings are bunched together.

View 7 Replies

C# - Getting XslCompiledTransform, Load To Load A File In A SharePoint List?

Mar 3, 2010

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.

View 2 Replies

Error: "Could Not Load Type 'Microsoft.SharePoint.WebControls.SPGridView" SharePoint 2010

Jun 15, 2010

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)

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved