您的位置:首页 > 其它

SharePoint自带Silverlight WebPart中文输入问题处理

2011-03-21 16:44 274 查看
开发了SilverLight程序在SharePoint上使用,为了省事,就直接用了SharePoint自带的WebPart。可是在用的时候发现TextBox中文不能输入,网上一查,居然说2.0/3.0版本有这样的问题,不知道4.0有没有解决呢。在网上找到的解决办法都是直接去修改HTML里Object对象的Windowless属性,是在
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param name="windowless" value="false"/>

可是在SharePoint中的SilverLight WebPart属性设置面板里找不到该属性。用Reflector看了下这个WebPart,其实是有个属性叫WindowlessMode的,只不过特性里没加可视化显示出来。
View Code

<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="Microsoft.SharePoint.WebPartPages.SilverlightWebPart, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral,

PublicKeyToken=71e9bce111e9429c" />
<importErrorMessage>无法导入此 Web 部件。</importErrorMessage>
</metaData>
<data>
<properties>
<property name="HelpUrl" type="string" />
<property name="AllowClose" type="bool">True</property>
<property name="ExportMode" type="exportmode">All</property>
<property name="Hidden" type="bool">False</property>
<property name="AllowEdit" type="bool">True</property>
<property name="Direction" type="direction">NotSet</property>
<property name="TitleIconImageUrl" type="string" />
<property name="AllowConnect" type="bool">True</property>
<property name="HelpMode" type="helpmode">Modal</property>
<property name="CustomProperties" type="string" null="true" />
<property name="AllowHide" type="bool">True</property>
<property name="Description" type="string">A web part to display a Silverlight application.</property>
<property name="CatalogIconImageUrl" type="string" />
<property name="MinRuntimeVersion" type="string" null="true" />
<property name="ApplicationXml" type="string" />
<property name="AllowMinimize" type="bool">True</property>
<property name="AllowZoneChange" type="bool">True</property>
<property name="CustomInitParameters" type="string">windowless="false"</property>
<property name="Height" type="unit">600px</property>
<property name="ChromeType" type="chrometype">Default</property>
<property name="Width" type="unit" />
<property name="Title" type="string">Silverlight Web Part</property>
<property name="ChromeState" type="chromestate">Normal</property>
<property name="TitleUrl" type="string" />
<property name="Url" type="string">/_LAYOUTS/ClientBin/xxxxx/xxxxxxx.xap</property>
<property name="WindowlessMode" type="bool">False</property>
</properties>
</data>
</webPart>
</webParts>


四、上传修改后的WebPart文件



五、插入修改后的web部件,试一试,输入中文OK了。



另外再说下那个CustomInitParameters,自定义初始化参数,设置方式需要处理分隔符,"key1=value1,key2=value2,key3=value3"。是应用程序级的初始化参数,可以是背景、颜色等,可以在程序中获得使用。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: