Click here to Skip to main content
15,924,507 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Stumped on IsDBNull on SQLDataReader Pin
Kelly Herald21-Jun-06 14:44
Kelly Herald21-Jun-06 14:44 
GeneralRe: Stumped on IsDBNull on SQLDataReader Pin
AaronM_NZ21-Jun-06 15:12
AaronM_NZ21-Jun-06 15:12 
QuestionTreeView SelectedNodeChanged [modified] Pin
maizhiming21-Jun-06 12:57
maizhiming21-Jun-06 12:57 
AnswerRe: TreeView SelectedNodeChanged Pin
minhpc_bk21-Jun-06 20:42
minhpc_bk21-Jun-06 20:42 
GeneralRe: TreeView SelectedNodeChanged Pin
maizhiming22-Jun-06 6:09
maizhiming22-Jun-06 6:09 
QuestionListener on ENTER button Pin
Chandman21-Jun-06 11:41
Chandman21-Jun-06 11:41 
AnswerRe: Listener on ENTER button Pin
Edbert P21-Jun-06 14:54
Edbert P21-Jun-06 14:54 
QuestionLoadTemplate of EditItemTemplate gives error "object reference not set to an instance ..." Pin
gulllet21-Jun-06 10:28
gulllet21-Jun-06 10:28 
Confused | :confused: I don't get the loading of an EditItemTemplate to work.

When I try to get the TextBox with FindControl from within the editTemplate I get the error message "Object reference not set to an instance of an object".

When I simply add the editItemTemplate in the .aspx-file it works fine, but not when it's loaded from file. This is how my code looks like:

<code> protected void Update_command(Object sender, DataListCommandEventArgs e)
{
error---> row["Description"] = ((TextBox)e.Item.FindControl("txtDescription")).Text;
}


protected void Page_Init(object sender, EventArgs e)
{
//om man är inloggad skall man ladda in ett annat template för datalistan med ändra-länk
if (Session["loggedIn"] != null && (bool)Session["loggedIn"] == true)
{
listItems.ItemTemplate = Page.LoadTemplate("productItemTemplate.ascx");
listItems.EditItemTemplate = Page.LoadTemplate("productEditItemTemplate.ascx");
}
}</code>
content of file productEditItemTemplate.ascx:
<code>Change article:
<asp:TextBox ID="txtDescription" runat="server" Text=' <%# Eval( "Description") %> ' ></asp:TextBox><br />
Image file: <asp:TextBox ID="txtImage" runat="server" Text=' <%# Eval("Image") %> ' ></asp:TextBox><br />
Price: <asp:TextBox ID="txtPrice" runat="server" Text=' <%# Eval("Price") %> ' ></asp:TextBox><br />

<asp:LinkButton ID="btnOk" runat="server" Text="OK" CommandName="update" />
<asp:LinkButton ID="btnDelete" runat="server" Text="Delete" CommandName="delete" />
<asp:LinkButton ID="btnCancel" runat="server" Text="Cancel" CommandName="cancel" /></code>Grateful for any help on this subject!

Gulllet
AnswerRe: LoadTemplate of EditItemTemplate gives error "object reference not set to an instance ..." Pin
minhpc_bk21-Jun-06 16:44
minhpc_bk21-Jun-06 16:44 
GeneralRe: LoadTemplate of EditItemTemplate gives error "object reference not set to an instance ..." Pin
gulllet22-Jun-06 1:31
gulllet22-Jun-06 1:31 
QuestionIntegrating ASP site with ASP.net 2.0 pages Pin
Keith Goddard21-Jun-06 10:03
Keith Goddard21-Jun-06 10:03 
AnswerRe: Integrating ASP site with ASP.net 2.0 pages Pin
Edbert P21-Jun-06 15:01
Edbert P21-Jun-06 15:01 
QuestionCan i limit the the files an XML control can open at run time? Pin
Red_Wizard_Shot_The_Food21-Jun-06 9:59
Red_Wizard_Shot_The_Food21-Jun-06 9:59 
QuestionFlash like graphics in Asp .NET Pin
mikeyhardingboyo21-Jun-06 6:45
mikeyhardingboyo21-Jun-06 6:45 
AnswerRe: Flash like graphics in Asp .NET Pin
RichardGrimmer22-Jun-06 5:03
RichardGrimmer22-Jun-06 5:03 
Questionscript for capturing log files Pin
sujaynath21-Jun-06 6:18
sujaynath21-Jun-06 6:18 
AnswerRe: script for capturing log files Pin
RichardGrimmer22-Jun-06 5:05
RichardGrimmer22-Jun-06 5:05 
GeneralRe: script for capturing log files Pin
sujaynath23-Jun-06 5:49
sujaynath23-Jun-06 5:49 
Questionhow to disable option in the SELECT tag in IE Pin
YossiKahlon21-Jun-06 5:07
YossiKahlon21-Jun-06 5:07 
AnswerRe: how to disable option in the SELECT tag in IE Pin
Guffa21-Jun-06 5:58
Guffa21-Jun-06 5:58 
QuestionResponse is not well-formed XML Pin
Rodoxdolfo21-Jun-06 4:23
Rodoxdolfo21-Jun-06 4:23 
Questionsecurity in Forms Authentication Pin
PKKSuomi21-Jun-06 3:59
PKKSuomi21-Jun-06 3:59 
AnswerRe: security in Forms Authentication Pin
minhpc_bk21-Jun-06 16:03
minhpc_bk21-Jun-06 16:03 
GeneralRe: security in Forms Authentication Pin
PKKSuomi21-Jun-06 21:34
PKKSuomi21-Jun-06 21:34 
Questionhow to peroform some action items when page unloads? Pin
YossiKahlon21-Jun-06 3:59
YossiKahlon21-Jun-06 3:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.