Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 17th, 2007, 07:43 AM
Authorized User
 
Join Date: Mar 2007
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default placeholder controls

Deal all,

im generating textbox control dynamically at run time and place it on placeholder control....
now i want to insert some text into that textbox and update that text to database....

how can i do this???

Please help me...

 
Old May 17th, 2007, 07:51 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Loop through the placeholders Control collection:

VB
For Each ctrl as Control in Placeholder.Controls
  If TypeOf ctrl is TextBox then
     Dim txt as TextBox = CType(ctrl, TextBox)
     txt.Text = "foo"
  End If
Next

C#
foreach(Control ctrl in Placeholder.Controls)
{
   if(ctrl is TextBox)
   {
      TextBox txt = (TextBox)ctrl;
      txt.Text = "foo";
   }
}

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
 
Old May 17th, 2007, 07:58 AM
Authorized User
 
Join Date: Mar 2007
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i can insert text into text box....

but i cant use that text for inserting it to database with insert quary....

suppose im inserting text: hello world
now i want to insert that text to database...

how can i get that text for further use??

 
Old May 17th, 2007, 08:11 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

I don't understand what you mean. The methods i provided above will let you write values to the text box, so, if you want to READ values from the text box you would just change the method around:

string foo = txt.Text;
Dim foo as String = txt.Text;

Then you just send that data to your database methods.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
Placeholder grstad ASP.NET 2.0 Basics 6 May 23rd, 2008 09:03 AM
Navigate away from a Content Placeholder slbibs SharePoint Development 0 September 4th, 2007 03:28 PM
Can we add same gridview in Placeholder Control KamalRaturi ASP.NET 2.0 Professional 2 November 10th, 2006 10:07 AM
placeholder controls -- pulling data Fubar ASP.NET 1.0 and 1.1 Professional 6 September 8th, 2005 09:08 AM
Problems with placeholder and textboxes sean ASP.NET 1.0 and 1.1 Professional 0 January 13th, 2004 11:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.