Probleme d'execution

Fermé
laamamel Messages postés 163 Date d'inscription mercredi 26 octobre 2011 Statut Membre Dernière intervention 1 avril 2015 - Modifié par baladur13 le 26/06/2014 à 11:57
laamamel Messages postés 163 Date d'inscription mercredi 26 octobre 2011 Statut Membre Dernière intervention 1 avril 2015 - 26 juin 2014 à 14:13
bonjour
svp je voudrais que quel qu"un pour résoudre certain problème de mon application

je réaliser un projet pour la recherche d'une base de données access
1- application asp.net
2- web form1 pour la connexion (user/password)
3-web form 2 pour la recherche (un button/edit/ gridview/une requete de recherche
4-webform 3 pour detaille 'dans le gridview j'ai une colonne detaille de chaque personne cad plus de renseignement

voici en général mon but du projet

dans web form 1
webform_connex:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm_connex.aspx.vb" Inherits="WebApplication_art24_25.WebForm1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">

.style1
{
text-align: center;
}
</style>
</head>
<body>
<form id="form2" runat="server">
<div class="style1">
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/WebForm2.aspx"
style="text-align: center">enter</asp:HyperLink>
<br />
<br />
<br />
User
<asp:TextBox ID="TextBox1" runat="server" Width="128px"></asp:TextBox>

<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="TextBox1" ErrorMessage="Ce champ est obligatoire"
style="color: #FF0000; font-size: small"></asp:RequiredFieldValidator>

<br />
<br />
Password
<asp:TextBox ID="TextBox2" runat="server" TextMode="Password"></asp:TextBox>

<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="TextBox1" ErrorMessage="Ce champ est obligatoire"
style="color: #FF0000; font-size: small"></asp:RequiredFieldValidator>

<br />
<br />
<br />
<asp:Button ID="Button2" runat="server"
style="font-weight: 700; font-size: large" Text="Enter" Width="148px" />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
</div>
</form>
<form id="form1" runat="server">
<div>

</div>
</form>
</body>
</html>
--------------webform_connex.aspx.vb--------------------------
Public Class WebForm1
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

End Sub

Protected Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button2.Click
If TextBox1.Text = "amel" And TextBox2.Text = "sihem" Then
Response.Redirect("WebForm_recherche.aspx")
End If
End Sub
End Class

2- web form 2
---------------------webform_recherche---------------------------
<asp:GridView ID="GridView_recherche" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False" CellPadding="4"
DataKeyNames="Codn,n_dos" DataSourceID="AccessDataSource_art"
ForeColor="#333333" GridLines="None" Height="274px">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:CommandField SelectText="??????" ShowSelectButton="True" />
<asp:BoundField DataField="Codn" HeaderText="????? ??????" ReadOnly="True"
SortExpression="Codn" />
<asp:BoundField DataField="N_BORD" HeaderText="??? ???? ???????"
SortExpression="N_BORD" />
<asp:BoundField DataField="nom" HeaderText="?????" SortExpression="nom" />
<asp:BoundField DataField="prenom" HeaderText="?????" SortExpression="prenom" />
<asp:BoundField DataField="date_nai" HeaderText="????? ???????"
SortExpression="date_nai" />
<asp:BoundField DataField="lieu_nai" HeaderText="???? ???????"
SortExpression="lieu_nai" />
<asp:BoundField DataField="N_DOSSM" HeaderText="??? ????? ???????"
SortExpression="N_DOSSM" />
</Columns>
<EditRowStyle BackColor="#7C6F57" />
<FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#E3EAEB" />
<SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F8FAFA" />
<SortedAscendingHeaderStyle BackColor="#246B61" />
<SortedDescendingCellStyle BackColor="#D4DFE1" />
<SortedDescendingHeaderStyle BackColor="#15524A" />
</asp:GridView>
-----------------------------webform_recherche.aspx.vb-----------
Imports System.Data.SqlClient
Imports System.Drawing


Public Class WebForm_rechec

Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

End Sub

Protected Sub Recherche_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Recherche.Click

End Sub
Private Sub connection()

Dim conn As New SqlDataSource
End Sub
Public Sub Affichage_DataGrid()


End Sub

Protected Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles TextBox1.TextChanged

End Sub

Private Function n_dos() As Object
Throw New NotImplementedException
End Function

Private Sub x(ByVal p1 As Object)
Throw New NotImplementedException
End Sub

Protected Sub GridView_recherche_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)

End Sub

Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles DropDownList1.SelectedIndexChanged

End Sub
End Class

3-web form detaille
-----------------------------
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm_detaille.aspx.vb" Inherits="WebApplication2.WebForm_detaille" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div style="height: 423px">

<asp:Panel ID="Panel1" runat="server" Height="185px" style="text-align: center"
Width="1061px">
<asp:TextBox ID="TextBox1" runat="server" style="height: 22px"></asp:TextBox>
??? ??????<br />
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
????? ??????<br />
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
??? ??????<br />
<asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>
?????? ??????<br />
<asp:TextBox ID="TextBox5" runat="server"></asp:TextBox>
????? ????????
<br />
<asp:AccessDataSource ID="AccessDataSource1" runat="server">
</asp:AccessDataSource>
<br />
<br />
<br />
<br />
<br />
<br />
</asp:Panel>

</div>
</form>
</body>
</html>
---------------------web form vb--------------------
Imports System.Data.Common
Imports System.Data.SqlClient
Imports System.Data.OleDb

Public Class WebForm3
Inherits System.Web.UI.Page

Private Property variable As Object

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load


End Sub
Private Sub conn()

Dim Conn As OleDbConnection
Dim requete_sql As OleDbCommand
Dim chaineconnexion As String
'Dim champs As DataRow
Dim data_adapter As OleDbDataAdapter
Dim dataset As DataSet

chaineconnexion = "AccessDataSource1"
'Conn = New AccessDataSource(chaineconnexion)'
'requete_sql = New OleDbCommand("SELECT pension24.*, BordereauTR.* FROM pension24 INNER JOIN BordereauTR ON pension24.num_doss = BordereauTR.NumDos;", Conn)

requete_sql = New OleDbCommand("requ", Conn)
data_adapter = New OleDbDataAdapter()
data_adapter.SelectCommand = requete_sql
dataset = New DataSet()
data_adapter.Fill(dataset)


'champs = dataset.Tables(0).Rows(0) 'Tables --> sélection de la table//Rows --> sélection de la ligne
'variable = champs("champs1")



End Sub

'Dim connecter As New SqlDataSource
'Dim DS As New DataSet
'Dim DAdapt As New SqlDataAdapter
'Dim req As String

'DAdapt = new SqlDataAdapter ("SELECT pension24.*, BordereauTR.* FROM pension24 INNER JOIN BordereauTR ON pension24.num_doss = BordereauTR.NumDos;",connecter)


'connecter.open()






Protected Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles TextBox1.TextChanged

End Sub
End Class

----------------erruer qui s'affiche----------------------------
Une page ne peut comporter qu'une seule balise Form côté serveur.
Description : Une exception non gérée s'est produite au moment de l'exécution de la requête Web actuelle. Contrôlez la trace de la pile pour plus d'informations sur l'erreur et son origine dans le code.

Détails de l'exception: System.Web.HttpException: Une page ne peut comporter qu'une seule balise Form côté serveur.

Erreur source:

Une exception non gérée s'est produite lors de l'exécution de la requête Web actuelle. Les informations relatives à l'origine et l'emplacement de l'exception peuvent être identifiées en utilisant la trace de la pile d'exception ci-dessous.

Trace de la pile:


[HttpException (0x80004005): Une page ne peut comporter qu'une seule balise Form côté serveur.]
System.Web.UI.Page.OnFormRender() +9531684
System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +35
System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32
System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +53
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +57
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +128
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
System.Web.UI.Page.Render(HtmlTextWriter writer) +29
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +57
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1386


Informations sur la version : Version Microsoft .NET Framework :4.0.30319; Version ASP.NET :4.0.30319.18446

merci d'avance
c'est urgent
bon courage

1 réponse

laamamel Messages postés 163 Date d'inscription mercredi 26 octobre 2011 Statut Membre Dernière intervention 1 avril 2015
26 juin 2014 à 14:13
rebonjour
pour le premier web form je lai réglé probléme de form il existé deux form donc j'ai supprimé la vide est ca marche

en cliquant sur entre pour accéder à la deuxieme webform voici le message d'erreur:
Erreur du serveur dans l'application '/'.
Erreur d'analyse
Description : Une erreur s'est produite au cours de l'analyse d'une ressource requise pour répondre à cette demande. Veuillez consulter ci-dessous les détails relatifs à l'erreur d'analyse en question, puis modifier votre fichier source de manière appropriée.

Message d'erreur de l'analyseur: 'WebApplication_art24_25.WebForm_recherche' n'est pas autorisé ici, car il n'étend pas la classe 'System.Web.UI.Page'.

Erreur source:


Ligne 1 : <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm_recherche.aspx.vb" Inherits="WebApplication_art24_25.WebForm_recherche" %>
Ligne 2 :
Ligne 3 : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


Fichier source : /WebForm_recherche.aspx Ligne : 1

Informations sur la version : Version Microsoft .NET Framework :4.0.30319; Version ASP.NET :4.0.30319.18446

quelqu un peut m'aider
merci
si je trouverais le probléme je vais faire un signe pour aider les gens qui on le méme probléme
bon courage
0