IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

ASP.NET Discussion :

[CascadeDropDown] Error 500 au second changement de valeur d'une fille.


Sujet :

ASP.NET

  1. #1
    Futur Membre du Club
    Inscrit en
    Avril 2011
    Messages
    5
    Détails du profil
    Informations forums :
    Inscription : Avril 2011
    Messages : 5
    Points : 5
    Points
    5
    Par défaut [CascadeDropDown] Error 500 au second changement de valeur d'une fille.
    Bonjour,

    Ceci fait suite à http://www.developpez.net/forums/d10...dindexchanged/ cette fois, le soucis est assez rageant.

    J'ai 2 dropdownlist qui sont remplies via l’extension CascadingDropDown.
    Une mère et une fille.
    Quand je sélectionne une valeur dans la mère, ça rempli bien la fille.
    Si je change la valeur de la mère, tout ce passe normalement.
    Par contre si je sélectionne une valeur dans la mère, puis une valeur dans la fille, si je change la valeur de la mère, le selectedValue de la fille ne change pas (mais ça, c'est pas trop grave)
    Le vrai problème, c'est quand je sélectionne une valeur dans la mère, que je sélectionne une valeur dans la fille puis que je change la valeur de la fille j'obtiens une erreur 500 sans que la WebMethod soit appelée.
    Microsoft JScript runtime error:
    Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500
    ManageProfil.ascx
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    <table>
        <tr>
            <td>
                <asp:Label ID="lbProfilOffice" runat="server" Text="<%$ Resources:WebSite, lbOffice %>" />
                :
            </td>
            <td>
                <asp:DropDownList ID="ddProfilOffice" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddProfilOffice_OnSelectedIndexChanged" />
                <ajx:CascadingDropDown ID="cddProfilOffice" runat="server" TargetControlID="ddProfilOffice"
                    Category="Office" PromptText="<%$ Resources:WebSite, FirstRowOffice %>" PromptValue="-1"
                    LoadingText="[Loading ...]" ServicePath="~/WebService.asmx" ServiceMethod="GetDropDownOffice"
                    UseContextKey="false" />
            </td>
            <td colspan="2" />
        </tr>
        <tr>
            <td>
                <asp:Label ID="lbProfilAddress" runat="server" Text="<%$ Resources:WebSite, lbAddress %>" />
                :
            </td>
            <td>
                <asp:DropDownList ID="ddProfilAdresse" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddProfilAdresse_OnSelectedIndexChanged" />
                <ajx:CascadingDropDown ID="cddProfilAdresse" runat="server" TargetControlID="ddProfilAdresse"
                    Category="Address" PromptText="<%$ Resources:WebSite, FirstRowAddress %>" PromptValue="-1"
                    LoadingText="[Loading ...]" ServicePath="~/WebService.asmx" ServiceMethod="GetDropDownAddress"
                    ParentControlID="ddProfilOffice" />
            </td>
            <td colspan="2" />
        </tr>
    </table>
    <asp:UpdatePanel ID="upProfilForm" runat="server" UpdateMode="Conditional" RenderMode="inline">
        <ContentTemplate>
            <table id="ProfilForm" runat="server" style="display: none">
                <tr>
                    <td>
                        <asp:Label ID="lbProfilXP" runat="server" Text="<%$ Resources:WebSite, lbProfilXP %>" />
                        :
                    </td>
                    <td colspan="3">
                        <asp:TextBox ID="tbProfilXP" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lbProfilTS" runat="server" Text="<%$ Resources:WebSite, lbProfilTS %>" />
                        :
                    </td>
                    <td colspan="3">
                        <asp:TextBox ID="tbProfilTS" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lbProfilPF" runat="server" Text="<%$ Resources:WebSite, lbProfilPF %>" />
                        :
                    </td>
                    <td colspan="3">
                        <asp:TextBox ID="tbPersonalFolder" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lbProfilSL" runat="server" Text="<%$ Resources:WebSite, lbProfilSL %>" />
                        :
                    </td>
                    <td colspan="3">
                        <asp:TextBox ID="tbScriptLogin" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Button ID="bProfilValidate" runat="server" Text="<%$ Resources:WebSite, btSend %>" />
                        <asp:Button ID="bProfilReset" runat="server" Text="<%$ Resources:WebSite, btErase %>" />
                    </td>
                </tr>
            </table>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="ddProfilOffice" EventName="SelectedIndexChanged" />
            <asp:AsyncPostBackTrigger ControlID="ddProfilAdresse" EventName="SelectedIndexChanged" />
        </Triggers>
    </asp:UpdatePanel>
    ManageProfil.ascx.cs
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    protected void ddProfilOffice_OnSelectedIndexChanged(Object sender, System.EventArgs e)
        {
            showInfo();
        }
     
        protected void ddProfilAdresse_OnSelectedIndexChanged(Object sender, System.EventArgs e)
        {
            showInfo();
        }
     
        private void showInfo()
        {
            if (String.IsNullOrEmpty(ddProfilAdresse.SelectedValue) || ddProfilAdresse.SelectedIndex == -1)
                ProfilForm.Style["Display"] = "none";
            else
            {
                Accra.Objects.FileProfil fp = null;
                try
                {
                    fp = new Accra.Objects.FileProfil(ddProfilOffice.SelectedValue, ddProfilAdresse.SelectedValue);
                }
                catch (Exception) { }
                if (fp != null)
                {
                    tbProfilXP.Text = fp.ProfilePath;
                    tbProfilTS.Text = fp.ProfilTS;
                    tbPersonalFolder.Text = fp.PersonalFolder;
                    tbScriptLogin.Text = fp.ScriptPath;
                }
                ProfilForm.Style["Display"] = "block";
            }
        }
    Merci de votre attention.

  2. #2
    Futur Membre du Club
    Inscrit en
    Avril 2011
    Messages
    5
    Détails du profil
    Informations forums :
    Inscription : Avril 2011
    Messages : 5
    Points : 5
    Points
    5
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    [HttpRequestValidationException]: A potentially dangerous Request.Form value was detected from the client (ctl00$ContentPlaceHolder1$tabContainer$TabPanel3$ManageProfil1$tbProfilXP=&quot;...rofils_XP\&lt;LoginName&gt;&quot;).
       at System.Web.HttpRequest.ValidateString(String s, String valueName, String collectionName)
       at System.Web.HttpRequest.ValidateNameValueCollection(NameValueCollection nvc, String collectionName)
       at System.Web.HttpRequest.get_Form()
       at System.Web.HttpRequest.get_HasForm()
       at System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull)
       at System.Web.UI.Page.DeterminePostBackMode()
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
       at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
       at System.Web.UI.Page.ProcessRequest()
       at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
       at System.Web.UI.Page.ProcessRequest(HttpContext context)
       at ASP.admin_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\2cd420a6\d073ebd0\App_Web_toz5mrtb.4.cs:line 0
       at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    Bon après plusieurs tests, il semblerait que je doive encore désactiver de la sécurité intégrée. C'est pas une vrai solution mais ça fonctionne donc dans le web.config j'ai cette ligne maintenant :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <pages theme="Default" enableEventValidation="false" validateRequest="false">

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [VBA-E] RechercheV si changement de valeur sur une cellule
    Par bonilla dans le forum Macros et VBA Excel
    Réponses: 1
    Dernier message: 18/01/2007, 16h22
  2. [VB.NET]Test sur changement de valeur d'une variable
    Par shinji_rem dans le forum Windows Forms
    Réponses: 9
    Dernier message: 29/11/2006, 15h53
  3. changement de valeur d'une colonne JTable
    Par matzeus dans le forum Composants
    Réponses: 1
    Dernier message: 04/05/2006, 18h05
  4. Réponses: 1
    Dernier message: 29/09/2005, 11h10
  5. Intercepter le changement de valeur d'une variable
    Par Captain_JS dans le forum C++Builder
    Réponses: 5
    Dernier message: 07/01/2005, 08h04

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo