﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebGrid Enterprise - Button in webgrid column execute postback</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Button-in-webgrid-column-execute-postback/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Button in webgrid column execute postback</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Button-in-webgrid-column-execute-postback/</link><pubDate>Mon, 05 Jan 2015 10:26:18 GMT</pubDate><dc:creator>leo.c</dc:creator><description>&lt;p&gt;Hi Ernesto Barrera,&lt;/p&gt;
&lt;p&gt;As an alternative, you could prevent postback event from being fired using javascript.&lt;br&gt;The solution would be something like bellow.&lt;/p&gt;
&lt;p&gt;1. Create javascript function that will prevent postback event :&lt;/p&gt;
&lt;pre&gt;function prevent(event) {
	/* do something here */
	
	// Prevent the default event and Prevent the event from bubbling up
	event.preventDefault();
	event.stopPropagation();
	return false;
}&lt;/pre&gt;
&lt;p&gt;2. Attach that function to the button mousedown event.&lt;/p&gt;
&lt;pre&gt;Protected Sub WGridGestiontareas_InitializeRow(sender As Object, e As RowEventArgs)
	If e.Row.Type = RowType.Record Then
		Dim customObjectAttributes As String = " onmousedown = ""prevent(event)"" type = ""button"""
		e.Row.Cells.GetNamedItem("ACTIVAR").CustomObjectAttributes =  customObjectAttributes
	End If
End Sub&lt;/pre&gt;
&lt;p&gt;Please let us know whether this solution work at your end.&lt;/p&gt;
&lt;p&gt;Regards.&lt;/p&gt;</description></item><item><title>Button in webgrid column execute postback</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Button-in-webgrid-column-execute-postback/</link><pubDate>Thu, 04 Dec 2014 07:41:16 GMT</pubDate><dc:creator>ebarrera@indra.es</dc:creator><description>&lt;p&gt;the postbak is still executed.. only the message is not show with your solution..&lt;/p&gt;&lt;p&gt;we need not postback on button press&lt;/p&gt;&lt;p&gt;regards&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>Button in webgrid column execute postback</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Button-in-webgrid-column-execute-postback/</link><pubDate>Thu, 04 Dec 2014 05:03:27 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="color: #1f497d;"&gt;I modified Page_Load event handler of VACIO.aspx.vb file into the following and find that the message "Postback executed" is no longer appear when user click the button.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            DisplayAlert("Postback executed", "", Tipomensaje.MsgInfo)
        End If
    End Sub&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;Please let us know whether it helps or not.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Button in webgrid column execute postback</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Button-in-webgrid-column-execute-postback/</link><pubDate>Tue, 02 Dec 2014 17:48:20 GMT</pubDate><dc:creator>ebarrera@indra.es</dc:creator><description>&lt;p&gt;&lt;span class="hps"&gt;I have a problem&lt;/span&gt; &lt;span class="hps"&gt;with&lt;/span&gt; &lt;span class="hps"&gt;a column of type&lt;/span&gt; &lt;span class="hps"&gt;button on the&lt;/span&gt; &lt;span class="hps"&gt;grid&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;br&gt;&lt;span class="hps"&gt;I do not want&lt;/span&gt; &lt;span class="hps"&gt;it done&lt;/span&gt; &lt;span class="hps"&gt;postback&lt;/span&gt; &lt;span class="hps"&gt;when clicked&lt;/span&gt; &lt;span class="hps"&gt;and I&lt;/span&gt;&lt;span class="hps"&gt;ButtonAutoPostback&lt;/span&gt; &lt;span class="hps"&gt;property&lt;/span&gt; &lt;span class="hps"&gt;= "false&lt;/span&gt;&lt;span&gt;"&lt;/span&gt;&lt;span&gt;.&lt;/span&gt; &lt;span class="hps"&gt;however&lt;/span&gt; &lt;span class="hps"&gt;postback&lt;/span&gt; &lt;span class="hps"&gt;is done&lt;/span&gt; &lt;span class="hps"&gt;when pressed&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;span class="hps"&gt;attached&lt;/span&gt; &lt;span class="hps"&gt;sample project&lt;/span&gt; &lt;span class="hps"&gt;with the effect&lt;/span&gt; &lt;span class="hps"&gt;..&lt;/span&gt; &lt;span class="hps"&gt;enter&lt;/span&gt; &lt;span class="hps"&gt;any&lt;/span&gt; &lt;span class="hps"&gt;username and password,&lt;/span&gt; &lt;span class="hps"&gt;click on the&lt;/span&gt; &lt;span class="hps atn"&gt;"&lt;/span&gt;&lt;span&gt;Incidencias&lt;/span&gt;&lt;span&gt;"&lt;/span&gt; &lt;span class="hps"&gt;icon and then click&lt;/span&gt; &lt;span class="hps"&gt;any&lt;/span&gt; &lt;span class="hps"&gt;button on the&lt;/span&gt; &lt;span class="hps"&gt;grid&lt;/span&gt; &lt;span class="hps"&gt;..&lt;/span&gt; &lt;span class="hps"&gt;A message&lt;/span&gt; &lt;span class="hps"&gt;is displayed in the&lt;/span&gt; &lt;span class="hps"&gt;form&lt;/span&gt; &lt;span class="hps"&gt;load&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;span class="hps"&gt;Best Regards&lt;/span&gt;&lt;br&gt;&lt;/p&gt;</description></item></channel></rss>