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
Mar 25, 2008 18:35
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
Mar 25, 2008 18:47
Vote:
 
Hi Victor Your approach is correct, but you should rephrase your regex pattern into something like this: \
#15453
Mar 25, 2008 18:47
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
Mar 25, 2008 18:47
* 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.