I am using the below code in my .Net Application
DataControlDetailDescriptor dataControlDetail = new DataControlDetailDescriptor();
dataControlDetail.Name = "Solvent System";
while executing the code, I am getting an error as 'Solvent System' is not a valid value for property 'Name'
The problem is that 'Solvent System' contains a space in between which throws the error. So please let me know how this can be resolved since we are using the string with spaces in different places in our application.
The Name property, which you set in your code, is inherited from the standard FrameworkContentElement class. It does not support certain symbols and throws an exception when you use an invalid value. You can reproduce this common behavior with standard classes:
new FrameworkContentElement().Name = "Solvent System"; new Button().Name = "Solvent System";
Frankly speaking, it's not clear why you need to use space symbols in control names. The Name property value does not appear in the UI, so you can change it without affecting the UI.