Click here to Skip to main content
15,905,874 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
how to create ,Build n publish a new aspx and its code behind page?

Wat i want is
for example :
i have a project name as mydemoproject.csproj.
In this project i having a page(creativepage.aspx and its codebehind)
the creativepage.aspx design like this,

HTML
NewPageName:  <input type="text" id="textbox1"  value="" />
Location Name:<input type="text" id="textbox2"  value="" />

              <input type="Button" value="CreatePage"  />
              <input type="Button" value="Build"  />


When textbox1 ,textbox2 values entered and clicked the CreatePage button,
a new Aspx n its codebehind page(newpage name from textbox1) have to created in the mentioned location Name (Not add with this project(mydemoproject.csproj))

After tat when i click the Build Button ,from the mentioned location Name its Builds the newpage.aspx.cs (to create dll)

How to achieve this ?Please instruct a way to reach this
Posted

1 solution

You can do the following
C#
NewPageName:  ;input type="text" id="textbox1"  value="" />
Location Name;input type="text" id="textbox2"  value="" />
 
              ;input type="Button" value="CreatePage" id="Createpage"  />
              ;input type="Button" value="Build" id="build" />


In creativepage.aspx.cs
add the following code:
C#
        protected void Createpage_Click(object sender, EventArgs e)
Response.Redirect("~/Createpage.aspx")


and in the solutionExplorer rightclick on the project mydemoproject -->addnew item-->webForm-->name that webform as Createpage

You can do for the other also in the same fashion
 
Share this answer
 
Comments
jawaharraj89 6-Dec-12 2:29am    
i want to create a newpage programmcatically

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900