Jump to content
Minmoas

Erro

Recommended Posts

Minmoas

boas pessoal, eu estou a desenvolver uma pap e estou a ter este erro quando tento abrir a pagina de login:

Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

alguém sabe como posso resolver ?

o código do pagina esta abaixo 

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Login_1.aspx.cs" Inherits="Login_1"%>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <link rel="stylesheet" href="Content/Site.css" />
    <link rel="stylesheet" href="Content/index_style.css" />
    <style> body{
     overflow:hidden;
 }</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> 
<div id="slider">
<figure>
            <img src="image/a.jpg" />
            <img src="image/b.jpg" />
            <img src="image/c.jpg" />
            <img src="image/d.jpg" />
            <img src="image/e.jpg" />
            <img src="image/f.jpg" />
            <img src="image/e.jpg" />
            <img src="image/f.jpg" />
</figure>
</div>
    <div class="ab">
    <img src="image/fish_5.png" />
  
    <form id="teste">
        <div class="form-input">
           
            <asp:TextBox type="text" name="username" placeholder="Enter Username" ID="txt_utilizador" runat="server"></asp:TextBox>
            
            <asp:TextBox type="text" name="username" placeholder="Enter Username" ID="txt_password" runat="server"></asp:TextBox>
            
        </div>
        <div class="form-input">
            <br />
&nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" Display="Dynamic" ErrorMessage="O campo de utilizador deve ser preenchido " ControlToValidate="txt_utilizador" ForeColor="Red" Font-Size="Small"></asp:RequiredFieldValidator>
                <br />
            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" Display="Dynamic" ErrorMessage="O campo da password deve ser preenchido " ControlToValidate="txt_password" ForeColor="Red" Font-Size="Small"></asp:RequiredFieldValidator>
                <br />
            <asp:Label ID="Label1" runat="server" Display="Dynamic" Text="O nome do utilizador ou a password estão incorretos" Visible="False" ForeColor="Red" Font-Size="Small"></asp:Label>
        </div>
        <asp:Button ID="btn_login" runat="server" OnClick="btn_login_Click" Text="LOGIN" />
        <br />

        <a href="#">Forget password?
    </form>
    <div ID="negro" runat="server"></div>
    <div ID="dialogo" runat="server"><p ID="dialogo_txt" runat="server">Registo efetuado com sucesso!</p>
    </div>
        <asp:Timer ID="Timer1" runat="server" Interval="1500" OnTick="Timer1_Tick">
        </asp:Timer>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
</div>
</asp:Content>

  <%--<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server"> 

    
  <div class="slider">
  <ul class="slider__list">
    <li class="slider__slide"><img src="image/a.jpg" alt="Image 1" /></li>
    <li class="slider__slide"><img src="image/b.jpg" alt="Image 2" /></li>
    <li class="slider__slide"><img src="image/c.jpg" alt="Image 3" /></li>
    <li class="slider__slide"><img src="image/d.jpg" alt="Image 4" /></li>
  </ul>
        <input id="sliderSwitch" class="slider__switch" type="checkbox" name="sliderSwitch" hidden />
    <div class="slider__control">
  <label for="sliderSwitch"></label>
 </div>

        </div>
</asp:Content>--%>

 

Share this post


Link to post
Share on other sites
M6

Esse erro ocorre quando entras na página pela primeira vez ou quando tens um postback?


10 REM Generation 48K!
20 INPUT "URL:", A$
30 IF A$(1 TO 4) = "HTTP" THEN PRINT "400 Bad Request": GOTO 50
40 PRINT "404 Not Found"
50 PRINT "./M6 @ Portugal a Programar."

 

Share this post


Link to post
Share on other sites
Marivaldo Arcanjo
13 horas atrás, Minmoas disse:

boas pessoal, eu estou a desenvolver uma pap e estou a ter este erro quando tento abrir a pagina de login:

Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

alguém sabe como posso resolver ?

o código do pagina esta abaixo 


<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Login_1.aspx.cs" Inherits="Login_1"%>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <link rel="stylesheet" href="Content/Site.css" />
    <link rel="stylesheet" href="Content/index_style.css" />
    <style> body{
     overflow:hidden;
 }</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> 
<div id="slider">
<figure>
            <img src="image/a.jpg" />
            <img src="image/b.jpg" />
            <img src="image/c.jpg" />
            <img src="image/d.jpg" />
            <img src="image/e.jpg" />
            <img src="image/f.jpg" />
            <img src="image/e.jpg" />
            <img src="image/f.jpg" />
</figure>
</div>
    <div class="ab">
    <img src="image/fish_5.png" />
  
    <form id="teste">
        <div class="form-input">
           
            <asp:TextBox type="text" name="username" placeholder="Enter Username" ID="txt_utilizador" runat="server"></asp:TextBox>
            
            <asp:TextBox type="text" name="username" placeholder="Enter Username" ID="txt_password" runat="server"></asp:TextBox>
            
        </div>
        <div class="form-input">
            <br />
&nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" Display="Dynamic" ErrorMessage="O campo de utilizador deve ser preenchido " ControlToValidate="txt_utilizador" ForeColor="Red" Font-Size="Small"></asp:RequiredFieldValidator>
                <br />
            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" Display="Dynamic" ErrorMessage="O campo da password deve ser preenchido " ControlToValidate="txt_password" ForeColor="Red" Font-Size="Small"></asp:RequiredFieldValidator>
                <br />
            <asp:Label ID="Label1" runat="server" Display="Dynamic" Text="O nome do utilizador ou a password estão incorretos" Visible="False" ForeColor="Red" Font-Size="Small"></asp:Label>
        </div>
        <asp:Button ID="btn_login" runat="server" OnClick="btn_login_Click" Text="LOGIN" />
        <br />

        <a href="#">Forget password?
    </form>
    <div ID="negro" runat="server"></div>
    <div ID="dialogo" runat="server"><p ID="dialogo_txt" runat="server">Registo efetuado com sucesso!</p>
    </div>
        <asp:Timer ID="Timer1" runat="server" Interval="1500" OnTick="Timer1_Tick">
        </asp:Timer>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
</div>
</asp:Content>

  <%--<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server"> 

    
  <div class="slider">
  <ul class="slider__list">
    <li class="slider__slide"><img src="image/a.jpg" alt="Image 1" /></li>
    <li class="slider__slide"><img src="image/b.jpg" alt="Image 2" /></li>
    <li class="slider__slide"><img src="image/c.jpg" alt="Image 3" /></li>
    <li class="slider__slide"><img src="image/d.jpg" alt="Image 4" /></li>
  </ul>
        <input id="sliderSwitch" class="slider__switch" type="checkbox" name="sliderSwitch" hidden />
    <div class="slider__control">
  <label for="sliderSwitch"></label>
 </div>

        </div>
</asp:Content>--%>

 

Verifique o requerimento de validação do seus input.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.