This is a migrated thread and some comments may be shown as answers.

Issue for Refresh to Web page on Runtime

1 Answer 83 Views
Window
This is a migrated thread and some comments may be shown as answers.
Thylak
Top achievements
Rank 1
Thylak asked on 22 Sep 2008, 12:39 PM
i am using the rad grid on inside from  rad panel bar.its working successfully.
But my doubt is
 
I had put hyperlink button in rad grid on Item template column.
These button had clicked to open the popup window and
that page had button should proceed the submit action process after then  popup window closed. if sametime parent window should be refresh.
They were all  working in Internet exploser,mozila browser but
 didn't worked in  safari browser.

--------------parentpage-------------------------------------------


These rad grid had put the parent page and its open to popup window through in coding....


<design page>
<radG:RadGrid ID="rgEditProbe" runat="server" AutoGenerateColumns="False" GridLines="None"
                                    SkinsPath="../GridSkins" AllowPaging="true" Skin="Vista" PageSize="2" OnItemDataBound="rgEditProbe_OnItemDataBound"
                                    Width="770px" HeaderStyle-HorizontalAlign="center" OnNeedDataSource="rgEditProbe_OnNeedDataSource"
                                     OnPageIndexChanged="rgEditProbe_OnPageIndexChanged">
                                    <PagerStyle NextPageText="Next" PrevPageText="Prev" Position="TopAndBottom" Mode="NextPrevAndNumeric"></PagerStyle>
                                    <MasterTableView>
                                        <Columns>
                                            <radG:GridTemplateColumn ItemStyle-Width="750px" HeaderText="Questions">
                                                <ItemTemplate>
                                                    <asp:HiddenField ID="hfSectionNo" runat="server" Value='<%# DataBinder.Eval(Container.DataItem,"SetIndex") %>' />
                                                    <asp:HiddenField ID="hfSectionOrderIndex" runat="server" Value='<%# DataBinder.Eval(Container.DataItem,"OrderIndex") %>' />
                                                    <asp:HiddenField ID="hfSectionName" runat="server" Value='<%# DataBinder.Eval(Container.DataItem,"Caption") %>' />
                                                    <asp:HiddenField ID="hfProbeId" runat="server" Value='<%# DataBinder.Eval(Container.DataItem,"ProbeId") %>' />
                                                    <radp:RadPanelbar ID="rpbProbe" runat="server" Width="750px" SkinsPath="../PanelBarSkins"
                                                        Skin="Default2006" CausesValidation="false" >
                                                        <Items>
                                                            <radp:RadPanelItem Expanded="true" Value="rpiQuestion" CssClass="style3" Width="750px">
                                                                <Items>
                                                                    <radp:RadPanelItem Value="Test1" Width="750px">
                                                                        <ItemTemplate>
                                                                        <br />
                                                                            <table>                                                                              
                                                                                <tr>
                                                                                    <td align="center">
                                                                                       
                                                                                           
                                                                                       <asp:HyperLink ID="hlAddQuestion" runat="server" Text="Add Question"  Font-Underline="true" ></asp:HyperLink>
                                                                                    </td>
                                                                                </tr>
                                                                            </table>
                                                                        </ItemTemplate>
                                                                    </radp:RadPanelItem>
                                                                </Items>
                                                            </radp:RadPanelItem>
                                                        </Items>
                                                    </radp:RadPanelbar>
                                                </ItemTemplate>
                                            </radG:GridTemplateColumn>
                                        </Columns>
                                    </MasterTableView>
                                </radG:RadGrid>




This onitemdatabound event should be bind the popup window in coding seciton....

protected void rgEditProbe_OnItemDataBound(object sender, Telerik.WebControls.GridItemEventArgs e)
{

    SubItem.Attributes.Add("onclick", "Popup=window.open('popupwindow.aspx','Popup','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=600,height=400,left=20,top=20'); return false; onmouseout=window.status=' ';return true; onmouseover=window.status='Add Question';return true ");
}


---------------------------------Client page-----------------------------

These  imagebutton had the client page to clicked proceed on refresh process in onclick event....

<design>

<asp:ImageButton ID="btnQuestionDetailsSave" runat="server" ImageUrl="~/Images/save.gif"
   AlternateText="Save" ValidationGroup="Save" OnClick="btnQuestionDetailsSave_Click" />


These methods could be call the end off submit process on popwindow after then refresh page the parent window.

btnQuestionDetailsSave_Click(object sender,imageclickevent e)
{
Refresh();
}

private void Refresh()
    {
        const string cRefreshParent = "<script language='javascript'>" +
                                "  window.opener.location.reload();" + "</script>";
        const string cRefreshParentKey = "RefreshParentKey";

        if (!this.Page.ClientScript.IsClientScriptBlockRegistered(cRefreshParentKey))
        {
            this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(),
            cRefreshParentKey, cRefreshParent);
        }
    }


Above had method(Refresh()) was working properly expect safari browser.

why????

Please solve problem....

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 25 Sep 2008, 04:38 AM
Hi Thylak,

This problem is not directly related to RadControls for ASP.NET AJAX - you are using a standard browser's popup (window.open()), you try to call a JavaScript function on the opener page and as you noted, it is not working.

I would suggest to check if the JavaScript on the content page is actually executed (for example you can put a standard alert() function in your cRefreshParent string) and if it is not called - to check in the Net if Safari has problems with such scenario - the ASP.NET forums are a good place to start.



Kind regards,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Window
Asked by
Thylak
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or