+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Possible URL rewriting issue

Possible URL rewriting issue

2 posts, 0 answered
  1. Mike Boyle
    Mike Boyle avatar
    22 posts
    Registered:
    17 Dec 2009
    18 Dec 2009
    Link to this post
    We are migrating our current site to a CMS based site using Sitefinity. We seem to be getting an error when trying to download data in spreadsheet format from our sitefinity hosted site. We're thinking it has something to do with the url rewriting. We have a control developed in C# .NET that downloads a file in spreadsheet format. When I click the Export option we actually get this error:

    Invalid Ticker: cie?ticker

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: Claymore.Domain.InvalidTickerException: Invalid Ticker: cie?ticker

    Source Error:

    Line 21: 
    Line 22:             if (_etf == null)
    Line 23: throw new InvalidTickerException(string.Format("Invalid Ticker: {0}", Ticker));

    It seems to confuse the ticker querystring parameter. It works on my local machine, but not on the server.

    The page contains:

    <a id="A3" runat="server" onserverclick="ProcessDistExcel">Export&nbsp;</a>

    The method on the codebehind is:
     protected

     

    void ProcessDistExcel(object sender, EventArgs e)

     

     

     {

     

     

     

    if (!GetSummaryInfo())

     

     

     

     

     

    return;

     

     

    Response.ClearContent();

    Response.AddHeader(

     

     

     "content-disposition", string.Format("attachment; filename=distributionHistory{0}-{1}.xls", Ticker.ToUpper(), DateTime.Now.ToString("yyyyMMdd")));

     

     

    Response.ContentType = 

     

     

     "application/excel";

     

     

     

     

     

    var sb = new StringBuilder();

     

     

    sb.Append(

     

     

    "Ex-Date\tRecord Date\tPayable Date\tTotal Distribution\tDRIP Price\tPACC Price\tSWP Price\n");

     

     

    _dividends = _fundDividentProvider.GetFundDividends(_summary.ExchangeSecurityID, _fromDate, _toDate);

    _dividends.OrderByDescending(x => x.ExDividendDate).ForEach(

    x => sb.Append(

     

     

    string.Format("{0}\t{1}\t{2}\t${3}\t${4}\t${5}\t${6}\n",

     

     

     

    FormatToShortDate(x.ExDividendDate),

    FormatToShortDate(x.RecordDate),

    FormatToShortDate(x.PayableDate),

    FormatToDecimal(x.TotalDividend),

    FormatToDecimal(x.DRIP),

    FormatToDecimal(x.PACC),

    FormatToDecimal(x.SWP))));

    Response.Write(sb.ToString());

    Response.End();

    }

     

    Works from our current production site outside of sitefinity. We seem to only get the error on postback. Any ideas or suggestions?

     

     

     

     

     

    We appriciate the help. Thanks.

     

  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    18 Dec 2009
    Link to this post
    Hi Mike Boyle,

    I do not see a reason why the UrlRewriting might be a problem here. Do you use the AdvancedUrlRewriter of Sitefinity? I do not see our code in the exception as well, it's happening somewhere in Claymore.Domain.

    How is this solution integrated in Sitefinity?

    All the best,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
2 posts, 0 answered