forum

Home / DeveloperSection / Forums / Show Confirmation Message Yes or No in Asp.Net

Show Confirmation Message Yes or No in Asp.Net

Anonymous User 2039 21-Dec-2014

I have drop-down box where users can select Yes or No, if user selects Yes from the drop-down then i want to show a confirmation box that shows Yes or No option. If only user selects Yes in the confirmation box then i want to proceed calling my other function which makes an update to the backend database. If user selects No in the confirmation box then i don't want to proceed and cancel the operation. Here is my drop-down code: 

OnSelectedIndexChanged="CheckDropDownSelection"
                        runat="server" AppendDataBoundItems="true" Height="16px">
                        <asp:ListItem Text="-- Please Selet --" Value="-- Please Selet --"></asp:ListItem>
                        <asp:ListItem Text="YES" Value="YES"></asp:ListItem>
                        <asp:ListItem Text="NO" Value="NO"></asp:ListItem>
                    </asp:DropDownList>
here is my code behind:
 
protected void CheckDropDownSelection(Object sender, EventArgs e)
    {
        if (ddl_CloseTask.SelectedValue == "YES")
        {
            CloseTask();
        }
        else
        {
        }
    }
 
    protected void CloseTask()
    {
        // here is where i close the task
    }


Updated on 22-Dec-2014
I am a content writter !

Can you answer this question?


Answer

2 Answers

Liked By