.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Adding a Cancel Button

Posted By:      Posted Date: September 11, 2010    Points: 0   Category :Windows Application
Hi, I have an application that performs a very big algorithm when a button is clicked. I'm trying to add a "Cancel Button" if the user wants to cancel the operation. The problem is the cancel button doesn't fire any event while the program is executing another events. Actually it seems beeing inactive. Any idea of how can I solve the problem?

View Complete Post

More Related Resource Links

replacing ok and cancel button of an alert message with YES an NO button in asp.net web application.


i want to replace ok and cancel button of an alert message with YES an NO button in asp.net web application.When a user will click yes the data will be saved in the database and if user clicks that will act as a reset button and do not save the data in database and the control will move with as usual to the redirect page.Any pointers will be highly appreciated.I am usin g C# language.

Adding a button to the Report Portal

Hi everyone, I am using SSRS 2008 and would like to know if there is a way to customize the Report Portal?  I need to add a button that the user can click on when they find a bug or the report doesn't work.  The button would open an email window for the user to type in the problem they are experiencing and it would be sent to our Ontime system.      Thanks for your help!  Youngmon...  

How to cancel(disable) combobox in the time is under pressure button?

Hi I have one button and one combobox. How to do so that in time I press the button the combobox turn on be gray or freez. thanks 

Displaying a Messagebox with Ok / Cancel button using C# in web application

 Hi all, I would like to get the user's confirmation by displaying a message box with ok cancel options, when you press ok it has to invoke a member function, otherwise other function. thanks. ssm.

OpenFileDialog OK/Cancel button closes form that opened it


After clicking OK or Cancel from the OpenFileDialog, the calling form gets closed not allowing user to push OK on calling form to save changes.  Strange thing is, if calling form is opened modeless from main form, this does not happen.  But I do not want this form to be left open modeless.

Here's the code:

Main Form opens form to change a file path

    Private Sub AdvancedDatabaseConfigurationToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AdvancedDatabaseConfigurationToolStripMenuItem.Click

        Dim formDBPath As New frmDBPath


    End Sub
formDBPath has a button to browse to new file path which opens the OpenFileDialog
  Private Sub btnBrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBrowse.Click

    Dim openResult As DialogResult = Me.OpenFileDialog1.ShowDialog(Me)

    If openResult = Windows.Forms.DialogResult.Cancel Then Exit Sub
    Me.txtNewDBPath.Text = Me.OpenFileDialog1.FileName

  End Sub

 When I step through in the debugger, I click OK on the OpenFileDialog, it returns to btnBrowse_Click sub and sets the textbox text, then control passes back to main form sub AdvancedDatabaseConfigurationToolStripMenuI

adding play / stop button to a simple slide show


Hi guys,

I got the following code with the help of raghav khunger and I wanna add a play and stop button on it to cycle the pictures orderly and stop them. how can I do that?

<%@ Page Language="C#" %>

<%@ Import Namespace="System.Web.Services" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
    <style type="text/css">
            width: 100px;
            height: 100px;
            width: 400px;
            height: 300px;
    <form id="form1" runat="server">
    <asp:Image ID="imgMain" CssClass="main-image" runat="server"  ImageUrl="http://www.clubalbuquerque.com/files/images/15%20Random%20Greenery.JPG"/>
    <br />
    <div id="thumb-container">

InfoPath Forms : Adding rows dynamically from a SQL table along with a 'Delete' button per row


My requirement is something like this:

In a Task Approval form, I want to have a view which shows all the rows in a particular SQL table (in a infopath repeating table?). Along with each row, there should also be a button, on clicking which the row should disappear from the infopath view table. Do you think InfoPath can handle all this? :) 

To summarize:

1. How do I add rows to a table dynamically?

2. Per row, how do I create a button dynamically?

3. How do I remove the row from the view when the button is clicked?

Dynamically Adding button in GridView



I am using the following to dynamically add button to the cell of gridview, condition is that if the value of the fourth column is empty, then in place of empty cell add the button. But nothing is happening.  I am making use of the following logic in  RowDataBound event in gridview.

protected void gdvEmployee_RowDataBound(object sender, GridViewRowEventArgs e)

for( int i=0;i<=dataSet.Tables[0].Rows.Count;i++ )
                if (dataSet.Tables[0].Columns[3] == null)
                    Button button = new Button();
                    button.Text = "ADD";
                   DataColumn dataColumn = new dataColumn();

Adding Button in StatusBar !


Hello Everyone,


I am trying to have a StatusBar in my application which has a button in one of the panels.

I am doing

StatusBarPanel panel = new StatusBarPanel();



Which I know is wrong because I get

"Unable to cast object of type 'System.Windows.Controls.Button' to type 'System.ComponentModel.IComponent'"

as button is not IComponent.


What is the right way to do this?


P.S. I don't have a XAML file but doing everything through code.


Thank You in advance :)

have problem to redirect page , on cancel button click



i am doing simple login page and i used to required field validator to validate user name and password text box.

and there are two buttons submit and cancel.

now i want to redirect this page to home.aspx after clicking on cancel button, but that two required fields validator get pop up and i get stuck in login page.

 if anyone knows how to solve this problem please tell me..

thanks, in advance for your valuable time. 

How "Call a function" from Message box Ok button and how to add "Cancel button" in Message box


Dear Members,

               I have used the following codings to display the message box.

            StringBuilder sb = new StringBuilder();
            sb.Append("<script type = 'text/javascript'>");
            sb.Append(" Do you want save following records...');");
            ClientScript.RegisterStartupScript(this.GetType(), "script", sb.ToString());

              My requirment is to use the "Ok" button in the message box(alert box).

               I have a function Save().

               I mean if i click on the OK button in the message box, then it should call "Save()"  function.

               And also

               I need to add one more button : Cancel in the message box(alert box)

               Please give a hint.            


Cancel button Invalid page URL

I have created a page using SPD and inserted Custom List form . It has bought me the necessary Controls for each of the columns.
I have a save button which when clicked goes to a ThankYouPage.aspx by applying a queryString Source=ThankYou.aspx when the page is loaded.
My problem is the cancel button which when clicked says invalid URL. So how do I do a cancel button which when clicked goes to a page (as i did with a Save button)

Adding a 'send meeting notice' button to the calendar.

I'm attempting to add a button to allow users to send meeting notices when they create it in sharepoint.

I am using the following framework of Java to implement the creation:

The part I'm caught on is that instead of having it beign created as a button under a standard list view, I would like to either have the Java snippet execute when a meeting is created, or, to have a button appear under the meeting in the calendar that someone can click.

Any recommendations as to the approach?

(I am also referencing http://www.winscripter.com/WSH/MSOffice/90.aspx and http://msdn.microsoft.com/en-us/library/ms268875(v=VS.80

Need help adding SSL to Login button


Hello, inside an ASP.Net 3.5 application, we currently have a login box with two inputs and one button.
The buttons does a JQuery .ajax call in a POST over HTTP with the login and password(!!!)

The server, checks the credentials and returns a success or error code.

I was asked to change this to an HTTPS call.  I've tested $GetJSON and $JSONP but nothing will do a POST like I want to.  Next I realized that maybe, I should create a FORM but, I would like to have an advice on what would be the best way to secure this call.

Another thing, I've started to use SecureString on the server side but was wondering if anything was planned to receive a SecureString directly from the Request object instead of creating a SecureString from Request["password"] ?

Thanks for any help,


Adding Image to button created in VS 2005



I am using C# and VS 2005. I am using the WSP Builder to create a web part feature.

I have created a button in the CreateChildControls. I want to add an Image to the button.

I would like to know, if this can be achieved.


btnMyBtn = new Button();
this.btnMyBtn.Style.Add(HtmlTextWriterStyle.BackgroundImage, "/Images/email_button_rnmp_opt.jpg");


In the folder structure, which gets created using the WSP Builder, there is no Images folder.  Is it possible to create a folder (for example: IMAGES) in the Solution Explorer, under Template.

How to add the image to the solution explorer, and under which folder, so that after building the application, the Image can be seen in the webpart.

Thank you

Modal Popup Extender and an Update Panel - "Cancel" Button problem


This should be a quick "yes" answer - I am in the process of creating a very simple test, but I thought I'd ask on here too (also, so other people might be able to find the answer, if they have the same problem).

I have created a modalpopupextender that opens up a panel containing an update panel.  I have a cancel button that is tied into the MPE's [CancelControlID] property and this closes the popup when I click it.  However, if I perform a partial postback within the update panel, the cancel button no longer works.  I have found an example online that seems to imply that the cancel button (and I'm guessing, by association) and the OK button should be outside the update panel.  Does the partial postback break the buttons' client script bindings, and thus should they always be placed outside the update panel?

What would be the best way of adding a button that will only update a status of row from "Created" t



I am planning to add couple of custom buttons to update a status of a record in GridView?

What would be the best way of implementing it?

Many thanks, 

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend