Search Results

Search found 4 results on 1 pages for 'unlimited071'.

Page 1/1 | 1 

  • How to make a server.transfer() with a Response.AddHeader("refresh", "seconds") and not get a 404 er

    - by Unlimited071
    Hi all, so this is the scenario: I have a base class for all login-controlled pages: public class SessionControlledPage : Page { protected virtual void Page_Load(Object sender, EventArgs e) { Response.AddHeader("Refresh", Convert.ToString(Session.Timeout * 60 + 5)); if (Session.IsNewSession) { Response.Redirect("~/login.aspx"); } } } And a regularpage.aspx page that inherints from the base class: public partial class RegularPage : SessionControlledPage { override protected void Page_Load(Object sender, EventArgs e) { base.Page_Load(sender, e); Server.Transfer("~/otherpage.aspx"); } } Now let's say the original URL was http://localhost/regularpage.aspx and that Session.Timeout = 5. The problem appears when the refresh happens after the transfer takes place. I'm getting a 404 Not Found error and the URL changes for http://localhost/305. Notice that 5 * 60 + 5 = 305. Do you know why is this happening? got a solution? PD: I use transfer because I need to access some properties of regularpage.aspx on otherpage.aspx, maybe you could provide another solution for this too.

    Read the article

  • How to pass date parameters to Crystal Reports 2008 from an ASP.NET App?

    - by Unlimited071
    Hello all, I'm passing some parameters to a CR report programatically and it was working fine, but now that I have added a new date parameter to the report, for some reason, it is prompting me to enter that parameter on screen (the user isn't allowed to set that parameter is the system who must set it.), I haven't changed a thing other than adding the new date parameter, and all the other parameters behave normal, just the date parameter is prompted even thought I've already set a value for the parameter. This is the code I've got: private void ConfigureCrystalReports() { crystalReportViewer.ReportSource = GetReportPath(); crystalReportViewer.DataBind(); ConnectionInfo connectionInfo = GetConnectionInfo(); TableLogOnInfos tableLogOnInfos = crystalReportViewer.LogOnInfo; foreach (TableLogOnInfo tableLogOnInfo in tableLogOnInfos) { tableLogOnInfo.ConnectionInfo = connectionInfo; } ArrayList totOriValues = new ArrayList(); totOriValues.Add(date.ToString("MM/dd/yyyy HH:mm:ss")); ParameterFields parameterFields = crystalReportViewer.ParameterFieldInfo; SetCurrentValuesForParameterField(parameterFields, totOriValues, "DateParameter"); } private static void SetCurrentValuesForParameterField(ParameterFields parameterFields, ArrayList arrayList, string parameterName) { ParameterValues currentParameterValues = new ParameterValues(); foreach (object submittedValue in arrayList) { ParameterDiscreteValue parameterDiscreteValue = new ParameterDiscreteValue(); parameterDiscreteValue.Value = submittedValue.ToString(); currentParameterValues.Add(parameterDiscreteValue); } ParameterField parameterField = parameterFields[parameterName]; parameterField.CurrentValues = currentParameterValues; } Just for the sake of things: I have checked that the parameter is indeed a date and that it is well formed. CR prompts me to enter it in the format (mm/dd/yyyy hh:mm:ss) so I pass date in that exact format (In fact I've even tried hard coding a well-formed date and it still prompts me to enter the date). Am I doing something wrong?

    Read the article

  • Dynamic SQL and Funtions

    - by Unlimited071
    Hi all, is there any way of accomplishing something like the following: CREATE FUNCTION GetQtyFromID ( @oricod varchar(15), @ccocod varchar(15), @ocmnum int, @oinnum int, @acmnum int, @acttip char(2), @unisim varchar(15) ) AS BEGIN DECLARE @Result decimal(18,8) DECLARE @SQLString nvarchar(max); DECLARE @ParmDefinition nvarchar(max); --I need to execute a query stored in a cell which returns the calculated qty. --i.e of AcuQry: select @cant = sum(smt) from table where oricod = @oricod and ... SELECT @SQLString = AcuQry FROM OinActUni WHERE (OriCod = @oricod) AND (ActTipCod = @acttip) AND (UniSim = @unisim) AND (AcuEst > 0) SET @ParmDefinition = N' @oricod varchar(15), @ccocod varchar(15), @ocmnum int, @oinnum int, @acmnum int, @cant decimal(18,8) output'; EXECUTE sp_executesql @SQLString, @ParmDefinition, @oricod = @oricod, @ccocod = @ccocod, @ocmnum = @ocmnum, @oinnum = @oinnum, @acmnum = @acmnum, @cant = @result OUTPUT; RETURN @Result END The problem with this approach is that it is prohibited to execute sp_excutesql in a function... What I need is to do something like: select id, getQtyFromID(id) as qty from table The main idea is to execute a query stored in a table cell, this is because the qty of something depends on it's unit. the unit can be days or it can be metric tons, so there is no relation between the units, therefore the need of a specific query for each unit.

    Read the article

1