Solved

ASP.NET - Event for ItemTemplate Textbox?

Posted on 2003-11-21
3
527 Views
Last Modified: 2011-04-14
Hello,

I have a datagrid (with paging, 15/page) with a column made up of textboxes (itemTemplate).  Since there is only one column that's editable, I allow end-users to update the data in this column then save the data by clicking a [save] button, which loops through and saves the data.   However, since my grid has paging, I would like to  check if there were any updates made to this column and prompt the user to save or not before allowing the page change.  How do I capture the event of the textchange of the text box (itemtemplate) in this column?  Is it possible or do I need to try another approach altogether?  Thanks.
0
Comment
Question by:ocean9
3 Comments
 
LVL 12

Accepted Solution

by:
roverm earned 125 total points
ID: 9802352
You can solve this 2 ways:
1. Store each row immediatly after editing (using an Update button)
2. Use some javascript to ask the user what to do. In this case you need to capture all onclick events for the paging button, like this:
btNextPage.Attributes("onclick") = "return confirm('Save first?');"
Of course, this is just the general idea. Preferably you would like to check whether an update is done first before showing the confirm box.

Let me know.

D'Mzz!
RoverM
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 10277121
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: roverm {http:#9802352}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

TheLearnedOne
EE Cleanup Volunteer
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now