REPOST: Gridview ImageButton causes double postback

T

Tim_Mac

Hello,
this message was posted in december 2005 and Steven Cheng from MS followed it up with me to a point, before the thread trailed off.

http://groups.google.com/group/micr...ork.aspnet/browse_frm/thread/47281f5d53c14950

several other newsgroup users have since confirmed the bug/behaviour described, and it is very easy to reproduce. There is a hack/workaround but it is very unsatisfactory, and this will continue to cause problems for users in the future unless it is acknowledged as a bug and fixed in the next service pack. I would appreciate a response from the MS camp if possible.

Thank you.
Tim Mackey.
 
Y

Yuan Ren[MSFT]

Hi Tim,

Thanks for posting!

I have performed the test from the code you supplied in the previous
threads. Unfortunately, I haven't reproduced the current issue.
"several other newsgroup users have since confirmed the bug/behaviour
described, and it is very easy to reproduce"

As you mentioned, if the issue is very easy to repro, could you please
supply a simple demo as zipped format and send it to me? My alias is
(e-mail address removed) (remove .online). If this is not inconvenience,
could you please supply some steps to repro? Thanks for your understanding.

I'm looking forward your reply!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support
 
T

Tim_Mac

hi Yuan,
thank you for the reply. i can certainly send you the source files,
but please understand that i have already been through the loops with
Steven Chang. i sent him the source files, HTTP trace logs etc. if
coordination at your end is difficult then i can send you the files
aswell.

by the way, in my experience, the incorrect behaviour happens about one
third or half of the time with Internet Explorer 6, so you might have
to do several postbacks to get it to happen.

thanks
tim
 
M

manuel0081

Tim_Mac said:
hi Yuan,
thank you for the reply. i can certainly send you the source files,
but please understand that i have already been through the loops with
Steven Chang. i sent him the source files, HTTP trace logs etc. if
coordination at your end is difficult then i can send you the files
aswell.

by the way, in my experience, the incorrect behaviour happens about one
third or half of the time with Internet Explorer 6, so you might have
to do several postbacks to get it to happen.

thanks
tim
 
M

manuel0081

I confirm this problem, please help us to solve this bug. In this
moment i solve using the solution of the other post...
 
Y

Yuan Ren[MSFT]

Hi Tim,

Thanks for your reply!

Please send the source file to me. My alias is (e-mail address removed)
(remove .online).

Additionally, I have performed some related research for the current issue.
Since I don't know the content of the .cs file, I just want you to remove
the "OnRowCommand="GridView1_RowCommand">" in the "<asp:GridView>" tag.
After this, please try again to find whether the problem will be resolved.

Regards,

Yuan Ren [MSFT]
Microsoft Online Support
 
M

manuel0081

---------------------------------------------
protected void GridView1_RowCommand(object sender,
GridViewCommandEventArgs e)
{
WriteFile(e.CommandName.ToString()+ " " +
e.CommandArgument.ToString() + " ContentLength=" +
Request.ContentLength.ToString() + " NVar="
+Request.Form.Count.ToString()+ " ");
if (Request.ContentLength == 1636)
WriteFile("- " + Request["x"].ToString() +" " +
Request["y"].ToString());
Request.SaveAs(@"C:\Prova\request" + DateTime.Now.ToFileTime()
+ ".txt",true);

}
-----------------------------------------------

I send you the project. It's a debug project! It will write some files
with the different request from whict you can note that it sometimes
will be 2 (of different length)!!!
This happens because one contains x and y coordinates of the mouse
The roweditingcommand is not needed, you can delete it (it's empty)

Thanks,
Ema
 
Y

Yuan Ren[MSFT]

HI Ema,

I have sent mail to you.

Thanks!

Yuan Ren [MSFT]
Microsoft Online Support
 
Joined
May 10, 2010
Messages
3
Reaction score
0
Hi guys,

I have just added the solution I came up with - may not ideal but works.

As my post count is less than 50, unable to add an internal link here.

Apologies - please follow:

-> forums
-> t117900-asp-net-multiple-postback-issue.html

Please forward your comments.

Arun
 
Joined
May 10, 2010
Messages
3
Reaction score
0
Hi Guys,

This is very old post, but people still looking at this for solution exactly same as I did last week.

Like Grengby said Double events are primary reasons - but removing one of them is not allways an option. Atleast on my case and I had to resolve this on 3rd party's application.

I added following script and amended ASP form on masterpage:

<script>var Q = 0;</script>
<form id="Form1" runat="server" onsubmit="Q++; if(Q==1){return true;} else { return false;}">

This seems to be working and please forward your comments.

Arun
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top