Solved

Convert concatenated string to a Profile Section

Posted on 2014-01-20
3
170 Views
Last Modified: 2014-02-05
Hi

I have 2 similar groups in my Web.config

<group name="SiteGroupPreferences_1"> & <group name="SiteGroupPreferences_2">

From my code is it possible to concatate SiteGroupPreferences and 1 or 2 such that I can still reference the profile sections.

SiteGroupPreferences = "SiteGroupPreferences"  + 1
Location_ID = Profile.SiteGroupPreferences.Location_ID

OR

SiteGroupPreferences = "Profile.SiteGroupPreferences_" + "1" + ".Location_ID"
Location_ID = SiteGroupPreferences


Is there a way to d o this

Andy
0
Comment
Question by:Andy Green
3 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 39795343
You cannot concatenate in the web.config file.
0
 
LVL 34

Accepted Solution

by:
Paul MacDonald earned 500 total points
ID: 39795488
You might be able to do something like...

Location_ID = Profile.GetProfileGroup("SiteGroupPreferences"  & "1").Location_ID

Slightly more information here:   http://msdn.microsoft.com/en-us/library/system.web.profile.profilebase.getprofilegroup(v=vs.110).aspx?cs-save-lang=1&cs-lang=vb#code-snippet-1
0
 
LVL 3

Author Closing Comment

by:Andy Green
ID: 39834905
Excellent Thank you. Soz for delay in accepting been on holiday:-)

Andy
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now