Solved

Image refresh chrome asynchronous request (asp.net)

Posted on 2013-12-07
2
386 Views
Last Modified: 2013-12-11
Hello, I have a problem with google Chrome, not happening in Firefox/IE.
In an user evaluation page, when selecting proper answer for a question (checking ckAnswer checkbox from gvAnswers gridview) , there is generated an asynchronous request. But, during this asynchronous request, the image from code below (imgGroup2) is reloaded with visible refresh gap (like a wink), which makes it annoying for end user
The issue is only in Chrome.....

The code below.
Any suggestions?
Thanks!

<asp:UpdatePanel ID="up" runat="server" ChildrenAsTriggers="true">
                <ContentTemplate>
                <asp:Panel ID="pnlChapter" runat="server" CssClass="TestChapter">
                    <asp:Label ID="lblGroup1" runat="server" Text=""></asp:Label>
                </asp:Panel>
                
                <asp:Panel ID="pnlWrap2" runat="server" CssClass="TestWrap2">
                    <asp:Panel ID="pnlWrap3" runat="server" CssClass="TestWrap3">
                        
                        <asp:Panel ID="pnlSubChapter" runat="server" CssClass="TestSubchapter">
                            <asp:Label ID="lblGroup2" runat="server" Text=""></asp:Label>
                        </asp:Panel>
                        <br />
                        <asp:Panel ID="pnlDomain" runat="server" CssClass="TestDomain">
                            <asp:Label ID="lblGroup3" runat="server" Text=""></asp:Label>
                        </asp:Panel>
                        
                    </asp:Panel>                
                    <asp:Panel ID="pnlImage" runat="server" CssClass="TestImage">
                        <asp:Image ID="imgGroup2" runat="server" AlternateText="No image found." CssClass="TestImage" />
                    </asp:Panel>          
                </asp:Panel>
            
                <asp:Panel ID="pnlQuestion" runat="server" CssClass="TestQuestionText">
                    <asp:Label ID="lblQuestion" runat="server" Text=""></asp:Label>
                </asp:Panel>
<asp:Panel ID="pnlAnswer" runat="server" CssClass="TestAnswerText">
                    <asp:GridView ID="gvAnswers" runat="server" AutoGenerateColumns="false" 
                         ShowHeader="false" GridLines="None">
                        <RowStyle CssClass="gridviewRowTest" />
                        <Columns>
                            <asp:TemplateField ItemStyle-Wrap="true">
                                <ItemTemplate>
                                    <asp:CheckBox ID="ckAnswer" runat="server" TextAlign="Left" AutoPostBack="true" 
                                        Checked="false" OnCheckedChanged="ckAnswer_CheckedChanged" />                                                               
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="AnswerText" HeaderText="" />                                                        
                        </Columns>
                    </asp:GridView>
                    <asp:TextBox ID="tbAnswerArea" runat="server" TextMode="MultiLine" Rows="5" Width="200">
                    </asp:TextBox>
                </asp:Panel>

<asp:Button ID="btValidate" runat="server" Text="Valideaza" Enabled="false" CssClass="buttonStandard" OnClick="btValidate_Click"/>
</ContentTemplate>
            </asp:UpdatePanel>     

Open in new window

0
Comment
Question by:danielivanov2
  • 2
2 Comments
 

Accepted Solution

by:
danielivanov2 earned 0 total points
ID: 39711720
Solved by putting image in a separate UpdatePanel and associating btValidate button with a Postback Trigger for updating second UpdatePanel, as below:
<asp:UpdatePanel ID="up" runat="server" ChildrenAsTriggers="true">
            <ContentTemplate>
                <asp:Panel ID="pnlAnswer" runat="server" CssClass="TestAnswerPanel">
                    <asp:GridView ID="gvAnswers" runat="server" AutoGenerateColumns="false" 
                         ShowHeader="false" GridLines="None">
                        <RowStyle CssClass="gridviewRowTest" />
                        <Columns>
                            <asp:TemplateField>
                                <ItemStyle CssClass="TestAnswerText"/>
                                <ItemTemplate>                                    
                                    <asp:CheckBox ID="ckAnswer" runat="server" TextAlign="Left" AutoPostBack="true"  
                                        Checked="false" OnCheckedChanged="ckAnswer_CheckedChanged" />                                                                                                   
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="AnswerText" HeaderText="" />                                                        
                        </Columns>
                    </asp:GridView>
                    <asp:TextBox ID="tbAnswerArea" runat="server" TextMode="MultiLine" Rows="5" Width="200">
                    </asp:TextBox>
                </asp:Panel>                
                </ContentTemplate>
            </asp:UpdatePanel>

<asp:UpdatePanel ID="upValidate" runat="server" UpdateMode="Conditional">
                <ContentTemplate>
                    <asp:Button ID="btValidate" runat="server" Text="Valideaza" Enabled="false" CssClass="buttonStandard" OnClick="btValidate_Click"/>
                    <asp:Panel ID="pnlProgress" runat="server" CssClass="TestProgress">
                        <asp:DataList ID="dtListGroup1" runat="server" RepeatDirection="Horizontal" OnItemDataBound="dtListGroup1_ItemDataBound">                    
                            <ItemTemplate>                            
                                <asp:Panel ID="pnlGroupDesc" runat="server" Cssclass="TestGroup1Block">
                                    <asp:Label ID="lblGroupDesc" runat="server" Text='<%# Eval("GroupDesc")%>'></asp:Label>                                
                                </asp:Panel>
                                <asp:Literal ID="ltGroup1Id" runat="server" Text='<%# Eval("GroupId")%>' Visible="false"></asp:Literal>
                                <asp:Literal ID="ltBackColor" runat="server" Text='<%# Eval("BackColor")%>' Visible="false"></asp:Literal>
                                <asp:Literal ID="ltForeColor" runat="server" Text='<%# Eval("ForeColor")%>' Visible="false"></asp:Literal>
                                <ajaxToolKit:RoundedCornersExtender ID="RoundedCornersExtender2" runat="server" TargetControlID="pnlGroupDesc" Radius="10" Corners="All">
                                </ajaxToolKit:RoundedCornersExtender>                           
                            </ItemTemplate>
                        </asp:DataList>
                    </asp:Panel>                                                                                                    
                </ContentTemplate>
                <Triggers>
                    <asp:PostBackTrigger ControlID="btValidate" />
                </Triggers>
            </asp:UpdatePanel>

Open in new window


if (ck)
            {
                btValidate.Enabled = true;
                btValidate.CssClass = "buttonValidateOk";
                upValidate.Update();
            }
            else
            {
                btValidate.Enabled = false;
                btValidate.CssClass = "buttonValidateNotOk";
                upValidate.Update();
            }

Open in new window

0
 

Author Closing Comment

by:danielivanov2
ID: 39711721
no answer received, I had to find the answer myself
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question