PC Review


Reply
Thread Tools Rate Thread

Can someone help with this response.text?

 
 
TN Bella
Guest
Posts: n/a
 
      13th Jul 2004
Hello,
I don't know why I keep getting this error. I have 15 of each txtacctnum
(txtacctnum - txtacctnum14), txtcostcntr, txtrefnum, and txtacctamt.
Some of the inputs are null, so I don't want to display unless there is
a value. Can someone please help?

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.
Here is my code:

Dim index as Integer
For index=0 To 14

litResponse.text +="<b>Account Number</b>: " &
CType(Me.FindControl("txtAcctNum" & index.ToString()), TextBox).text &
"<br>"
litResponse.text +="<b>Cost Center</b>: " &
CType(Me.FindControl("txtCostCntr" & index.ToString()), TextBox).text &
"<br>"
litResponse.text +="<b>Account Number</b>: " &
CType(Me.FindControl("txtRefNum" & index.ToString()), TextBox).text &
"<br>"
litResponse.text +="<b>Account Number</b>: " &
CType(Me.FindControl("txtActAmt" & index.ToString()), TextBox).text &
"<br>"
Next

Thank you.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
Scott M.
Guest
Posts: n/a
 
      13th Jul 2004
How about this:

litResponse.text +="<b>Account Number</b>: " & CType(("txtAcctNum" &
index),TextBox).text & "<br>"



"TN Bella" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hello,
> I don't know why I keep getting this error. I have 15 of each txtacctnum
> (txtacctnum - txtacctnum14), txtcostcntr, txtrefnum, and txtacctamt.
> Some of the inputs are null, so I don't want to display unless there is
> a value. Can someone please help?
>
> Object reference not set to an instance of an object.
> Description: An unhandled exception occurred during the execution of the
> current web request. Please review the stack trace for more information
> about the error and where it originated in the code.
>
> Exception Details: System.NullReferenceException: Object reference not
> set to an instance of an object.
> Here is my code:
>
> Dim index as Integer
> For index=0 To 14
>
> litResponse.text +="<b>Account Number</b>: " &
> CType(Me.FindControl("txtAcctNum" & index.ToString()), TextBox).text &
> "<br>"
> litResponse.text +="<b>Cost Center</b>: " &
> CType(Me.FindControl("txtCostCntr" & index.ToString()), TextBox).text &
> "<br>"
> litResponse.text +="<b>Account Number</b>: " &
> CType(Me.FindControl("txtRefNum" & index.ToString()), TextBox).text &
> "<br>"
> litResponse.text +="<b>Account Number</b>: " &
> CType(Me.FindControl("txtActAmt" & index.ToString()), TextBox).text &
> "<br>"
> Next
>
> Thank you.
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
 
John Saunders
Guest
Posts: n/a
 
      14th Jul 2004
"TN Bella" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hello,
> I don't know why I keep getting this error. I have 15 of each txtacctnum
> (txtacctnum - txtacctnum14), txtcostcntr, txtrefnum, and txtacctamt.
> Some of the inputs are null, so I don't want to display unless there is
> a value. Can someone please help?
>
> Object reference not set to an instance of an object.
> Description: An unhandled exception occurred during the execution of the
> current web request. Please review the stack trace for more information
> about the error and where it originated in the code.
>
> Exception Details: System.NullReferenceException: Object reference not
> set to an instance of an object.
> Here is my code:
>
> Dim index as Integer
> For index=0 To 14
>
> litResponse.text +="<b>Account Number</b>: " &
> CType(Me.FindControl("txtAcctNum" & index.ToString()), TextBox).text &
> "<br>"


There is no txtAcctNum0, is there?
--
John Saunders
johnwsaundersiii at hotmail


 
Reply With Quote
 
TN Bella
Guest
Posts: n/a
 
      14th Jul 2004

no....I did change it For index = 1 To 14 but all I get is null values,
none of the textboxes that have a value are being displayed.


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
images and text with response SergioT Microsoft ASP .NET 4 12th Jan 2007 10:59 PM
Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'. Jesús Bosch Microsoft ASP .NET 1 3rd Jul 2006 03:04 PM
Re: Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml' Damon Payne Microsoft ASP .NET 0 8th Mar 2005 02:35 AM
Can someone help with this response.text? TN Bella Microsoft ASP .NET 4 15th Jul 2004 05:24 PM
Text Response to msgBox Brian Microsoft Access Reports 2 8th Aug 2003 12:39 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:22 PM.