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

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

run event from button click help?

Posted By:      Posted Date: October 14, 2010    Points: 0   Category :ASP.Net

So i have created a html code that displays an icon that when clicked opens a .cmd script i have created. the only problem is that when you click the button it asks if you want to run or download where i want to automatically run.

So i was thinking do i need to point at a cmd file or can i not just put that code straight into the website?


incase i havnt explained this very well here is the code i am using:

 on my website (which is actually sharepoint):

<a href="http://sharepointsite/library/file.cmd"><img src=http://sharepointsite/libaray/image.png alt="appname"</a>

the code within the file.cmd:

start /d "C:\Program Files\Microsoft Office\Office12" excel.exe


(this opens excel as we are removing access to the start menu)


So can instead of opening a cmd file can i not just do somthing like "on button click run the following code" ?

View Complete Post

More Related Resource Links

Reporting services in 2008 r2 how to get a report in a print button click event in my c#.net page


how to  get a report in my c#.net page button lick event also steps to call a report from asp.net to reporting services


Thanks in advance

Infopath button click event in custom workflow code.


Hi All,

I have designed the infopath form(Init) and integrated with my state machine workflow. i want to access button click event (designed in Infopath form) in my workflow code.

Can you help me.




Catch button click event in different .aspx page.


I have a button which starts processing.
I want that when ever a button is click from page1.aspx .. a count down timer should start and displayed on page2.aspx.
I am thinking of using iframe to join 2 pages.

Please let me know your suggestions.


OK button click on Windows dialogue form not triggering click event

I have created an Add-In for Outlook 2003 in Visual Studio 2005. When a new message is sent and a toggle button is selected, a form that I have created will be displayed as a dialogue box, where further information can be entered. Once this information has been entered you can click the OK button and the message is sent. If you were to click the OK button with invalid data in the form, there would be a message box with an error message. This all works perfectly on my development machine but when I have packaged the Add-In and installed it on other machines it does not work. Clicking on the OK button does nothing, there is not even an error message. All the prerequsits are successfully installed and this is the only part of the Add-In that does not work. All help greatly appreciated. Thanks Nick

listview with button in item template - how do I handle the click event?

Hello,Using a listview control for the first time... I need a button for each item, and of course I need to handle the click event for the buttons... upon clicking a particular button I of course need to know which item the button is associated with so the appropriate action can be taken...In VS, I can't select the button and see my list of available events in the properties window like is normally done for controls outside of templates like this... what do I need to do?

How to get the combobox value inside Datagrid on Edit button click event

Hi     I have Datagrid template column like<DataGridTemplateColumn.CellTemplate></DataGridTemplateColumn>DataGridTemplateColumn Header="Edit" x:Name="Edit" ><DataGridTemplateColumn.CellTemplate></DataGridTemplateColumn.CellEditingTemplate></DataGridTemplateColumn>SelectionChanged="cmbDGTeam_SelectionChanged" IsTabStop="True" /></DataTemplate><ComboBox Height="22" IsEditable="True" IsReadOnly="True" ItemsSource="{Binding}" DisplayMemberPath="Title" SelectedValuePath="TeamID" x:Name="cmbDGTeam"  SelectedValue="{Binding Path=TeamID,Mode=TwoWay}"<DataGridTemplateColumn.CellEditingTemplate><DataTemplate><DataTemplate><TextBlock Text="{Binding Title}"/></DataTemplate></DataGridTemplateColumn.CellTemplate><DataGridTemplateColumn Header="Team" Width="75"><DataGridTemplateColumn.CellTemplate> and Edit button Template column <DataGridTemplateColumn Header="Edit" x:Name="Edit" > </DataGridTemplateColumn.CellTemplate></DataTemplate><Button Content="Edit" IsEnabled="False" x:Name="btnEdit" Click="btnEdit_Click" ></Button>&l

Button click event is not fired on button click

 Hi am using jquery flexi gride in web page and it is working fine .But now the problem is ocured when i click button to call server side event.I am not able to find out .Please guide me for this My button is as fallows and i am<asp:Button ID="btnExport" runat="server" Text="Export" Style="font-family: 'Times New Roman', Times, serif" OnClick="btnExport_Click" />  

Calling a button's click event from another buttons click event

I have a button that checks the users serial number entry in a web form and a button that subits the page.  But if the user does not click the checkbutton  I want to  fire the check click event  from the pages submit click event.  Is this possible.  In my submit click event I call this Me.cmdCheck_Click(sender,e) though it does not seem to be firing the click event is there something that I am doing wrong?  

Viewstate issue when calling button click event from Javascript

I have a javascript that asks a confirmation on search click. If the user has made some changes to the data in grid (gridview) on click of Search, a confirmation is asked to Save or Continue Search. If Yes, Save the records by invoking Save click from javascript. If No, Search click is invoked. While Search click happens correctly, Save click results in an error which reads like this..  "Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. " I know the Viewstate is what causing the problem, where the control is not loaded but script is trying to invoke it's click event. Any help is appreciated. At the end of the day, all i need is to invoke Save click from javascript.   -- Viswanth VG  

Animation on the button click event???

hi, I have prepared a wpf application with 3 buttons. namely: start configure and manual now i want when initially the form loads the only start button should be visible. well not a big task at all!!! i have done it   but:   now i want to make the other two buttons visible and the start button invisible with a bit of animation on the button click event associated with "start" button.   Can any one plz suggest how should i proceed on with??? And ya am using c# for programming the application.....

Multiple instance of User Control on Page - Button Click Event

Hi, I have this Web User Control, with 3 controls:<asp:TextBox ID="txtSearch" runat="server" /> <asp:RequiredFieldValidator ID="rfvSearch" runat="server" ControlToValidate="txtSearch" Display="None" /> <asp:Button ID="btnSearch" runat="server" onclick="btnSearch_Click" /> In code behind: protected override void Render(HtmlTextWriter writer) { rfvSearch.ValidationGroup = this.ID + "_validation"; txtSearch.ValidationGroup = this.ID + "_validation"; btnSearch.ValidationGroup = this.ID + "_validation"; base.Render(writer); } protected void btnSearch_Click(object sender, EventArgs e) { Response.Redirect("ResultadoSearch.aspx?argumento=" + txtSearch.Text); } When I try to add two UserControl and I Click in btnSearch of second UserControl, txtSearch.txt returns value of first User control.How I can get the value of second txtSearch?

dynamically created button control click event not firing first time?

HI im creating a button control in page int and im assing a click event for the button control. here the click event is not firing for the first time.can anyone help me with this? here is my code. Button btn = new Button(); btn.ID = "btn"; btn.Click += new EventHandler(btn_Click); Panel1.Controls.Add(btn); Panel1.Controls.Add(new LiteralControl(""));

Modal popup with button click event won't work

Hi all,I try to create a asp.net 4 webpage, using masterpage.On webpage I have a formview and inside the formview I have a ajax modalpopup. I have multiple buttons and textboxes on the modalpopup, and created a test event, but I still get the message that the textbox is not declared.Here is how the code is set at this point:<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server"> <style type="text/css"> .ModalPopupBG { background-color: #666699; filter: alpha(opacity=50); opacity: 0.7; } .popup_Container { background-color:#fffeb2; border:2px solid #000000; padding: 0px 0px 0px 0px; } .HellowWorldPopup { min-width:200px; min-height:150px; background:white; } .popup_Titlebar { background: url(../Styles/titlebar_bg.jpg); height: 29px; } .popup_Body { padding:15px 15px 15px 15px; font-family:Arial; font-weight:bold; font-size:12px; color:#000000; line-height:15pt; clear:both; padding:20px; } .TitlebarLeft { float:left; padding-left:5px; padding-top:5px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; font-size:12px; color:#FFFFFF; } .TitlebarRight { background:url(../Styles/cross_icon_normal.png); background-position:right; background-repeat:no-repeat; height:15px; width:16px; float:right; cursor:pointer; margin-right:5px; margin-top:5px;

How can i check if button clicked inside a button click event?


private void View_Log_File_Click(object sender, EventArgs e)
                processNotePad = System.Diagnostics.Process.Start("notepad.exe", path_exe + @"\log\logger.txt");


It was easy to check it inside a checkbox event for example:


private void Show_satistics_CheckedChanged(object sender, EventArgs e)


             if (Show_satistics.Checked)
                     statform = new StatisticForm();

catch the html button click event on a class file including html text box value.


I want to catch the html button click event on a class file including html text box value..

<p><input name="" type="text"  value="Enter Name*"/></p>
<p><input name="" type="text"  value="Enter Email*"/></p>

  <input name="Input" type="submit" value="Submit" />

plz tell me how can i do this..

How to call a button click event on from an event handler



I got an event handler like this, in this event, i wanted to call another button click event. How can I do that?

protected void gwDetail_SaveCommand(object sender, System.EventArgs e)
            lblMsg.Text = "Saving...";


if (ds.Tables[0].Rows.Count == 0)

Gridview Link Button control click event


Respected Reader,

I have  Web page that uses LinkButton control inside Template Fields of Gridview.

I am trying to work on LinkButton Click event and trying to preserve the Value of LinkButton that user click, and based on that value, i want to refresh tha page data.

I used CommandName and CommandArgument property of Linkbutton, but i can use that property only in GridView_RowCommand method by checking e.CommandName expression. But the problem with that Gridview_RowCommand event fire after all other page_load activity. So the value never used in the page_load event to refresh the data in all other control.

I also tried to use OnClick Method, Session variable and Hidden variable. but when i run Response.Redirect method from Gridview_RowCommand, it clear all the Session and Hidden variable values. also tried (Response.Redirect(,false)) method but never got success.

Any suggestion will be appricated in advance.

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