TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
dc
NA
663
0
ASP.NET error message
Nov 18 2011 12:04 PM
The code listed below only works on the line, "string id = ((TextBox)DetailsView1.FindControl("TextBoxAttid")).Text;" regardless of the order I place the lines of code.
When I step through code and get to the other lines of code, I get the error message
"Object is not set to an instance of the object". The only object I think this error is referring to is the detailsview object. However that is not the error.
Thus can you tell me what object the code wants a new instance of?
if (DetailsView1.CurrentMode == DetailsViewMode.ReadOnly)
{
string id = ((TextBox)DetailsView1.FindControl("TextBoxAttid")).Text;
}
else if (DetailsView1.CurrentMode == DetailsViewMode.Edit)
{
string name1 = ((TextBox)DetailsView1.FindControl("TextBoxAttid")).Text;
string name3 = ((TextBox)DetailsView1.FindControl("Invalid_Form")).Text;
string name2 = ((TextBox)DetailsView1.FindControl("Prior_Cutoff_Date")).Text;
}
Reply
Answers (
1
)
How can i display data like these
How can i Record voice from flash and upload it in to Server