On Oct 31, 11:57 am, "jx.su...@gmail.com" <jx.su...@gmail.com> wrote:
> On Oct 31, 9:51 pm, onseats...@gmail.com wrote:
>
[quoted text clipped - 10 lines]
>
> Debug it then you can find the reason!
I have run through the debugger. I must be missing something obvious.
Can you be a little more specific?
rote - 31 Oct 2007 23:37 GMT
post some snippet code
> On Oct 31, 11:57 am, "jx.su...@gmail.com" <jx.su...@gmail.com> wrote:
>> On Oct 31, 9:51 pm, onseats...@gmail.com wrote:
[quoted text clipped - 14 lines]
> I have run through the debugger. I must be missing something obvious.
> Can you be a little more specific?
onseats.ky@gmail.com - 01 Nov 2007 01:07 GMT
<asp:ListView ID="lvwTemplates" runat="server"
InsertItemPosition="FirstItem"
OnItemCommand="lvwTemplates_OnItemCommand"
OnItemCanceling="lvwTemplates_OnItemCanceling"
OnItemEditing="lvwTemplates_OnItemEditing"
OnItemInserted="lvwTemplates_OnItemInserted"
OnItemInserting="lvwTemplates_OnItemInserting"
OnItemDeleting="lvwTemplates_OnItemDeleting"
OnItemUpdating="lvwTemplates_OnItemUpdating"
>
<LayoutTemplate>
<div>
<table>
<tr>
<td><asp:Button ID="btnNewTemplate"
runat="server" Text="New Template" OnClick="btnNewTemplate"
CausesValidation="false" /></td>
<td><asp:Button ID="btnBulkEdit"
runat="server" Text="Bulk Edit" OnClick="btnBulkEdit"
CausesValidation="false" /></td>
</tr>
</table>
<div id="elementViewer">
<asp:PlaceHolder ID="itemContainer"
runat="server" />
</div>
</div>
</LayoutTemplate>
<ItemTemplate>
<table width="400px">
<tr>
<td width="325px">
<asp:Label ID="lblTemplateID" runat="server"
Text="<%#((Bullsh1tTemplate)Container.DataItem).TemplateID %>"
Visible="false" />
<asp:Literal ID="ltrTemplate" runat="server"
Text="<%#((Bullsh1tTemplate)Container.DataItem).TemplateBody %>" />
</td>
<td><asp:Button ID="btnEdit" runat="server"
CommandName="edit" Text="Edit"/></td>
<td><asp:Button ID="btnDelete" runat="server"
CommandName="delete" Text="Delete" /></td>
</tr>
</table>
</ItemTemplate>
<EditItemTemplate>
<gaia:Label ID="lblTemplateID" runat="server" Text="<
%#((Bullsh1tTemplate)Container.DataItem).TemplateID %>"
Visible="false" />
<table width="400px">
<tr>
<td width="325px">
<asp:TextBox ID="tbxTemplate" runat="server"
Text="<%#((Bullsh1tTemplate)Container.DataItem).TemplateBody %>" />
<asp:RequiredFieldValidator ID="rfvTemplate"
ControlToValidate="tbxTemplate" Text="required" runat="server"
Display="Dynamic" />
</td>
<td><asp:Button ID="btnUpdate" runat="server"
CommandName="update" Text="Update" /></td>
<td><asp:Button ID="btnCancel" runat="server"
CommandName="cancel" Text="Cancel" CausesValidation="false" /></td>
</tr>
</table>
</EditItemTemplate>
<InsertItemTemplate>
<table width="250px">
<tr>
<td width="325px">
<asp:TextBox ID="tbxTemplate" runat="server" /
<asp:RequiredFieldValidator ID="rfvTemplate"
ControlToValidate="tbxTemplate" Text="required" runat="server"
Display="Dynamic" />
</td>
<td><asp:Button ID="btnInsert" runat="server"
CommandName="insert" Text="Save" /></td>
<td><asp:Button ID="btnCancel" runat="server"
CommandName="cancel" Text="Cancel" CausesValidation="false" /></td>
</tr>
</table>
</InsertItemTemplate>
<EmptyDataTemplate>
This rule is currently empty
</EmptyDataTemplate>
</asp:ListView>
c# code
protected void lvwTemplates_OnItemEditing(object sender,
ListViewEditEventArgs e)
{
ListView listView = (ListView)sender;
TextBox tbx =
listView.FindControl("tbxTemplate")
}
In the sample above tbx gets set to null