CS1026: ) expected error when using IFrame in Content Page

Hi I had the following iframe defined in one of my aspx page.

<iframe id=”MyIframe” src=”http://www.bing.com&#8221; runat=”server” onload=”CallHello();”></iframe> 

The page was working fine. However as soon as I specified the same iframe inside a master page, I started getting following error. 

Compiler Error Message: CS1026: ) expected 
Source Error: 

 Line 4: </asp:Content>
Line 5: <asp:Content ID=”Content2″ ContentPlaceHolderID=”ContentPlaceHolder1″ Runat=”Server”>

Line 6: <iframe ….src=http://www.bing.com….

Line 7: </asp:Content>

Line 8:


So here to resolve the error either remove the runat or onload attribute.



Get value for OptionSet in CRM 2011

To get the value for OptionSet we can use the following function

string GetOptionsSetTextOnValue(IOrganizationService service, string entityName, string attributeName, int selectedValue)

RetrieveAttributeRequest retrieveAttributeRequest = new

EntityLogicalName = entityName,

LogicalName = attributeName,

RetrieveAsIfPublished = true

// Execute the request.

RetrieveAttributeResponse retrieveAttributeResponse =(RetrieveAttributeResponse)
// Access the retrieved attribute.

Microsoft.Xrm.Sdk.Metadata.PicklistAttributeMetadata retrievedPicklistAttributeMetadata =(Microsoft.Xrm.Sdk.Metadata.PicklistAttributeMetadata)

retrieveAttributeResponse.AttributeMetadata;// Get the current options list for the retrieved attribute.
OptionMetadata[] optionList =
string selectedOptionLabel = string.Empty;

foreach (OptionMetadata oMD in optionList)
if (oMD.Value == selectedValue)
{selectedOptionLabel = oMD.Label.UserLocalizedLabel.Label;


return selectedOptionLabel;




Hope it helps !