码迷,mamicode.com
首页 > Web开发 > 详细

在VS2008.Net下使用WPF开发Web应用程序

时间:2014-07-22 23:12:15      阅读:325      评论:0      收藏:0      [点我收藏+]

标签:blog   http   使用   os   io   art   

原文地址:http://hankjin.blog.163.com/blog/static/33731937200922353623434/

胖客户端的好处是可以轻易的实现绚丽的效果, 而瘦客户端则需要大量的js才能实现相应的效果.
而且当需要同时开发应用程序和Web应用程序时,
则需要将近双倍的开发时间.
但是,在VS2008.Net下使用WPF技术, 则不但可以轻松地在Web上实现应用程序的效果,
而且可以很简单的将应用程序转换成Web应用程序.
1. 新建->项目->WPF Web Application
2.
修改Page1.xaml
<Page x:Class="WPFWebTest.Page1"
   
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   
Title="Page1">
    <Grid>
        <StackPanel>
       
    <TextBox Name="tbName"/>
            <Button Name="btnWelcome"
Click="btnWelcome_Click" Content="Hi"/>
            <Label
Name="lblWelcome"/>
        </StackPanel>
   
</Grid>
</Page>
3. 修改Page1.xaml.cs
    public partial class
Page1 : Page
    {
        public Page1()
        {
           
InitializeComponent();
        }

        private void
btnWelcome_Click(object sender, RoutedEventArgs e)
        {
           
lblWelcome.Content = "Welcome " + tbName.Text;
        }
    }
3.
Build->Publish
注意, 只能使用IE浏览器.

在VS2008.Net下使用WPF开发Web应用程序,码迷,mamicode.com

在VS2008.Net下使用WPF开发Web应用程序

标签:blog   http   使用   os   io   art   

原文地址:http://www.cnblogs.com/CocoWang/p/3700149.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!