Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. plz help me, create and post form on runtime

plz help me, create and post form on runtime

Scheduled Pinned Locked Moved ASP.NET
helpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mogaambo
    wrote on last edited by
    #1

    How can I create a form at runtime and submit it in code behind, all the below code is created on runtime and submitted too in test.aspx. how can i achieve that.

    K 1 Reply Last reply
    0
    • M Mogaambo

      How can I create a form at runtime and submit it in code behind, all the below code is created on runtime and submitted too in test.aspx. how can i achieve that.

      K Offline
      K Offline
      KennyPatel
      wrote on last edited by
      #2

      :rose:Dear Friend, Try this Code into your some button click from where you want to create new aspx page. Some BUTTON_CLICK(sender,event) { StreamWriter sw=new StreamWriter(Server.MapPath("PTells.aspx")); StringBuilder sb = new StringBuilder(); sb.AppendLine("<%@ Page Language='C#' %>"); sb.AppendLine("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>"); sb.AppendLine("<script runat='server'>"); sb.AppendLine("</script>"); sb.AppendLine("<html xmlns='http://www.w3.org/1999/xhtml'>"); sb.AppendLine("<head runat='server'><title>Untitled Page</title></head><body>"); sb.AppendLine("<form id='form1' runat='server'><div>"); sb.AppendLine("<div><asp:TextBox ID='TextBox1' runat='server'></asp:TextBox>"); sb.AppendLine("<asp:Button ID='Button1' runat='server' Text='Button'/></div></div></form></body></html>"); sw.Write(sb.ToString()); sw.Close(); Response.Redirect("PTells.aspx"); } I hope this will helps you. Thanks :laugh:

      "Good Thing Goes With Good People..."

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups