» »

ASPX preusmeritvena zanka

ASPX preusmeritvena zanka

Senzacionale ::

Ta spletna stran ima preusmeritveno zanko.

Spletna stran na http://localhost:49443/Currency.aspx je povzročila preveč preusmeritev. Težavo boste morda lahko rešili tako, da počistite piškotke za to spletno mesto. Če to ne pomaga, gre najbrž za težavo s konfiguracijo strežnika in ne za težavo z vašim računalnikom.

Ni pa mi jasno kje je težava ker v kodi ne zgleda nic narobe? Na trenutke dela na trenutke ne...

Hvala
http://www.dostavahrane.si

BlueRunner ::

Če ne boš pokazal kode, potem bo tudi kdorkoli drug le težko uganil, kaj je res narobe.

Senzacionale ::

ok design koda. Klicem WS pa obdelam zahtevke. Se kaj drugega?
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/SearchPage.Master" AutoEventWireup="true"
    CodeBehind="Currency.aspx.cs" Inherits="ViaMura.Web.Currency" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cplResults" runat="server">
    <script type="text/javascript" src="js/custom-form-elements.js"></script>
    <div id="converter">
        <div>
            <asp:Label ID="lblFromCurrency" runat="server" Text="iz valute" CssClass="searchTxt"></asp:Label>
            <asp:DropDownList ID="ddlFromCurrency" runat="server" CssClass="styled" 
                ValidationGroup="CurrencyConverter">
            </asp:DropDownList>
            <asp:CustomValidator
                    ID="cvFromCurrency" runat="server" ErrorMessage="Izberi valuto" 
                    ControlToValidate="ddlFromCurrency" CssClass="converter" 
                onservervalidate="cvFromCurrency_ServerValidate" ValidationGroup="CurrencyConverter" 
                    ></asp:CustomValidator>
        </div>
        <br />
        <div>
            <asp:Label ID="lblToCurrency" runat="server" Text="V valuto" CssClass="searchTxt"></asp:Label>
            <asp:DropDownList ID="ddlToCurrency" runat="server" CssClass="styled" 
                ValidationGroup="CurrencyConverter">
            </asp:DropDownList>
            <asp:CustomValidator
                ID="cvToCurrency" runat="server" ErrorMessage="Izberi valuto" 
                ControlToValidate="ddlToCurrency" CssClass="converter" 
                onservervalidate="cvToCurrency_ServerValidate" ValidationGroup="CurrencyConverter"
                ></asp:CustomValidator>
        </div>
        <br style="clear: both;" />
        <div>
            <asp:Label ID="lblValue" runat="server" Text="Vrednost" CssClass="searchTxt"></asp:Label>
            <img align="left" alt="<" src="images/bg_search_sml_left.png" />
            <div>
                <asp:TextBox ID="txtValue" runat="server" CssClass="search" 
                    ValidationGroup="CurrencyConverter"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvValue" runat="server" ControlToValidate="txtValue"
                    ErrorMessage="To polje je obvezno" CssClass="converterValidator" Display="Dynamic" 
                    Height="16px" ValidationGroup="CurrencyConverter"></asp:RequiredFieldValidator>
                <asp:CustomValidator
                    ID="cvValue" runat="server" ErrorMessage="Samo dec. vrednosti" 
                    ControlToValidate="txtValue" CssClass="converterValidator2" Display="Dynamic" 
                    onservervalidate="cvValue_ServerValidate" 
                    ValidationGroup="CurrencyConverter"></asp:CustomValidator>  
            </div>
            <img align="left" alt=">" src="images/bg_search_sml_right.png" />
            <br style="clear: both;" />
            <asp:Button ID="btnSubmit" runat="server" Text="Pretvori" CssClass="submit" 
                onclick="btnSubmit_Click" ValidationGroup="CurrencyConverter" />
            <asp:Label ID="lblResult" runat="server" Text="Pretvorba" CssClass="searchTxt"></asp:Label>
            <img align="left" alt="<" src="images/bg_search_sml_left.png" />
            <asp:TextBox ID="txtResult" runat="server" CssClass="search" ReadOnly="True" 
                ValidationGroup="CurrencyConverter"></asp:TextBox>
            <img align="left" alt=">" src="images/bg_search_sml_right.png" />
        </div>
    </div>
</asp:Content>
http://www.dostavahrane.si

BlueRunner ::

Koda je v Currency.aspx.cs.

Senzacionale ::

ok cela koda

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebCrawler.Core.DataInterfaces;
using WebCrawler.Core.Entities;
using System.Configuration;
using ProjectBase.Data;

namespace ViaMura.Web
{
    public partial class Currency : BasePage
    {
        #region Properties

        private string tmp { get; set; }  
       
        #endregion

        #region Methods

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
                LoadCurrency();
        }

        private void LoadCurrency()
        {
            ICurrenciesDao currencyDao = DaoFactory.GetCurrenciesDao();
            IList<Currencies> currencies = currencyDao.GetAll(); ;

            ddlFromCurrency.Items.Insert(0, new ListItem("Izberi", "0"));
            foreach (Currencies currency in currencies)
            {              
                if (this.tmp != currency.FromCurrency)
                {
                    ddlFromCurrency.Items.Add(new ListItem(currency.FromCurrency, currency.FromCurrency.ToString()));
                }

                this.tmp = currency.FromCurrency;
            }

            ddlToCurrency.Items.Insert(0, new ListItem("Izberi", "0"));
            foreach (Currencies currency in currencies)
            {
                if (this.tmp != currency.ToCurrency)
                {
                    ddlToCurrency.Items.Add(new ListItem(currency.ToCurrency, currency.ToCurrency.ToString()));
                }

                this.tmp = currency.ToCurrency;                
            }
        }          

        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                string selectedFromCurrency = ddlFromCurrency.SelectedValue;
                string selectedToCurrency = ddlToCurrency.SelectedValue;

                ICurrenciesDao currencyDao = DaoFactory.GetCurrenciesDao();

                Currencies currency = currencyDao.GetConversionRateByFromCurrencyToCurrency(selectedFromCurrency, selectedToCurrency);
                decimal result = currency.ConversionRate * Convert.ToDecimal(txtValue.Text);

                txtResult.Text = result.ToString();
            }
        }               

        protected void cvValue_ServerValidate(object source, ServerValidateEventArgs args)
        {
            string convertValue = txtValue.Text;

            decimal number;
            if (decimal.TryParse(convertValue, out number))
            {
                args.IsValid = true;
            }
            else
                args.IsValid = false;
        }      

        protected void cvFromCurrency_ServerValidate(object source, ServerValidateEventArgs args)
        {
            string selectedFromCurrency = ddlFromCurrency.SelectedValue;

            if (selectedFromCurrency != 0.ToString())
            {
                args.IsValid = true;
            }
            else
                args.IsValid = false;
        }        

        protected void cvToCurrency_ServerValidate(object source, ServerValidateEventArgs args)
        {
            string selectedToCurrency = ddlToCurrency.SelectedValue;

            if (selectedToCurrency != 0.ToString())
            {
                args.IsValid = true;
            }
            else
                args.IsValid = false;
        }

        #endregion
    }
}


Kakšna ideja ker mi pobira živce ta težava...
http://www.dostavahrane.si

Zgodovina sprememb…

Senzacionale ::

Stran se ne preusmerja pravilno

Ta naslov preusmerja zahtevo tako, da se zahteva nikdar ne bi izpolnila.
* Težavo lahko povzroča onemogočanje ali zavračanje piškotov.

Vedno ista težava, mogoče kakšna ideja. Če pa jo zaženem iz VS pa dela, iz linka pa ne.
http://www.dostavahrane.si


Vredno ogleda ...

TemaSporočilaOglediZadnje sporočilo
TemaSporočilaOglediZadnje sporočilo
»

C# težava

Oddelek: Programiranje
233744 (2590) mladec
»

OSCommerce nastavitve (strani: 1 2 3 410 11 12 13 )

Oddelek: Izdelava spletišč
62453490 (20641) Skarabej
»

c# datagridview in combox

Oddelek: Programiranje
131215 (1103) OmegaM
»

visual basic 2008 express edition

Oddelek: Programiranje
221822 (1249) sel
»

C# BackgroundWorker Class problem

Oddelek: Programiranje
61263 (1219) hendriks

Več podobnih tem