<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Data Presentation Controls</title><link>http://forums.asp.net/24.aspx</link><description>ASP.NET data-bound controls such as the DataGrid, DataList, GridView, FormView, DetailsView, and Repeater Controls.  &lt;a href="http://aspadvice.com/SignUp/list.aspx?l=23&amp;c=17" target="_blank"&gt;Email List&lt;/a&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: GridView Command Button Causing Two Successive Postbacks</title><link>http://forums.asp.net/thread/2709795.aspx</link><pubDate>Tue, 28 Oct 2008 09:34:46 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2709795</guid><dc:creator>Qin Dian Tang - MSFT</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2709795.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=24&amp;PostID=2709795</wfw:commentRss><description>&lt;p&gt;Hi rmdw,&lt;/p&gt;
&lt;p&gt;Many people have this issue with ImageButton in GridView. I cannot say it is a bug, but you can try to report it to &lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 10pt;"&gt;&lt;a href="http://connect.microsoft.com/VisualStudio/"&gt;&lt;i style="mso-bidi-font-style:normal;"&gt;&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;http://connect.microsoft.com/VisualStudio/&lt;/span&gt;&lt;/i&gt;&lt;/a&gt;&lt;/p&gt;Thanks,&lt;i style="mso-bidi-font-style:normal;"&gt;&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;&lt;/span&gt;&lt;/i&gt;</description></item><item><title>Re: GridView Command Button Causing Two Successive Postbacks</title><link>http://forums.asp.net/thread/2703469.aspx</link><pubDate>Fri, 24 Oct 2008 02:50:41 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2703469</guid><dc:creator>rmdw</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2703469.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=24&amp;PostID=2703469</wfw:commentRss><description>&lt;p&gt;Please be aware that the Checkbox column is a separate one and is NOT causing two postbacks.&amp;nbsp; It&amp;#39;s only the CommandName fields that are causing two postbacks.&lt;/p&gt;&lt;p&gt;Robert &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: GridView Command Button Causing Two Successive Postbacks</title><link>http://forums.asp.net/thread/2703445.aspx</link><pubDate>Fri, 24 Oct 2008 02:22:53 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2703445</guid><dc:creator>ameenkpn</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2703445.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=24&amp;PostID=2703445</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;If you have set the AutoPostBack property of the CheckBox to True, then for sure again RowCommand property will postback. Also every time the field with CommandName is clicked, it will call the GridView&amp;#39;s RowCommand event. In the RowCommand event, you have to check the CommandName and do the codings you want.&lt;br /&gt;&lt;br /&gt;if (e.CommandName.Equals(&amp;quot;Up&amp;quot;))&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; //Do things when Up button is clicked.&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if (e.CommandName.Equals(&amp;quot;Down&amp;quot;))&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; //Do things when Down button is clicked.&lt;br /&gt;
}&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>GridView Command Button Causing Two Successive Postbacks</title><link>http://forums.asp.net/thread/2703149.aspx</link><pubDate>Thu, 23 Oct 2008 20:46:02 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2703149</guid><dc:creator>rmdw</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2703149.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=24&amp;PostID=2703149</wfw:commentRss><description>&lt;p&gt;I posted a variation of this on an AJAX forum but think I was perhaps barking up the wrong tree, so let me try again here: &lt;br /&gt;&lt;/p&gt;&lt;p&gt;Here&amp;#39;s an abridged glimpse of a GridView
definition that I have:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;lt;asp:GridView ID=&amp;quot;gridViewReports&amp;quot; runat=&amp;quot;server&amp;quot; OnRowCommand=&amp;quot;gridViewReports_RowCommand&amp;quot;&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;lt;asp:ButtonField ImageUrl=&amp;quot;~/Images/Buttons/up.png&amp;quot; ButtonType=&amp;quot;Image&amp;quot; CommandName=&amp;quot;Up&amp;quot; ItemStyle-CssClass=&amp;quot;clickable&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:ButtonField ImageUrl=&amp;quot;~/Images/Buttons/down.png&amp;quot; ButtonType=&amp;quot;Image&amp;quot; CommandName=&amp;quot;Down&amp;quot; ItemStyle-CssClass=&amp;quot;clickable&amp;quot; /&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;lt;/asp:GridView&amp;gt; &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Stepping through the code, Page_Load is fired twice whenever I click on one of these command buttons.&amp;nbsp; The first time through, IsPostBack is always set to false (which is of course erroneous except for the very first time the form is loaded). &lt;br /&gt;&lt;/p&gt;&lt;p&gt;And strangely enough ... each row also has a checkbox in it.&amp;nbsp; Clicking on the checkbox
does cause a postback, but only one as per normal.&amp;nbsp; &lt;/p&gt;&lt;p&gt;Why would the
buttons be causing two postbacks?&lt;br /&gt;&lt;/p&gt;Robert</description></item></channel></rss>