.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

Store lists for an application different dropdownboxes?

Posted By:      Posted Date: September 18, 2010    Points: 0   Category :ASP.Net
Hi prosI have until now always stored my lists definitions for labels and values for dropdownboxes in my own defined Xml files. These lists labels I then match with a language file (.resx) ..... so far so good but now I am starting a new project. Should I continue with my old habbits or is there a better way of storing label constants for my dropdown boxes throughout my application?I would be happy skipping my read and write rutines for my onw structure if there is a better dedicated one for the purpose.Mr Virtual Office guy

View Complete Post

More Related Resource Links

How to Programatically SetCredentials for Secure Store Service Application in Sharepoint 2010 using

I have to setup Credentials for Secure Store Service application programatically. To get Stored Credentials I have following code and its working fine. using (SPSite site = new SPSite("http://vtlssp2010Dev")) //using (SPSite site = new SPSite("http://" + System.Environment.MachineName + "/sites/Site_Name"))d { Console.WriteLine(site.RootWeb.CurrentUser.Name); SPServiceContext context = SPServiceContext.GetContext(site); prov.Context = context; try { SecureStoreCredentialCollection cc = prov.GetCredentials(appID); foreach (SecureStoreCredential c in cc) { IntPtr ptr = System.Runtime.InteropServices.Marshal.SecureStringToBSTR(c.Credential); string sDecrypString = System.Runtime.InteropServices.Marshal.PtrToStringUni(ptr); Console.WriteLine(sDecrypString); } } catch (Exception ex) { Console.WriteLine("Unable to get credentials for application " + appID); Console.WriteLine(ex.Message); } Console.ReadLine(); } } All I want is to programmatically do set credentials like explained in this example on msdn. http://msdn.microsoft.com/en-us/library/ff798456.aspx Please help. Shamshad Ali  

Secure Service Store and custom web application.

 Hello All,  I have a problem for which I would like to use the Secure Service Store.  I've searched for similar solutions involving the SSS but I've not had any success yet.  Maybe I'm missing something obvious or going about it the wrong way.   We have an external application (actually, a number of external applications) we'd like to embed in our SharePoint site using an iframe or the Page Viewer web part.  The embedded application uses a custom forms based authentication scheme and I want to prevent the situation where a user has to log into our application then log into the embedded application.  Is there anything available the help post the credentials from SSS to the custom application?  The only think I can think to do is write some code that mimics a post to the login page of the embedded app and, if needed, write a stripped down or simpler login page for the embedded app to make that easier.  For my immediate task I have quite a bit of control over the source of both application and could write custom code on both sides if I had to, but I'd rather have a solution that only involve configuration or, at most, custom code on the SharePoint side.  Thanks,  Brandon 

The Best Place to store Settings for Web Application.

I want to create an Application Setting or Control Value for "Application Run Mode", which will indicate if the application is in Testing Mode or Live Mode. So I have created this Enum Type: Public Enum AppRunModeType Live Testing End Enum and, this will be used inside the the Web Application to determine if the application run mode, and hide/show some UI Controls accordingly. This Setting "Application Run Mode" is not a User Setting, it is a setting to be controlled by the developer who is deploying the application. Where is the best place to store this value ? I am thinking there are 2 places: 1. In web.config "appSettings" secting, 2. Or in Project Properties Page/Settings Section. If I choose to store it in web.config, then, I will not be able to have Strong Type Access to the value like the Enum type, and I have to convert from Enum Type to String and vise versa. If I choose to store it in Project Properties Page/Settings Section, then I cannot do that, becuase my Web Application is not a Porject and I cannot find this page there, or I will have to convert the Web Application to a Web Application Porject, and this is a Long Story. Also, How I can access My.Settings object from the Web Application ? Appreciate if some one could point me to the right direction and the best way to hanlde such requirement.

Create a new target application - Secure Store Service administration issues

Hi,I am trying to create new target application, when I go to Secure Store Service in Centra admin I have:Cannot complete this action as the Secure Store Shared Service is not responding. Please contact your administrator.I have used this few days ago and avarything else is working fine on the server, and I have applications created with it running fine.Any help is appreciated.cheersValko

What's the best way to store Data from DataBase like XmlNode... Application vs Cache


 Hello, i am building an N-tier application now i want to store Data(like XmlNode) that is common to all users ..

now i thought using Application to hold the data but my data lays in the BLL tier which is an Class Library project and i can't store any datain there for example :

HttpApplication MyApp=new HttpApplication();



My question is what is the best way to store Data (not small data like user name etc..) is it Application? orCache?

i would like a small example within a ClassLibrary project...


Replace standart DispForm with my application page for External Lists



Hi all,

I'd like to use my application pages (with code behind, not modified with Sharepoint Designer pages) for View/Edit/New operations.

As I know there is an issue how to do it:



SPContentType ct=web.Lists["ListName"].ContentTypes["ContentTypeName"];



And this works fine for common Lists, but when I'm trying to do it with External List,

I have an Exception on Update method:

SPException: The collection cannot be modified.


I've tryied:


web.AllowUnsafeUpdates = true;


ct.ReadOnly = false;

// or
ct.Sealed = false;

and nothing of it helped me...

Is anybody knows how can I make it? May be another method to do it?

Unable to create lists in upgraded web application


I can no longer create lists, sub webs or document libraries in a web application that I have upgraded from sharepoint 2007 to 2010. I dont think its directly related to the upgrade since it did work at some point.

When trying to create the list using addgallery.aspx the silverlight application will simply say that an unhandled exception has occurred with no further info.


In the log I have the following related log messages:



Entering monitored scope (Request (POST:http://sharepoint2010:80/profil/_layouts/AddGallery.aspx))



Detected use of SPRequest for previously closed SPWeb object.  Please close SPWeb objects when you are done with all objects obtained from them, but not before.  Stack trace:   

 at Microsoft.SharePoint.SPWeb.get_ListTemplates()    

 at Microsoft.SharePoint.Solutions.AddGallery.AddGalleryWebPart.GetListTemplates(XmlWriter myXML, SPSite site, SPWeb web)    

 at Microsoft.SharePoint.Solutions.AddGallery.AddGalleryWebPart.GenerateItemXML(XmlWriter myXML)    

 at Microsoft.SharePoint.Solutions.AddGallery.AddGalleryWebPart.RenderControl(HtmlTextWriter writer)    

 at Microsoft.SharePoint.WebPartPages.SPChrome.RenderPartContents(HtmlTextWriter

Unable to set up a new Secure Store Service Application in a single-server installation


Problem: after initial SharePoint installation, I tried to add the Secure Store Service Application under "Manager Services Applications".  The process screen returns something like "The time job created.  But failed to start in one or more servers in the farm."  Further investigation found that in the SQL Server, the secure service account was not added under the Login user accounts.  The Secure_Store_Service_DB has been created, but not under the name of secure store service account.  In another word, the database was created but the action seems to be incomplete.

Background: this is a single server farm installation on Windows Server 2008 R2, SQL Server 2008 R2, with AD CS and AD DS, DNS roles enabled on the same box.  The configuration task was running with the farm admin account which is also a domain admin, and has dbcreator, securityadmin, and sysadmin roles in the SQL server.


Can not access SharePoint Lists from ASP.NET web application



I don't know if this is the right place for this but is related to SharePoint.

using (SPSite site = new SPSite("http://server/siteName/"))
       if (site != null)
         using (SPWeb web = site.OpenWeb())
           foreach (SPList myList in web.Lists)


Example this code above:

I connected remotelly on the server, and in VS 2010 created a new ASP.NET Web Site. Added a new .aspx page and in code behind in the Page_Load event handler i put the code above. (lbLists is a ListBox on the .aspx page).

When i run this page and try to see the results in browser it doesen't work!!

The same code works perfectly on a windows form application!! What is the reason why it is not working?

It ment to not work? How can i make a web application (ASP.NET) that i can access a SharePoint site programmatically and display the items?

Then i want to deploy this app and run it in browser.


How and Where to store search parameters in MVC application


I am working on a railway web application and I have following layers:

ASP.NET MVC 2 (Presentation Layer) 
Services Layer 
Repository Layer 
Database & External Web Services as data sources (Using Entity Framework for Database) 

I pass Domain Entity Objects from Repository to Service layer and thinking of passing View Models from Service to Presentation layer. Website would require a login and after successful login I have to present a search screen with basic search (as default option) and option for advance search. Once user fills the search criteria I have to gather data from DB & Web Services and present the results to user. User would select a particular Rail option and would move on to other additional options page BUT they should be al

Where to store Shopping Cart in MVC Application?


I am working on a Railway Portal and would require maintaining a shopping cart of components user has selected, there could be multiple components of different type in the cart. I don't see a value in storing the cart in database, would like to store the final order in DB. Where can I store/hold (temporary) the cart data per user session in MVC? All MVC samples I saw online save the cart data in DB - not sure why.

MVC presentation layer will be communicating with external web services for pricing and availability of these components, so I can't store only the product IDs to do a lookup for actual product descriptions/prices during the shopping process... I have to store everything in the cart (Product IDs, Descriptions, Prices etc) some place in memory.  My application will be running in WEB FARM environment and cannot use in-process session storage.

Options come to my mind are:


2. Using some kind of Distributed Caching Mechanism to store Session data such as "Windows Server AppFabric"


Best practice to store the shared folder path across the whole application


For example. The folder MEDIA_ROOT must be visible from the whole application, it stores the path of all my media files.

What is the best practice to store such a global variable.

problem in applying SharePoint Designer Workflows to Lists in my Web application


Hi Mark,

I am so happy finding your forum.

I have installed MOSS 2007 with SP2 on a Windows Server 2008. I had no problem in configuring and creating Web Applications and Sites. However, there seems to be a problem in applying SharePoint Designer Workflows to Lists in my Web application. The problem is that the workflow I create to start automatically when an item in the List is changed doesn't work. The workflows works fine if it's started manually from an item in the list, but it's doesn’t work when it's started automatically with an item change in the list. I have checked the workflow on another MOSS 2007 installation on Server 2003 and it works fine. Have I missed something in the configurations?

Thanks for y

Displaying SharePoint lists in Web Parts

When you create a built-in or custom list in Microsoft Windows SharePoint Services, Windows SharePoint Services creates a Web Part, a basic building block of a SharePoint site, to display that list. These Web Parts are called List View Web Parts. Windows SharePoint Services stores List View Web Parts in the site collection Web Part gallery. (The site collection Web Part gallery is the most central gallery of Web Parts for a work group. By default, the gallery name is the name of the site, such as "Our Team Site Web Part Gallery." )

Microsoft's Collaborative Application Markup Language (CAML) Loop

discovered an interesting error recently while working with Microsoft's Collaborative Application Markup Language (CAML) that, surprisingly, had received no ink. Partly what surprises me about this is that the error may require you to rewrite large sections of your code if you haven't previously considered this SharePoint limitation. I'll start with some context, but first of all the error is:

SharePoint Tutorial - Lists

A list is a feature in SharePoint that stores a lists of information. For example, a list can be created to store web links in the human resources team site. A list is usually created for a specific type of information. Lists can contain metadata to describe the particular information in more detail and to make it easier to find.

Integrating a Legacy Web Application in SharePoint

This month we will continue with the theme of deploying Microsoft's SharePoint as a company intranet by describing a method for integrating a legacy Web application inside a SharePoint site.

In many companies the intranet site is not just a home page with announcements. It houses Web applications used by many different departments. In last month's article, I built a page to search the employee table in Northwind (the sample database included in Microsoft's SQL Server). This month, I will move the Web pages used to add/remove records from the table into the SharePoint intranet.
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