6 March 2014

aspx page creation code

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace WindowsFormsApplication1
{
    public partial class createaspx : Form
    {
        public createaspx()
        {
            InitializeComponent();
        }
        StreamWriter sw;

        private void create_Click(object sender, EventArgse)
        {
            sw = File.CreateText(@"E:\hello.aspx");
            sw.WriteLine("<html>");
            sw.WriteLine("<form runat=\"server\">");
            sw.WriteLine("<asp:button text=\"hello\" runat=\"server\"></asp:button>");
            sw.WriteLine("</form>");
            sw.WriteLine("</html>");
            sw.Close();
            System.Diagnostics.Process.Start(@"E:\hello.aspx");
        }
    }
}

No comments:

Post a Comment