473,326 Members | 2,680 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,326 software developers and data experts.

Problem with DataList and updating data

I'm having a bit of a problem with my DataList when I try to update from the
user's input. I've included relevant excerpts at the end of this message. In
the UpdateCommand code, the "PageLevelTextBox" appears to be found (it isn't
returning null), but the Text property is an empty string ("").

Am I missing something really obvious?

Thanks

Colin

private void DeployList_UpdateCommand(object source,
System.Web.UI.WebControls.DataListCommandEventArgs e)
{
int PageLevel, ZoneID;

ZoneID = int.Parse(e.CommandArgument.ToString());
TextBox PageLevelTB =
(TextBox)e.Item.FindControl("PageLevelTextBox");

try
{
PageLevel = int.Parse(PageLevelTB.Text);

Distribution dist = new
Distribution(appEnv.GetConnection());
dist.InsertAtEnd(cid, ver, ZoneID, PageLevel);

DeployList.EditItemIndex = -1;
Bind();
}
catch(Exception ex)
{
Controls.Add(new LiteralControl(ex.Message));
}
}

<edititemtemplate>
<div class="row">
<span class="label" style="width: 35%; text-align: left; ">
<%# DataBinder.Eval(Container.DataItem, "Title") %>
</span>
<span class="formw" style="width: 10%; ">
<asp:linkbutton
commandname="update"
commandargument='<%# DataBinder.Eval(Container.DataItem,
"ZoneID") %>'
text="update"
runat="server"/>
</span>
<span class="formw">
Page:
<asp:textbox
Text='<%# DataBinder.Eval(Container.DataItem, "PageLevel")
%>'
size="2"
id="PageLevelTextBox"
runat="server" />
</span>
</div>
</EditItemTemplate>
Nov 17 '05 #1
0 833

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

Similar topics

0
by: rodneybauer1 | last post by:
hello: thanks in advance for any responses. i dont have a isp at home so have to use public library computer. will check this every couple days though. im using visual basic.Net windows XP with...
3
by: Colin Young | last post by:
I'm having a bit of a problem with my DataList when I try to update from the user's input. I've included relevant excerpts at the end of this message. In the UpdateCommand code, the...
0
by: Alex | last post by:
Imports System Imports System.Data Imports System.Data.SqlClient Imports System.Web.UI Imports System.Web.UI.WebControls Imports System.Configuration Public Class Main : Inherits Page ...
1
by: Glenn Owens | last post by:
Here's the scenario: I have a DataList populated from a datatable sitting inside a fieldset. Each element (row) in the Datalist has the following child controls: asp:checkbox, asp:image,...
2
by: Olav Tollefsen | last post by:
I have a Web Form with a DataList. Inside the ItemTemplate, I have a DropDownList control. <asp:DataList ID="ProductDataList" Runat="server"> <ItemTemplate> <asp:DropDownList ID="DropDownList1"...
0
by: Maran | last post by:
We have come across a situation that I thinks not many have. Grateful for all responses. Regards Maran ************* * Scenario A DataList binds to a DataRow, with "RegionName" och...
2
by: scottls | last post by:
Hi All, Thanks for reading my post. I have been working on getting nested datalists working properly wihtin my framework for many days and I think I'm almost there. See if you could help me...
2
by: mschmidt18 | last post by:
Hello, I am fairly familiar with Web Development with .Net, but i have come across a problem that is giving me some trouble...... I want to have a list of checkboxes where 1) the labels come...
0
by: lamarant | last post by:
OK...I have a datalist that, in each row, has control and a label. What I want to happen is for the text in the label to update when its associated control is clicked. Here's what I have so...
0
by: Bieniu | last post by:
I have DataList control on my own contro land it is bind to SqlDataSource control. My problem is that DataList is getting needed data twice what is for me very strange. I have some code in...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.