• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 532
  • Last Modified:

asp.net 3.5+ formview + update command

I have a formview and would like to have an update button and cancel button in the form, but instead of using a SQL datasource or something, i would like to call a function in the code behind and do some things with the fields in the form - how would i do this?
0
dkilby
Asked:
dkilby
1 Solution
 
guru_samiCommented:
Add OnItemCommand handler for FormView and then

e.g:
<asp:Button  ID="Button1" runat="server" Text="Update" CommandName="MyUpdate" />

protected void FormView1_ItemCommand(object sender, FormViewCommandEventArgs e)
    {
        if (e.CommandName == "MyUpdate")
        {
            //Do your custom update here            
        }        
    }

Note: I am using CommandName="MyUpdate"
0
 
dkilbyAuthor Commented:
Thanks for the help - worked perfectly
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now