473,839 Members | 1,611 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Handling dynamically generated textbox in a datalist

Hi Group,

I am creating a ASP.NET (C#) project.
I am creating a datalist with some dynamically generated text boxes in the
edit template.
I have the datalist control on the form. The text box is written on the form
at run time.
Using Response.Write( ) on the EditTemplate I write the HTML code required
for the text box along with the data and the ID for the text box.

On the Update event of the datalist I try to read the value from the text
box.
I am doing a FindControl (<text box id which was inserted into the HTML
code>).
But I get an 'Object reference not set to an instance of an object' error.

When I put a text box in the EditTemplate of the datalist at the design
time, I can read the values of the data in it.
But the same does not happen when the text box is created on run time...

How can I read the data from the text box created at run time.
Should I use a different method of creating a text box at run time, instead
of writing the HTML code on the form.

Thanks in advance,
Gaurav
Nov 18 '05 #1
0 1222

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

Similar topics

0
1056
by: Barry | last post by:
Hi, I have a sub in a user control that looks like this: Public Sub BatchDetail_ItemCommand(ByVal Sender As Object, ByVal e As DataListCommandEventArgs) Dim cmd As String = CType(e.CommandSource, LinkButton).CommandName Dim senderlist As DataList = CType(Sender, DataList)
1
1382
by: jack | last post by:
Hello, I have a editable DataList, and would like the Edit Button to be appear or not appear dynamically based on the access the logged in person has. I have tried to use the visible=false, with no luck. Any help would be great an example in VB.NET would be the most helpful. Thanks in advance for your time and help,
2
2917
by: Chad | last post by:
I have a problem that I am desperate to understand. It involves dynamically adding controls to a Table control that is built as a result of performing a database query. I am not looking to avoid the problem by avoiding the table control or resorting to databound controls that better manage state for me. I hope to understand how to solve the problem by using the Table web control and sticking to the approach of building the table at run...
4
1680
by: Shiju Poyilil | last post by:
Hello EveryBody, I have a dropdownlist with some values as .net server controls & a button , on clicking a button i need to generate the choosen contorl dynamically. I am giving a small glimpse of my code for your understanding the aspx page has dropdwon list with values as below. <asp:DropDownList id="DropDownList1" runat="server"> <asp:ListItem Value="Label">Label</asp:ListItem> <asp:ListItem...
12
2827
by: scsharma | last post by:
Hi, I am working on creating a webapplication and my design calls for creating main webform which will have menu bar on left hand side and a IFrame which will contain all the forms that are shown when menu items are clicked.Besides these i would like to put a custom status bar. Any error message encountered in any of the webpage will be displayed in the banner. The problem iam encountering is how to access the customer status bar in child...
7
2156
by: Nathan Sokalski | last post by:
I have a page which I dynamically add several usercontrols (*.ascx files) to using the following code: Public Sub Refresh() For Each section As DataRow In Me.GetSections().Rows CType(Me.FindControl("admin" & CStr(section("buttontext")).Replace(" ", "")), adminsection2).RefreshSection() Next End Sub
1
7948
by: terminul | last post by:
Hi I have a datalist which loops through the categories and within the datalist I have a CheckBoxList which are bound on the DataList's OnItemDataBound. The only problem I have is retrieving the values that have been checked when the user submits the form. This code works as far as presentation goes but I can't seem to retrieve the checked values in the various checkboxlists that have been generated on the datalist's OnItemDataBound ...
2
2696
by: mylog | last post by:
Hi all, I am having a small problem on getting the values of the dynamically generated textboxes in C# windows application. I have successfully read an xml file and put its key and value fields as Label and TextBox respectively. Now what I need is the user changes the values in one of the textBox and I need to get that value. The problem is I cannot get the values from the textbox i.e. I don't know how to get the particular textbox value. Can...
1
3779
by: Arielle | last post by:
Background: I have a generated datalist to display information and I need to add the capability to have a button (Edit button) so that users can change the information. I'm sure once I figure it out I'll smack myself on the head for being so stupid but I feel as though right now I'm chasing my tail and want to see if some of yall can point me in a better direction. Initiation public class GroupDetail : WebPart { //... DataList...
0
9696
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10645
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10290
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9425
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...
1
7827
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5681
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
5865
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4063
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3131
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.