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. Custom Web Control Craziness

Custom Web Control Craziness

Scheduled Pinned Locked Moved ASP.NET
questionhtmlsysadminhelptutorial
1 Posts 1 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.
  • G Offline
    G Offline
    gekoscan
    wrote on last edited by
    #1

    I want to create a custom control that has 3 text fields. How would I go about doing it this way. protected override void Render(HtmlTextWriter output) { StringBuilder s = new StringBuilder(); //Note I realize the opening tag for the asp:TextBox is missing but it wouldn't show in the forum the other way. s.Append(""); s.Append(""); s.Append(""); s.Append(""); output.Write(s.ToString()); } In my .ascx I have the follow overloaded function.. My table layout is a lot more advanced involving custom images and tables within tables but I am using this an a simple example. Now usually this is done with something similar to what is below. But my table html code is just to complex to get into creating the table like this. How can I use my code above to create a table but then somehow render it as a control? `TextBox txtUsername; protected override void CreateChildControls() { table = new Table(); TableRow tr = new TableRow(); TableCell td; td = new TableCell(); txtUsername = new TextBox(); td.Controls.Add(txtUsername); tr.Controls.Add(td); }` Thanks for your help everyone. Steve Nelson asp:TextBox id=textbox1 runat=server> asp:TextBox id=textbox2 runAt=server> asp:TextBox id=textbox3 runAt=server>

    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