RadAjaxPanel

2 posts, 0 answers
  1. Linga Reddy
    Linga Reddy avatar
    7 posts
    Member since:
    May 2009

    Posted 28 Jan 2010 Link to this post

    I have used RadAjaxpanel in my form everything is working fine except one thing i.e i have used one linkbutton in my gridview for downlosding code is

     


    Aspx code:

     

     

    <%

    @ Page Language="C#" MasterPageFile="~/masterAdmin.master" AutoEventWireup="true" CodeFile="CreateProjectwiseTask.aspx.cs" Inherits="CreateProjectwiseTask" Title="Project wise Task creation" %>

     

    <%

    @ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

     

    <%

    @ Register assembly="msgBox" namespace="BunnyBear" tagprefix="cc2" %>

     

    <%

    @ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>

     

     

     

    <

     

    asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

     

     

     

     

     

    <script language="JavaScript">

     

     

     

     

    javascript:window.history.forward(1);

     

     

    </

     

    script>

     

    <

     

    script language="javascript" type="text/javascript">

     

     

    function FireMyIASGroupPrint(myURL)

     

    {

     

    if(myURL)

     

    {

    alert(myURL);

     

    return;

     

    }

    }

     

     

     

     

     

     

     

     

    function

     

    openDialog(qs)

     

    {

     

    if(qs)

     

    {

     

    // alert(qs);

     

     

     

     

    window.open(

    "Createresourcetask.aspx?querystring=" + qs,'_blank','left = 300, top=150, width=530, height=380,menubar=no , scrollbars=yes, resizable=no');

     

    }

    }

     

    </script>

     

     

     

     

     

    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">

     

     

     

     

     

    <table width="100%" border="0" cellspacing="0" cellpadding="0">

     

    <

     

    tr>

     

     

     

     

     

    <td height="50" valign="top">

     

     

     

     

     

    <table width="100%" border="0" cellspacing="0" cellpadding="0">

     

     

     

     

     

    <tr>

     

     

     

     

     

    <td width="5%" align="center"><img src="images/create-resource.gif" alt="" width="39" height="45" /></td>

     

     

     

     

     

    <td width="47%"><h2>Project Wise Task Create / Update</h2></td>

     

     

     

     

     

    <td width="33%">

     

     

     

     

     

    &nbsp;</td>

     

     

     

     

     

    <td width="15%"></td>

     

     

     

     

     

    </tr>

     

     

     

     

     

    </table>

     

     

     

     

     

    </td>

     

     

     

     

     

    </tr>

     

     

     

     

     

    <tr>

     

     

     

     

     

    <td height="1" style="border:1px solid #CCCCCC; border-bottom:0px;">

     

     

     

     

     

    <cc2:msgBox ID="msgBox1" runat="server" />

     

     

     

     

     

    <img src="images/spacer.gif" height="1" width="1" border="0" /></td>

     

     

     

     

     

    </tr>

     

     

     

    <tr>

     

     

     

     

     

    <td valign="top" align="center" height="280">

     

     

     

     

     

    <table width="98%" border="0" cellspacing="0" cellpadding="0">

     

     

     

     

     

    <tr>

     

     

    <td align="left">

     

     

     

     

     

     

    <table width="420" border="0" cellspacing="0" cellpadding="0">

     

     

     

     

     

    <tr>

     

     

     

     

     

    <td width="80" height="40" class="heading">Project Name</td>

     

     

     

     

     

    <td width="324">

     

     

     

     

     

     

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">

     

     

     

     

     

    <ContentTemplate>

     

     

     

     

     

     

    <telerik:RadComboBox ID="ddlProjects" runat="server" AutoPostBack="True"

     

     

    Height="170px" Width="200px" DropDownWidth="200px" Skin="WebBlue" onselectedindexchanged="ddlProjects_SelectedIndexChanged" >

     

     

     

     

     

    <Items>

     

     

     

     

     

    <telerik:RadComboBoxItem runat="server" Text="Select Project" Value="Select Project" />

     

     

     

     

     

    </Items>

     

     

     

     

     

    </telerik:RadComboBox>

     

     

     

     

     

     

    </ContentTemplate>

     

     

     

     

     

    </asp:UpdatePanel></td>

     

     

     

     

     

    </tr>

     

     

     

    </

     

    table>

     

     

    </td>

     

     

     

     

     

    </tr>

     

     

     

     

     

    <tr>

     

     

     

     

     

    <td valign="top">

     

     

     

     

     

     

    <asp:UpdatePanel ID="UpdatePanel2" runat="server">

     

     

     

     

     

    <ContentTemplate>

     

     

     

     

     

    <telerik:RadGrid ID="gviewProjectwisetask" runat="server" Width="100%" AutoGenerateColumns="False"

     

     

    GridLines="None" CellPadding="2"

     

     

     

    onrowcommand="gviewProjectwisetask_RowCommand"

     

     

    onpageindexchanging="gviewProjectwisetask_PageIndexChanging"

     

     

    BackImageUrl="~/images/grad_l2.gif" BorderColor="#66CCFF"

     

     

    BorderStyle="Solid" BorderWidth="1px"

     

     

    onrowdatabound="gviewProjectwisetask_RowDataBound"

     

     

    onrowediting="gviewProjectwisetask_RowEditing"

     

     

    onrowdeleting="gviewProjectwisetask_RowDeleting" Skin="Vista"

     

     

    onitemcommand="gviewProjectwisetask_ItemCommand"

     

     

    onitemdatabound="gviewProjectwisetask_ItemDataBound" AllowPaging="True"

     

     

    onpageindexchanged="gviewProjectwisetask_PageIndexChanged" PageSize="7">

     

     

     

     

     

     

    <MasterTableView>

     

     

     

     

     

    <Columns>

     

     

     

     

     

    <telerik:GridTemplateColumn HeaderText="Resource Name">

     

     

     

     

     

    <ItemTemplate>

     

     

     

     

     

    <asp:LinkButton ID="ResourceName" runat="server" CommandName="Select" Text='<%#DataBinder.Eval(Container.DataItem,"Resource Name") %>'></asp:LinkButton>

     

     

     

     

     

     

    </ItemTemplate>

     

     

     

     

     

     

     

    <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"

     

     

    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Left"

     

     

    Wrap="True" />

     

     

     

     

     

     

     

    </telerik:GridTemplateColumn>

     

     

     

     

     

     

     

    <telerik:GridBoundColumn DataField="Resource ID" HeaderText="ResourceId"

     

     

    ItemStyle-CssClass="columnHidden" HeaderStyle-CssClass="columnHidden" >

     

     

     

     

     

     

    <HeaderStyle CssClass="columnHidden" />

     

     

     

     

     

    <ItemStyle CssClass="columnHidden" Font-Bold="False" Font-Italic="False"

     

     

    Font-Overline="False" Font-Strikeout="False" Font-Underline="False"

     

     

    HorizontalAlign="Left" Wrap="True" />

     

     

     

     

     

     

    </telerik:GridBoundColumn>

     

     

     

     

     

    <telerik:GridTemplateColumn HeaderText="Task/Module Name">

     

     

     

     

     

    <ItemTemplate>

     

     

     

     

     

    <asp:Label ID="lblTaskmane" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"Task Name") %>'></asp:Label> &nbsp;

     

     

     

     

     

    </ItemTemplate>

     

     

     

     

     

     

    <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"

     

     

    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Left"

     

     

    Wrap="True" />

     

     

     

     

     

     

    </telerik:GridTemplateColumn>

     

     

     

     

     

     

     

    <telerik:GridTemplateColumn HeaderText="Task Description">

     

     

     

     

     

    <ItemTemplate>

     

     

     

     

     

    <asp:Label ID="lblDesc" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"Description") %>'></asp:Label> &nbsp;

     

     

     

     

     

    </ItemTemplate>

     

     

     

     

     

     

    <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"

     

     

    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Left"

     

     

    Wrap="True" />

     

     

     

     

     

     

    </telerik:GridTemplateColumn>

     

     

     

     

     

     

     

    <telerik:GridTemplateColumn HeaderText="Assigned By">

     

     

     

     

     

    <ItemTemplate>

     

     

     

     

     

    <asp:Label ID="lblAssignedBy" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"Assigned By") %>'></asp:Label> &nbsp;

     

     

     

     

     

    </ItemTemplate>

     

     

     

     

     

     

    <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"

     

     

    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Left"

     

     

    Wrap="True" />

     

     

     

     

     

     

    </telerik:GridTemplateColumn>

     

     

     

     

     

     

    <telerik:GridTemplateColumn HeaderText="ModifiedBy">

     

     

     

     

     

    <ItemTemplate>

     

     

     

     

     

    <asp:Label ID="lblModifiedBy" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"Modified By") %>'></asp:Label> &nbsp;

     

     

     

     

     

    </ItemTemplate>

     

     

     

     

     

     

    <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"

     

     

    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Left"

     

     

    Wrap="True" />

     

     

     

     

     

     

    </telerik:GridTemplateColumn>

     

     

     

     

     

     

     

    <telerik:GridTemplateColumn HeaderText="Phase">

     

     

     

     

     

    <ItemTemplate>

     

     

     

     

     

    <asp:Label ID="lblphase" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"phase") %>'></asp:Label> &nbsp;

     

     

     

     

     

    </ItemTemplate>

     

     

     

     

     

     

     

    <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"

     

     

    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Left"

     

     

    Wrap="True" />

     

     

     

     

     

     

     

    </telerik:GridTemplateColumn>

     

     

     

     

     

    <telerik:GridTemplateColumn HeaderText="ETA(Hrs)">

     

     

     

     

     

    <ItemTemplate>

     

     

     

     

     

    <asp:Label ID="lblETA" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"Estimated Hours") %>'></asp:Label> &nbsp;

     

     

     

     

     

    </ItemTemplate>

     

     

     

     

     

     

     

    <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"

     

     

    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Left"

     

     

    Wrap="True" />

     

     

     

     

     

     

     

    </telerik:GridTemplateColumn>

     

     

     

     

     

    <telerik:GridTemplateColumn HeaderText="Date">

     

     

     

     

     

    <ItemTemplate>

     

     

     

     

     

    <asp:Label ID="lblDate" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"Date") %>'></asp:Label> &nbsp;

     

     

     

     

     

    </ItemTemplate>

     

     

     

     

     

     

    <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"

     

     

    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Left"

     

     

    Wrap="True" />

     

     

     

     

     

     

    </telerik:GridTemplateColumn>

     

     

     

    <telerik:GridBoundColumn DataField="Task ID" HeaderText="TaskID"

     

     

    >

     

     

     

     

     

     

    <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"

     

     

    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Left"

     

     

    Wrap="True" />

     

     

     

     

     

     

    </telerik:GridBoundColumn>

     

     

     

     

     

    <telerik:GridBoundColumn DataField="Document ID" HeaderText="DocumentID"

     

     

    >

     

     

     

     

     

     

    <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"

     

     

    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Left"

     

     

    Wrap="True" />

     

     

     

     

     

     

    </telerik:GridBoundColumn>

     

     

     

     

     

    <telerik:GridTemplateColumn HeaderText="Document">

     

     

     

     

     

    <ItemTemplate>

     

     

     

     

     

    <asp:LinkButton ID="lnkDocument" runat="server" CommandName="Select2" Text='<%#DataBinder.Eval(Container.DataItem,"File Name") %>'></asp:LinkButton>

     

     

     

     

     

    </ItemTemplate>

     

     

     

     

     

     

    <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"

     

     

    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Left"

     

     

    Wrap="True" />

     

     

     

     

     

     

    </telerik:GridTemplateColumn>

     

     

     

     

     

    <telerik:GridTemplateColumn HeaderText="Remove Att. File">

     

     

     

     

     

    <ItemTemplate>

     

     

     

     

     

    <asp:ImageButton ID="imgbtnRemoveDocument" runat="server" ToolTip="Remove Attached File"

     

     

     

     

     

    ImageUrl="~/images/delete-file-icon.gif" CommandName="Select3" OnClientClick="return confirm('Are you sure you want to remove att. file?');"/>

     

     

     

     

     

    </ItemTemplate>

     

     

     

     

     

     

    <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"

     

     

    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"

     

     

    Wrap="True" />

     

     

     

     

     

     

    </telerik:GridTemplateColumn>

     

     

     

     

     

    <telerik:GridTemplateColumn HeaderText="Add More">

     

     

     

     

     

    <ItemTemplate>

     

     

     

     

     

    <asp:ImageButton ID="imgbtnAddmore" runat="server" ToolTip="Add More Tasks"

     

     

     

     

     

    ImageUrl="~/images/AddMore.gif" CommandName="Select4"/>

     

     

     

     

     

    </ItemTemplate>

     

     

     

     

     

     

    <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"

     

     

    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"

     

     

    Wrap="True" />

     

     

     

     

     

     

    </telerik:GridTemplateColumn>

     

    <

     

    telerik:GridBoundColumn DataField="status" HeaderText="Status"

     

     

    >

     

     

     

     

     

     

    <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"

     

     

    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Left"

     

     

    Wrap="True" />

     

     

     

     

     

     

    </telerik:GridBoundColumn>

     

     

     

     

     

    </Columns>

     

     

     

     

     

    </MasterTableView>

     

     

     

     

     

    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />

     

     

     

     

     

    <PagerStyle

     

     

    ForeColor="Black" HorizontalAlign="Center" Height="30px" Font-Bold="True" Font-Names="Arial"

     

     

    Font-Size="Smaller" CssClass="footerbg" />

     

     

     

     

     

     

    </telerik:RadGrid>

     

     

     

     

     

    </ContentTemplate>

     

     

     

     

     

    </asp:UpdatePanel>

     

     

     

     

     

     

     

    </td>

     

     

     

     

     

    </tr>

     

     

     

     

     

    </table>

     

     

     

     

     

    </td>

     

     

     

     

     

    </tr>

     

     

     

    </telerik:RadAjaxPanel>

     

     

     

     

     

    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px"

     

     

     

     

     

    Width="75px" Skin="Sunset">

     

     

     

     

     

    </telerik:RadAjaxLoadingPanel>

     

     

     

     

     

    </table></asp:Content>

     

     

     

    Below code is for code behind:
     

     

    protected void gviewProjectwisetask_ItemCommand(object source, GridCommandEventArgs e)

     

    {

     

    try

     

     

     

     

    {

    if

     

    (e.CommandName.ToUpper() == "SELECT2")

     

    {

    GridDataItem gvr = (GridDataItem)((LinkButton)e.CommandSource).NamingContainer;

     

     

    int RowIndex = gvr.ItemIndex;

     

     

    if (RowIndex > -1)

     

    {

    int FileId = Convert.ToInt32(gviewProjectwisetask.MasterTableView.Items[RowIndex].Cells[12].Text);

     

     

    string Str = FileId.ToString();

     

    Response.Redirect(

    "DownloadRedirect.aspx?ID=" + FileId);

     

    }

     

    catch (Exception ex)

     

    {

    }

    }

    Actual problem is when i click on linkbutton in gridview for downloading the file then progressbar showing perfectly here i have used Response.Redirect("DownloadRedirect.aspx?ID=" + FileId); after this line it is going to catch block here i want a solutions is that in catch block i want to disable the progressbar means i want to present  aspx form in normal mode means without progressbar.

    Just suggest me how it is possible.


     

     

     

     

  2. Radoslav
    Admin
    Radoslav avatar
    1566 posts

    Posted 02 Feb 2010 Link to this post

    Hi Linga,

    Please review the below articles on how to download files and redirect to another page with RadAjax:

    http://www.telerik.com/help/aspnet-ajax/ajxdownload.html

    http://www.telerik.com/help/aspnet-ajax/ajxredirectingtoanotherpage.html

    Additionally, I would suggest you to remove the ASP:UpdatePanel controls nested in the RadAjaxPanel and use only the RadAjaxPanel to ajaxify your page. Another option is you have two different RadAjaxPanel controls on the place of the ASP:UpdatePanels.

    I hope this helps.

    Regards,
    Radoslav
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
Back to Top