[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Capturing CommandField button events.

Posted on 2006-05-23
Medium Priority
Last Modified: 2012-08-13
Using ASP 2.0 and the CommandField with a bound DetailsView control. I have three buttons set up. I also have a another button control on the form called "browse" that needs to be disabled if the user clicks on the Edit button, ie..



How do I capture an event from the EDIT button and then disable the BROWSE button ?

Question by:jonatec
  • 2
LVL 27

Expert Comment

by:Sammy Ageil
ID: 16743682
use findcontrol method and disable the browse button by when any the edit button is clicked
or you can use javascript to disable the browse when the edit is pressed.
if you having problems just post the aspx code and I can set the code for you


Author Comment

ID: 16744383
Where is the click event for the EDIT button to be found for me to write the C# ?
How do I identify that the EDIT button was clicked ?

Author Comment

ID: 16749575
This is a section of code where I am using a commandField within a DetailsView. I want to disable the "fileUpload" control button when the "EDIT button is clicked:

<asp:DetailsView       id="dvImages"
                  GridLines="None" >
                <input      id="fileUpload"
                        style="width:480px; font-weight:bold;"/>
        <asp:CommandField CausesValidation="true"  
                        ShowDeleteButton="True" >
This is the event that gets called when the EDIT button gets clicked, but I cannot locate the fileUpload control:

public void detailsView_ModeChanging(object sender, DetailsViewModeEventArgs e)
            case DetailsViewMode.Edit:
                  FileUpload b = dvImages.FindControl("fileUpload") as FileUpload;
                  if (b != null)
                      txtBox.Text = "detailsView_ModeChanging   Found.";


Accepted Solution

GranMod earned 0 total points
ID: 16778649
Closed, 500 points refunded.

The Experts Exchange
Community Support Moderator of all Ages

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

872 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