473,387 Members | 1,536 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

how to bind textbox in edititemtemplate in formview

On my page I have FormView control, and I am binding varchar database field to the TextBox that's residing inside a FormView's EditItemTemplate.
Expand|Select|Wrap|Line Numbers
  1. <asp:FormView ID="formview_editfaculty" runat="server" 
  2.         onitemcommand="formview_editfaculty_ItemCommand" 
  3.         onmodechanging="formview_editfaculty_ModeChanging" 
  4.         DataKeyNames="Faculty_ID" > <EditItemTemplate> <asp:Label ID="Label1" runat="server" Text="name"></asp:Label> <asp:TextBox ID="TextBox1" runat="server" Text='<%#Eval("firstname")%>'></asp:TextBox> </EditItemTemplate> <ItemTemplate> <table border="1"> <tr> <td>NAME </td> <td> <asp:Label ID="lblname" runat="server" Text=""><%#Eval("firstname")%>**<%#Eval("lastname") %></asp:Label></td> </tr> <tr> <td> <asp:LinkButton ID="btn_edit" runat="server" Text="Edit" CommandName="Edit"></asp:LinkButton> </td> </tr> </table> </ItemTemplate> </asp:FormView>
  5.  
my problem is that on clicking edit button the textbox is showing blank.what I want is to get the same value which was in itemtemplate "lblname" in the textbox "txtname"

please help!!! I dont know how to do it?
Oct 1 '12 #1
1 2744
please reply to this question...If its not understandable then do tell but please help!!
Oct 2 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: OldNewbie | last post by:
Hello All I have a textbox control. I would like this text box to automatically update to contain the currently selected item located in a listbox which is on the same form. Do I need a...
3
by: MrMike | last post by:
Hi. I have a dataset on my webform which I successfully fill by calling a Sub that occurs after the Page_Load. My question is - I have a textbox control which I need to populate with the contents...
0
by: rbutch | last post by:
hey guys got a question. im trying to bind a textbox "at runtime". im creating the conn string, dataset, dataAdapter etc dynamically. and it keeps erroring out. <asp:TextBox ID="txtDay1"...
1
by: Adam J Knight | last post by:
Hi all, I am assuming there may be a number of ways to bind a text box to a db field using c#. My current approach is: txtPostCode.Text = rdrInstitution.ToString(); Can anyone let me if...
3
by: Jurgen Appelo | last post by:
I asked this question earlier, but unfortunately the two replies I got did not solve the problem. Here it is again, but now with the code: After an Update my FormView always loses its viewstate...
0
by: teclioness | last post by:
Hi, I am using gridview for the user to update rows. In a row, there sre two columns, which need to be updated. When the gridview is to be shown, the row should show the values from database....
3
by: sck10 | last post by:
Hello, I am trying to bind an arraylist to a FormView DropDownList control in the PreRender state. The error that I get is the following: Databinding methods such as Eval(), XPath(), and...
1
by: James | last post by:
Hi all. I'm struggling a bit with this so any help appreciated. (Framework 2.0, VB.net ) I have a text box within an EditItemTemplate, the value of which is bound to my GridView's datasource....
0
by: Dave | last post by:
How can I set the Value of a Textbox that resides in a FormView Insert Template? Thanks
3
by: raamay | last post by:
I have a module where i have specified the connection string as below: Public Function Connection() As String Return "Data Source=192.168.0.1,1433;Network Library=DBMSSOCN;Initial...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.