Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics 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 July 30th, 2008, 04:09 AM
Registered User
 
Join Date: Jul 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to Bind the HTML-Textbox Value in Detailsview


Hi Guys
I am Created one DetailsView to insert the Record.In detailsview using <Templatefield > I am created one HTML-Textbox[Not asp:textbox].ie,
<asp:TemplateField HeaderText="PatientName" SortExpression="name" >
<InsertItemTemplate>
<input id="patientName" runat="server" type="text" name="patientName" style="height:18px" /> </InsertItemTemplate></asp:TemplateField>
Remaining fields are BoundFields,I am specify the datafields for bounds field .But I don't know how to perform the Binding operation for that HTML-TextBox Field.How to get the html textbox text and insert into database.Please tell I am trying this nearly Two days..Give the sample code in C#...


 
Old July 30th, 2008, 04:34 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post
Default

As far as I know you cannot do what you are trying to do easily since the ASP.NET controls take care of the rendering for you (i.e. when it evaluates the data at runtime and changes the resultant HTML accordingly).

If you have a plain old HTML textbox, then you need to update its value manually (via JavaScript) since the server is not aware of its existance (since its plain HTML) so how do you think it can bind to what it doesnt know about?

Why are you trying to implement the code in this fashion?

PS: My mummy always told me the two words "please" and "thankyou" go a really long way..

Edit:
Just noticed the runat="server" in the TextBox declaration, note that this will allow you to change the textbox's text at runtim, but I dont think it will work with DataBinding..

Rob
http://cantgrokwontgrok.blogspot.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot bind from DropDownList to DetailsView kiekar ASP.NET 2.0 Basics 0 February 19th, 2008 09:26 PM
Bind result set to Html Div Controls jazzcatone ASP.NET 1.0 and 1.1 Basics 1 August 10th, 2006 07:35 AM
html tags in asp:textbox sureshbabu VS.NET 2002/2003 2 May 3rd, 2006 12:30 AM
How To Type the text of html tag in TextBox 6cet6 ASP.NET 1.0 and 1.1 Basics 3 November 6th, 2003 05:30 AM





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