平常我个人开发页面时,一般用width都是100%的,所以用frameset起来就没有什么问题,但是后来我突然需限制宽度为1024,糟了,frameset设定style都不起作用了!
那怎么办呀?一种方法是使用table+iframe,但是做起来还比较麻烦,如果在我们已有的frameset中加工呢?呵呵,如下:
原先代码:
<frameset rows="50,*,50">
<frame></frame>
<frame></frame>
<frame></frame>
</frameset>这样默认应该是width 100%的,现在要限制为1024,只需要几行代码,如下:
<frameset cols="*,1024,*">
<frame src="about:blank"></frame>
<frameset rows="50,*,50">
<frame></frame>
<frame></frame>
<frame></frame>
</frameset>
<frame src="about:blank"></frame>
</frameset>
Ext.Notification.Show(new Notification.Config
{
Title = "<a herf='#'>提示信息</a>",
BringToFront = true,
AlignCfg = new Notification.AlignConfig
{
OffsetX = -10,
OffsetY = -10,
El = ViewPort1.ClientID // 这个是布局的外框架的ID,你随便整。
},
Html = "您当前没有未提交的工程!"
});
在部署SILVERLIGHT站点时,需要能够修改WCF服务的地址,在网上搜索了多篇文章,程序改造成功。过程总结如下
1.在WEB.CONFIG中添加配置节点
<appSettings>
<add key ="WCFServiceAddress" value ="http://192.168.100.107/ProspectTaskWcfService/SilverLight_Service.svc"/>
</appSettings >
2.在host Silverilght 的aspx页面中添加<param name="initParams" vaule=""/>,添加完成后,如下所示:
我们要是想给SILVERLIGHT传点别的什么东西,也可以用这种方式
<param name="source" value="ClientBin/Jurassic.ProspectTask.Web.Control.WorkPlan.xap"/> <param name="onerror" value="onSilverlightError" /> <param name="background" value="white" /> <param name="minRuntimeVersion" value="3.0.40624.0" /> <param name="autoUpgrade" value="true" /> <param name="initParams" value="wcfServiceUrl=<%=ConfigurationManager.AppSettings["WCFServiceAddress"] %> " />
如果要在initParams中传入多个参数,可以在参数与参数之间有,隔开。如:关键字a=值a,关键字b=值b
3.在SilverLight工程下App.xmal.cs中,添加属性CustomConfigurations,并修改事件Application_Startup。如下所示
private IDictionary<string, string> _customConfigurations;
public IDictionary<string, string> CustomConfigurations
{
get { return _customConfigurations; }
}
public App()
{
this.Startup += this.Application_Startup;
this.Exit += this.Application_Exit;
this.UnhandledException += this.Application_UnhandledException;
InitializeComponent();
}
private void Application_Startup(object sender, StartupEventArgs e)
{
_customConfigurations = e.InitParams;
this.RootVisual = new MainPage();
}
4.在SilverLight工程中添加一个新CLASS,用于返回一个连接的实例
public class WcfService
{
public WcfService()
{
}
public SilverService.SilverLightClient GetWCF()
{
App application = (App)Application.Current;
string url = application.CustomConfigurations["wcfServiceUrl"];
BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.None);
binding.MaxReceivedMessageSize = int.MaxValue;
binding.MaxBufferSize = int.MaxValue;
//
SilverService.SilverLightClient client = new SilverService.SilverLightClient(binding, new EndpointAddress(new Uri(url)));
return client;
}
}
在我们需要调用WCF服务时,就可通过上边的方法获取实例了
WcfService wcf = new WcfService();
SilverService.SilverLightClient client = wcf.GetWCF();
client.UpdatePlanCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(OnCompleted);
client.UpdatePlanAsync(_planEntity);
文章来自学IT网:http://www.xueit.com/html/2011-05/111-7254361172011513153445656.html
Textbox验证
AllowBlank=“false”必填项,EmptyText =“必须输入联系人”。使用默认信息就可以了。
数值其他类型验证
Vtype 属性 等于 email时 是对email 格式验证
等于 url 时 对url 验证
等于 alpha //只能输入字母,无法输入其他(如数字,特殊符号等)
等于 alphanum//只能输入字母和数字,无法输入其他
属性MinLength 最小长度 属性MaxLength 最大长度
Email 类型验证
<ext:TextField ID="TextField2" runat="server" Vtype=” email”> </ext:TextField>
正则表达式验证
<ext:TextField ID="TextField2" runat="server" Regex="^[1-9]\d*$" > </ext:TextField>
匹配特定数字:
^[1-9]\d*$ //匹配正整数
^-[1-9]\d*$ //匹配负整数
^-?[1-9]\d*$ //匹配整数
^[1-9]\d*|0$ //匹配非负整数(正整数 + 0)
^-[1-9]\d*|0$ //匹配非正整数(负整数 + 0)
^[1-9]\d*\.\d*|0\.\d*[1-9]\d*$ //匹配正浮点数
^-([1-9]\d*\.\d*|0\.\d*[1-9]\d*)$ //匹配负浮点数
^-?([1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0)$ //匹配浮点数
^[1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0$ //匹配非负浮点数(正浮点数 + 0)
^(-([1-9]\d*\.\d*|0\.\d*[1-9]\d*))|0?\.0+|0$ //匹配非正浮点数(负浮点数 + 0)
Number 类型过滤
<ext:TextField ID="TextField2" runat="server" MaskRe="/[0-9\$\.]/"> </ext:TextField>
电话号码格式过滤
<ext:TextField ID="TextField2" runat="server">
<lugins>
<ux:InputTextMask Mask="(99) 9999-9999"></ux:InputTextMask>
</Plugins>
</ext:TextField>
手机格式
<ext:TextField ID="TextField2" runat="server">
<lugins>
<ux:InputTextMask Mask="0999-999-999"></ux:InputTextMask>
</Plugins>
</ext:TextField>
Fax格式
<ext:TextField ID="TextField2" runat="server">
<lugins>
<ux:InputTextMask Mask="99-9999-9999"></ux:InputTextMask>
</Plugins>
</ext:TextField>
ABN and ACN 格式
<ext:TextField ID="TextField2" runat="server">
<lugins>
<ux:InputTextMask Mask="99-999-999-999"></ux:InputTextMask>
</Plugins>
</ext:TextField>
两个时间控件时间间隔设置
<extateField runat="server" ID="FromDate" Vtype="daterange" FieldLabel="To">
<Listeners>
<Render Handler="this.endDateField = '#{ToDate}'" />
</Listeners>
</extateField>
<extateField runat="server" ID="ToDate" Vtype="daterange" FieldLabel="From">
<Listeners>
<Render Handler="this.startDateField = '#{FromDate}'" />
</Listeners>
</extateField>