Click here to Skip to main content
15,896,207 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have visual web part and i am attempting to set custom property unique value on each pages. For example i have two aspx pages. Deal.aspx and Fund.aspx. Both page is having same web part used. When i set the value custom property in web part of Deal.aspx the same value gets reflect in Fund.aspx page web part as well. I read about PersonalizationScope but it did not help for my scenario. Below is the custom property i have created.

public static string ListName;
[Category("Extended Settings"),
Personalizable(PersonalizationScope.User),
WebBrowsable(true),
WebDisplayName("Enter List Name"),
WebDescription("Please Enter a List Name")]

public string _ListName
{
get { return ListName; }
set
{
// Sample Validation
Regex oRegEx = new Regex("[a-zA-Z]+");
if (!oRegEx.IsMatch(value))
throw new Microsoft.SharePoint.WebPartPages.
WebPartPageUserException(
"Please enter alphabeth characters only");
ListName = value;
}
}

I will highly appreciate the help. Any thoughts ?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900