Try our conversational search powered by Generative AI!

Searching the HTML code of the MainBody

Vote:
 
Hello, I was wondering how I could access the html for the MainBody property. I am basically trying to find part of the code using regular expressions but when i use the CurrentPage["MainBody"].ToString(), I don't get the html code. string strMainBody = CurrentPage["MainBody"].ToString(); string ImageRegEx = "([^>]+)"; Match m = Regex.Match(strMainBody, ImageRegEx); Label1.Text = "Label" + m.ToString(); Thanks. Victor
#13134
Jul 31, 2007 16:45
Vote:
 
Is it that you don't get the HTML from the property or is it the RegExp that doesn't work? Regards HAXEN
#15452
Aug 01, 2007 10:05
Vote:
 
Hi Victor Your approach is correct, but you should rephrase your regex pattern into something like this: \
#15453
Aug 01, 2007 12:29
Vote:
 
You need to access the MainBody property as a PropertyLongString i order to get hold of the HTML code. PropertyLongString mainBody = (PropertyLongString)CurrentPage.Property["MainBody"];
#15454
Aug 01, 2007 14:57
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.