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
James
NA
6
0
DetailsView returns null values on postback???
Oct 26 2009 4:42 PM
Hi,
I want to use a DetailsView to insert a record into an empty list.
I have a DetailsView in my page source (DefaultMode set to insert), and the datasource in set in the codebehind.
myObject = new CustomObject();
if (!IsPostBack)
{
myDetailsView.DataSource = new List<CustomObject>() {myObject};
myDetailsView.DataBind();
}
...Then I run the website and type some text into one of the bound fields,
then click a button on the form...
protected void Button_Click(object sender, EventArgs e)
{
string s = myObject.myProperty;
}
But the value of the object is NULL.
Even myDetailsView.DataSource returns an empty list
what am I doing wrong??? I just want to retrieve the values types into the DetailsView
Thanks
James
Reply
Answers (
5
)
how to filter the grid view..
How to extract values from a Dictionary based on SessionID?