473,831 Members | 2,420 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

changing template textbox value of DetailView Control through Code ?

The detailview control is combination of textboxes and labels, while
detailview is in edit mode, how can I change the textbox value through code
?

For example:

My detailView has following fields.

Code : Label1
Name : Textbox1
Amount: Textbox2

I click the Edit Link Button of DetailView, now I want to put some
calculation and want to display in the Textbox2. But as textbox2 is a part
of dataview Template, so it cannot be accessed via form directly, how can I
?

Best Regards,

Luiqman
Nov 16 '06 #1
1 3076
Solution to my problem is :

Dim myTotal as Int16

myTotal=16*32

CType(DetailsVi ew1.FindControl ("txtAmount" ), TextBox).Text=m yTotal

Best Regards,

Luqman

"Luqman" <pe*******@cybe r.net.pkwrote in message
news:ev******** ******@TK2MSFTN GP06.phx.gbl...
The detailview control is combination of textboxes and labels, while
detailview is in edit mode, how can I change the textbox value through
code ?

For example:

My detailView has following fields.

Code : Label1
Name : Textbox1
Amount: Textbox2

I click the Edit Link Button of DetailView, now I want to put some
calculation and want to display in the Textbox2. But as textbox2 is a part
of dataview Template, so it cannot be accessed via form directly, how can
I ?

Best Regards,

Luiqman


Nov 19 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1899
by: 42 | last post by:
I implemented a simple class inherited from Page to create a page template. It simply wraps some trivial html around the inherited page, and puts the inherited page into a form. The problem I have run into is that the emitted html at the end of the process is slightly different and doesn't work. Please don't be put off by all the source code. All the guts are in this first base class, and it doesn't do much. The rest is trivial...
3
2831
by: vivela | last post by:
hi, I hope you could help me out on this one,cause I have been trying for 4 days to solve it,but couldn't quite get it right: I have an ASP textbox that should change the value in a dropdownlist. this happens,but the problem is with the validation of the ddl.it has a requiredfieldvalidator,and the error message disapears only if i select a value from the dropdownlist,even though it should also disapear when I write a valid name in the...
2
3772
by: Luqman | last post by:
Hi, Any Idea how to Display Todays Date in DetailView Template Field while Inserting ? For example: When I click on New Button of DetailView Control, I need to display Today's Date in a Template Field text box. I tried following in DetailView1_ModeChanged Event but could not succeed. Protected Sub DetailsView1_ModeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DetailsView1.ModeChanged
2
1579
by: Luqman | last post by:
I have coded in Textbox_changed Event: If CType(txtVoucherNo.Text, Long) = 0 Then Me.DetailsView1.ChangeMode(DetailsViewMode.Insert) Me.DetailsView1.AutoGenerateInsertButton = True Me.DetailsView1.AutoGenerateEditButton = True
4
4903
by: John Kotuby | last post by:
Hi all, I have a simple user-form which accepts contact and profile information for the user to edit and save. All the textboxes are working fine and displaying the expected data, both when the screen is first displayed and after a save of changed data. The text boxes are being populated during the Page_Load event. However, when I change the TextMode property to PassWord, as I have 2 password textboxes (one for confirmation) no data...
1
2625
by: zergziad | last post by:
Hi All, I really need help to solve my problem. My case is on looping through textbox in gridview. I had a gridview placed in my page. The gridview contains template field which I created it during runtime. I also had a generic list to fetch few items. Number of item that i got from the list will be the number of template that being created during runtime(eg : if the list return 3 items, meaning there will be 3 template field created)....
4
11018
by: Craig Buchanan | last post by:
I dynamically add data-bound templates to a gridview in my ascx control. while this works correctly when the gridview is databound to the datatable, i'm having issues on postback. i would like to iterate thru the gridview's rows, examine the databound controls, then perform a database action. for some reason, i can't find the controls. i have a two templates: one that uses a label the other uses a textbox to display data. when the...
8
5154
by: mike_solomon | last post by:
I have a button <input type="submit" name="Delete" value="Delete"> This code can not be changed I want to use Javascript to change the type I tried:
3
2814
by: Crazy Cat | last post by:
Hi all, I am developing an asp.net 2.0 application in Visual Studio 2005. On my page I have a simple datalist that is bound programmatically to a collection of simple objects. On this page I need to control the visibility of a textbox based on a dropdown selection in the datalist's edititem template. To do this, I registered a client script block function and attached a client side handler for the dropdownlist's onchange event in the...
0
9794
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10778
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9319
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6951
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5622
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5788
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4419
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3967
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3077
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.