La Communauté Webmaster  forum rss


  Forum-webmaster
  Technique - programmation
  Asp / Asp.net / IIS
(Modérateurs: Shain, Netah, Lilian, lauryv, ToToMaStEr)
  RESOLU: Comment ca marche ASP sous Visual Basic. Net ??
« Précédent Suivant »
Pages: [1] Descendre
Répondre    Aviser des réponses    Envoyer le sujet    Imprimer
  Auteur  Sujet: RESOLU: Comment ca marche ASP sous Visual Basic. Net ??  (Lu 1550 fois)
RESOLU: Comment ca marche ASP sous Visual Basic. Net ??
« sur: le 29-08-2003 a 18:02:36 »
Cocci
Brit Deluxe
Guru
*****

Hors-Ligne

Sexe: Male
Messages: 1169



.: In the Mix :.
cocci_87
Voir le Profil    WWW
Répondre avec citation

Je vous expose mon problème !!

Je souhaite faire une page web constitué d'un tableau.
Dans celui ci je souhaite affiché des chiffres de productions.
Donc j'ai crée ma page html comme ci dessous :

Son nom : cptprod.aspx
Code:

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="cptprod.aspx.vb" Inherits="CompteurProduction.cptprod"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//FR">
<HTML>
   <HEAD>
      <title>WebForm1</title>
      <meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
      <meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
      <meta name="vs_defaultClientScript" content="JavaScript">
      <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
   </HEAD>
   <body MS_POSITIONING="GridLayout">
      <form id="Form1" method="post" runat="server">
         <TABLE WIDTH="650" BORDER="0" CELLSPACING="0" CELLPADDING="0">
            <tr>
               <td valign="top">
                  <!-- Tableau de visualisation des compteurs -->
                  <TABLE WIDTH="380" height="250" BORDER="0" CELLSPACING="1" CELLPADDING="0">
                     <TR>                     <TD></TD>               <TD></TD>
      <TD align="middle" class="TD_TITRE" width="80">Ligne 1</TD>
      <TD align="middle" class="TD_TITRE" width="80">Ligne 2</TD>
      <TD align="middle" class="TD_TITRE" width="80">Ligne 6</TD>
   </TR>
   <TR>
      <TD width="30" align="middle"><img src="images/puce.gif"></TD>
      <TD class="TD_COLONNE">Expédié</TD>
      <TD align="middle" class="CPT_VALEUR" bgcolor="#ffefd5"><asp:Label ID="lbll1_exp" runat="server" ForeColor="Black" Font-Names="Times New Roman" /></TD>
      <TD align="middle" class="CPT_VALEUR" bgcolor="#ffefd5"><asp:Label ID="lbll2_exp" runat="server" ForeColor="Black" Font-Names="Times New Roman" /></TD>
      <TD align="middle" class="CPT_VALEUR" bgcolor="#ffefd5"></TD>
   </TR>
   <TR>
      <TD width="30" align="middle"><img src="images/puce.gif"></TD>
      <TD class="TD_COLONNE">Chargé</TD>
      <TD align="middle" class="CPT_VALEUR" bgcolor="#ffdab9"><asp:Label ID="lbll1_cha" runat="server" ForeColor="Black" Font-Names="Times New Roman" /></TD>
      <TD align="middle" class="CPT_VALEUR" bgcolor="#ffdab9"><asp:Label ID="lbll2_cha" runat="server" ForeColor="Black" Font-Names="Times New Roman" /></TD>
      <TD align="middle" class="CPT_VALEUR" bgcolor="#ffdab9"></TD>               </TR>                  <TR>
      <TD width="30" align="middle"><img src="images/puce.gif"></TD>
      <TD class="TD_COLONNE">Sur Boucle</TD>
      <TD align="middle" class="CPT_VALEUR" bgcolor="#ffefd5"><asp:Label ID="lbll1_bou" runat="server" ForeColor="Black" Font-Names="Times New Roman" /></TD>
      <TD align="middle" class="CPT_VALEUR" bgcolor="#ffefd5"><asp:Label ID="lbll2_bou" runat="server" ForeColor="Black" Font-Names="Times New Roman" /></TD>
      <TD align="middle" class="CPT_VALEUR" bgcolor="#ffefd5"><asp:Label ID="lbll6_bou" runat="server" ForeColor="Black" Font-Names="Times New Roman" /></TD>
   </TR>
   <TR>
      <TD width="30" align="middle"><img src="images/puce.gif"></TD>
      <TD class="TD_COLONNE">Sur Stockeur</TD>
      <TD align="middle" class="CPT_VALEUR" bgcolor="#ffdab9"><asp:Label ID="lbll1_sto" runat="server" ForeColor="Black" Font-Names="Times New Roman" /></TD>
      <TD align="middle" class="CPT_VALEUR" bgcolor="#ffdab9"><asp:Label ID="lbll2_sto" runat="server" ForeColor="Black" Font-Names="Times New Roman" /></TD>
      <TD align="middle" class="CPT_VALEUR" bgcolor="#ffdab9"><asp:Label ID="lbll6_sto" runat="server" ForeColor="Black" Font-Names="Times New Roman" /></TD>
   </TR>
   <TR>
      <TD width="30" align="middle"><img src="images/puce.gif"></TD>
      <TD class="TD_COLONNE">Sur Module</TD>
      <TD align="middle" class="CPT_VALEUR" bgcolor="#ffefd5"><asp:Label ID="lbll1_mod" runat="server" ForeColor="Black" Font-Names="Times New Roman" /></TD>
      <TD align="middle" class="CPT_VALEUR" bgcolor="#ffefd5"><asp:Label ID="lbll2_mod" runat="server" ForeColor="Black" Font-Names="Times New Roman" /></TD>
      <TD align="middle" class="CPT_VALEUR" bgcolor="#ffefd5"><asp:Label ID="lbll6_mod" runat="server" ForeColor="Black" Font-Names="Times New Roman" /></TD>
   </TR>
   <TR>
      <TD width="30" align="middle"><img src="images/puce.gif"></TD>
      <TD class="TD_COLONNE">Au Picking</TD>
      <TD align="middle" class="CPT_VALEUR" bgcolor="#ffdab9"><asp:Label ID="lbll1_pic" runat="server" ForeColor="Black" Font-Names="Times New Roman" /></TD>
      <TD align="middle" class="CPT_VALEUR" bgcolor="#ffdab9"><asp:Label ID="lbll2_pic" runat="server" ForeColor="Black" Font-Names="Times New Roman" /></TD>
      <TD align="middle" class="CPT_VALEUR" bgcolor="#ffdab9"><asp:Label ID="lbll6_pic" runat="server" ForeColor="Black" Font-Names="Times New Roman" /></TD>
   </TR>
   <TR>
      <TD width="30" align="middle"><img src="images/puce.gif"></TD>
      <TD class="TD_COLONNE">Compteurs</TD>
      <TD align="middle" class="CPT_VALEUR" bgcolor="#ffefd5"><asp:Label ID="lbll1_cpt" runat="server" ForeColor="Black" Font-Names="Times New Roman" /></TD>
      <TD align="middle" class="CPT_VALEUR" bgcolor="#ffefd5"><asp:Label ID="lbll2_cpt" runat="server" ForeColor="Black" Font-Names="Times New Roman" /></TD>
      <TD align="middle" class="CPT_VALEUR" bgcolor="#ffefd5"><asp:Label ID="lbll6_cpt" runat="server" ForeColor="Black" Font-Names="Times New Roman" /></TD>
   </TR>
</TABLE>
   </td>
   <td width="5%">&nbsp;</td>
</tr>
</table>
</td></tr>
</TABLE>
</form>
</body>
</HTML>


voilà ce que j'ai dans ma page en vb :

Son nom : cptprod.aspx.vb

Code:

Imports JIT_COMMON.JIT_Class

Public Class cptprod
   Inherits System.Web.UI.Page
   Protected WithEvents lbll1_exp As System.Web.UI.WebControls.Label
   Protected WithEvents lbll2_exp As System.Web.UI.WebControls.Label
   Protected WithEvents lbll1_cha As System.Web.UI.WebControls.Label
   Protected WithEvents lbll2_cha As System.Web.UI.WebControls.Label
   Protected WithEvents lbll1_bou As System.Web.UI.WebControls.Label
   Protected WithEvents lbll2_bou As System.Web.UI.WebControls.Label
   Protected WithEvents lbll6_bou As System.Web.UI.WebControls.Label
   Protected WithEvents lbll1_sto As System.Web.UI.WebControls.Label
   Protected WithEvents lbll2_sto As System.Web.UI.WebControls.Label
   Protected WithEvents lbll6_sto As System.Web.UI.WebControls.Label
   Protected WithEvents lbll1_mod As System.Web.UI.WebControls.Label
   Protected WithEvents lbll2_mod As System.Web.UI.WebControls.Label
   Protected WithEvents lbll6_mod As System.Web.UI.WebControls.Label
   Protected WithEvents lbll1_pic As System.Web.UI.WebControls.Label
   Protected WithEvents lbll2_pic As System.Web.UI.WebControls.Label
   Protected WithEvents lbll6_pic As System.Web.UI.WebControls.Label
   Protected WithEvents lbll1_cpt As System.Web.UI.WebControls.Label
   Protected WithEvents lbll2_cpt As System.Web.UI.WebControls.Label
   Protected WithEvents lbll6_cpt As System.Web.UI.WebControls.Label
   Protected WithEvents lbljour_clt As System.Web.UI.WebControls.Label
   Protected WithEvents lbljour_lear As System.Web.UI.WebControls.Label
   Protected WithEvents lblveille_clt As System.Web.UI.WebControls.Label
   Protected WithEvents lblveille_lear As System.Web.UI.WebControls.Label


   Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
      'Placez ici le code utilisateur pour initialiser la page

      'Création d'une nouvelle instance de l'objet compteurs
      Dim cpt As New CompteursProd()

      MsgBox("pouet")

      'h = cpt.stat_lig1.A_lancer
      lbll1_cha.Text = cpt.stat_lig1.Charge
      lbll1_bou.Text = cpt.stat_lig1.Cpt_boucle
      lbll1_cpt.Text = cpt.stat_lig1.Cpt_lear
      lbll1_exp.Text = cpt.stat_lig1.set_sur_expedie
      lbll1_mod.Text = cpt.stat_lig1.Set_sur_modules
      lbll1_pic.Text = cpt.stat_lig1.Set_sur_picking
      lbll1_sto.Text = cpt.stat_lig1.Set_sur_stockeur

      'h = cpt.stat_lig2.A_lancer
      lbll2_cha.Text = cpt.stat_lig2.Charge
      lbll2_bou.Text = cpt.stat_lig2.Cpt_boucle
      lbll2_cpt.Text = cpt.stat_lig2.Cpt_lear
      lbll2_exp.Text = cpt.stat_lig2.set_sur_expedie
      lbll2_mod.Text = cpt.stat_lig2.Set_sur_modules
      lbll2_pic.Text = cpt.stat_lig2.Set_sur_picking
      lbll2_sto.Text = cpt.stat_lig2.Set_sur_stockeur

      'h = cpt.stat_lig6.A_lancer
      lbll6_bou.Text = cpt.stat_lig6.Cpt_boucle
      lbll6_cpt.Text = cpt.stat_lig6.Cpt_lear
      lbll6_mod.Text = cpt.stat_lig6.Set_sur_modules
      lbll6_pic.Text = cpt.stat_lig6.Set_sur_picking
      lbll6_sto.Text = cpt.stat_lig6.Set_sur_stockeur

      'Une fois l'affichage terminé on peut détruire l'objet
      cpt.dispose()

   End Sub
End Class

Mon problème est que je n'arrive pas à exécuter le code se situant dans le Page_Load....et c'est ce qui me permet d'afficher mes compteurs dans ma page !!

HELP ME !! AU SECOURS !!! 

Si vous trouvez ma solution, je vous en serez grandement reconnaissant !!
A moins que vous connaissiez une autre technique !?!

Cocci... un développeur perdu en ASP !! 

« Dernière Édition: le 16-09-2003 a 18:55:12 par Netah » Rapporter au modérateur  

>> http://www.tuto-paradize.com <<

Re:Comment ca marche ASP sous Visual Basic. Net ??
« Répondre #1 sur: le 29-08-2003 a 19:12:31 »
Netah
Modérateur Global
*****

Hors-Ligne

Sexe: Male
Messages: 1256



ZoneB.org
netah_x@yahoo.com
Voir le Profil    WWW
Répondre avec citation

Salut;

Quelle est l'erreur affichée ?
Je préfère le c# alors je ne suis pas certain de la correction namespace

Code:

Imports JIT_COMMON.JIT_Class
Imports System
Imports System.Web.UI
Imports System.Web.UI.WebControls

Namespace CompteurProduction
Public Class cptprod
  Inherits System.Web.UI.Page
  Protected WithEvents lbll1_exp As System.Web.UI.WebControls.Label
  Protected WithEvents lbll2_exp As System.Web.UI.WebControls.Label
  Protected WithEvents lbll1_cha As System.Web.UI.WebControls.Label
  Protected WithEvents lbll2_cha As System.Web.UI.WebControls.Label
  Protected WithEvents lbll1_bou As System.Web.UI.WebControls.Label
  Protected WithEvents lbll2_bou As System.Web.UI.WebControls.Label
  Protected WithEvents lbll6_bou As System.Web.UI.WebControls.Label
  Protected WithEvents lbll1_sto As System.Web.UI.WebControls.Label
  Protected WithEvents lbll2_sto As System.Web.UI.WebControls.Label
  Protected WithEvents lbll6_sto As System.Web.UI.WebControls.Label
  Protected WithEvents lbll1_mod As System.Web.UI.WebControls.Label
  Protected WithEvents lbll2_mod As System.Web.UI.WebControls.Label
  Protected WithEvents lbll6_mod As System.Web.UI.WebControls.Label
  Protected WithEvents lbll1_pic As System.Web.UI.WebControls.Label
  Protected WithEvents lbll2_pic As System.Web.UI.WebControls.Label
  Protected WithEvents lbll6_pic As System.Web.UI.WebControls.Label
  Protected WithEvents lbll1_cpt As System.Web.UI.WebControls.Label
  Protected WithEvents lbll2_cpt As System.Web.UI.WebControls.Label
  Protected WithEvents lbll6_cpt As System.Web.UI.WebControls.Label
  Protected WithEvents lbljour_clt As System.Web.UI.WebControls.Label
  Protected WithEvents lbljour_lear As System.Web.UI.WebControls.Label
  Protected WithEvents lblveille_clt As System.Web.UI.WebControls.Label
  Protected WithEvents lblveille_lear As System.Web.UI.WebControls.Label


  Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
      'Placez ici le code utilisateur pour initialiser la page

      'Création d'une nouvelle instance de l'objet compteurs
      Dim cpt As New CompteursProd()

      MsgBox("pouet")

      'h = cpt.stat_lig1.A_lancer
      lbll1_cha.Text = cpt.stat_lig1.Charge
      lbll1_bou.Text = cpt.stat_lig1.Cpt_boucle
      lbll1_cpt.Text = cpt.stat_lig1.Cpt_lear
      lbll1_exp.Text = cpt.stat_lig1.set_sur_expedie
      lbll1_mod.Text = cpt.stat_lig1.Set_sur_modules
      lbll1_pic.Text = cpt.stat_lig1.Set_sur_picking
      lbll1_sto.Text = cpt.stat_lig1.Set_sur_stockeur

      'h = cpt.stat_lig2.A_lancer
      lbll2_cha.Text = cpt.stat_lig2.Charge
      lbll2_bou.Text = cpt.stat_lig2.Cpt_boucle
      lbll2_cpt.Text = cpt.stat_lig2.Cpt_lear
      lbll2_exp.Text = cpt.stat_lig2.set_sur_expedie
      lbll2_mod.Text = cpt.stat_lig2.Set_sur_modules
      lbll2_pic.Text = cpt.stat_lig2.Set_sur_picking
      lbll2_sto.Text = cpt.stat_lig2.Set_sur_stockeur

      'h = cpt.stat_lig6.A_lancer
      lbll6_bou.Text = cpt.stat_lig6.Cpt_boucle
      lbll6_cpt.Text = cpt.stat_lig6.Cpt_lear
      lbll6_mod.Text = cpt.stat_lig6.Set_sur_modules
      lbll6_pic.Text = cpt.stat_lig6.Set_sur_picking
      lbll6_sto.Text = cpt.stat_lig6.Set_sur_stockeur

      'Une fois l'affichage terminé on peut détruire l'objet
      cpt.dispose()

  End Sub
End Class
End Namespace


Sinon est-ce qu'une simple page en code behind fonctionne ?
"hello.aspx"
Code:

<%@ Page Language="VB" Inherits="TestDotNet.HelloClass" Src="hello.vb" %>
<html>
<head>
</head>
<body>
    <form runat="server">
        <p>
            <asp:Label id="lbl1" runat="server">
            </asp:Label>
        </p>
        <p>
            <asp:Button id="Button1" onclick="Button1_Click" runat="server" Text="Say hello">
            </asp:Button>
        </p>
    </form>
</body>
</html>


avec "hello.vb":
Code:

Imports System
Imports System.Web.UI
Imports System.Web.UI.WebControls

Namespace TestDotNet
    Public Class HelloClass
        Inherits Page
        Protected WithEvents Label1 As Label
        Public Sub Button1_Click(sender As Object, e As EventArgs)
            lbl1.Text = "Hello world !"
        End Sub
    End Class
End Namespace


Est-ce que ca marche ?

Rapporter au modérateur  

skalae.frStages photo - Blog Webmaster - Twitter TLS
Re:Comment ca marche ASP sous Visual Basic. Net ??
« Répondre #2 sur: le 01-09-2003 a 10:27:53 »
Cocci
Brit Deluxe
Guru
*****

Hors-Ligne

Sexe: Male
Messages: 1169



.: In the Mix :.
cocci_87
Voir le Profil    WWW
Répondre avec citation

JE débute et ai le plus grand mal à faire fonctionner tt cela !!

Je viens d'essayer de faire fonctionner simplemment un petit code pour afficher l'heure... même ca ne fonctionne pas !!
Code:

<html>
<body bgcolor="yellow">
<center>
<h2>Hello W3Schools!</h2>
<p><%Response.Write(now())%></p>
</center>
</body>
</html>
J'ai l'impression que mon serveur ne compile pas et n'interprete pas mon code asp !!!

Pourtant mon serveur est démarré !!

Est ce que cela peut vnir d'une mauvaise configuration ?

DOnc pour répondre a ta question, NON, le codebehind n'est pas interprété !! 

Que faire ?

Rapporter au modérateur  

>> http://www.tuto-paradize.com <<
Re:Comment ca marche ASP sous Visual Basic. Net ??
« Répondre #3 sur: le 01-09-2003 a 15:01:16 »
Cocci
Brit Deluxe
Guru
*****

Hors-Ligne

Sexe: Male
Messages: 1169



.: In the Mix :.
cocci_87
Voir le Profil    WWW
Répondre avec citation

Ca yes c bon.... ouf..j'ai ENFIN trouvé d'ou venai le probleme... le serveur n'étais pas configuere pour interpreter les pages aspx. C deja un bon début...

J'ai tjs un autre probleme...mais je vais y réflechir avant de venir vous taquiner ... 

Rapporter au modérateur  

>> http://www.tuto-paradize.com <<
Re:Comment ca marche ASP sous Visual Basic. Net ??
« Répondre #4 sur: le 01-09-2003 a 16:37:57 »
Cocci
Brit Deluxe
Guru
*****

Hors-Ligne

Sexe: Male
Messages: 1169



.: In the Mix :.
cocci_87
Voir le Profil    WWW
Répondre avec citation

et bien j'ai tjs pas trouvé d'ou venai mon problème...

dans ma page default.aspx.vb j'ai mis une dll en référence : JIT_COMMON qui contient .JIT_CLASS

à l'interieur de celle ci se trouve la classe : CompteursProd

Or quand je déclare cette variable (cpt)voilà ce que me dit l'éxplorateur :
Citation:
Détails de l'exception: System.NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.

et voilà le code de ma page default.aspx.vb

Code:

Imports JIT_COMMON.JIT_Class

Public Class prod
   Inherits System.Web.UI.Page
   Protected WithEvents lbll1_exp As System.Web.UI.WebControls.Label
   Protected WithEvents lbll2_exp As System.Web.UI.WebControls.Label
   Protected WithEvents lbll1_cha As System.Web.UI.WebControls.Label
   Protected WithEvents lbll2_cha As System.Web.UI.WebControls.Label
   Protected WithEvents lbll1_bou As System.Web.UI.WebControls.Label
   Protected WithEvents lbll2_bou As System.Web.UI.WebControls.Label
   Protected WithEvents lbll6_bou As System.Web.UI.WebControls.Label
   Protected WithEvents lbll1_sto As System.Web.UI.WebControls.Label
   Protected WithEvents lbll2_sto As System.Web.UI.WebControls.Label
   Protected WithEvents lbll6_sto As System.Web.UI.WebControls.Label
   Protected WithEvents lbll1_mod As System.Web.UI.WebControls.Label
   Protected WithEvents lbll2_mod As System.Web.UI.WebControls.Label
   Protected WithEvents lbll6_mod As System.Web.UI.WebControls.Label
   Protected WithEvents lbll1_pic As System.Web.UI.WebControls.Label
   Protected WithEvents lbll2_pic As System.Web.UI.WebControls.Label
   Protected WithEvents lbll6_pic As System.Web.UI.WebControls.Label
   Protected WithEvents lbll1_cpt As System.Web.UI.WebControls.Label
   Protected WithEvents lbll2_cpt As System.Web.UI.WebControls.Label
   Protected WithEvents lbll6_cpt As System.Web.UI.WebControls.Label
   Protected WithEvents lbljour_clt As System.Web.UI.WebControls.Label
   Protected WithEvents lbljour_lear As System.Web.UI.WebControls.Label
   Protected WithEvents lblveille_clt As System.Web.UI.WebControls.Label
   Protected WithEvents lblveille_lear As System.Web.UI.WebControls.Label


   Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
      '''Placez ici le code utilisateur pour initialiser la page
      Dim cpt As New CompteursProd()    <<=== ********erreur ici !!!****
      lbll1_cha.Text = cpt.stat_lig1.Charge
      lbll1_bou.Text = cpt.stat_lig1.Cpt_boucle
      lbll1_cpt.Text = cpt.stat_lig1.Cpt_lear
      lbll1_exp.Text = cpt.stat_lig1.set_sur_expedie
      lbll1_mod.Text = cpt.stat_lig1.Set_sur_modules
      lbll1_pic.Text = cpt.stat_lig1.Set_sur_picking
      lbll1_sto.Text = cpt.stat_lig1.Set_sur_stockeur

      lbll2_cha.Text = cpt.stat_lig2.Charge
      lbll2_bou.Text = cpt.stat_lig2.Cpt_boucle
      lbll2_cpt.Text = cpt.stat_lig2.Cpt_lear
      lbll2_exp.Text = cpt.stat_lig2.set_sur_expedie
      lbll2_mod.Text = cpt.stat_lig2.Set_surmodules
      lbll2_pic.Text = cpt.stat_lig2.Set_sur_picking
      lbll2_sto.Text = cpt.stat_lig2.Set_sur_stockeur

      lbll6_bou.Text = cpt.stat_lig6.Cpt_boucle
      lbll6_cpt.Text = cpt.stat_lig6.Cpt_lear
      lbll6_mod.Text = cpt.stat_lig6.Set_sur_modules
      lbll6_pic.Text = cpt.stat_lig6.Set_sur_picking
      lbll6_sto.Text = cpt.stat_lig6.Set_sur_stockeur

      ''Une fois l'affichage terminé on peut détruire l'objet
      cpt.dispose()

   End Sub

End Class

VENEZ MOI EN AIDE !!! Ma vie est en jeu !! 

Rapporter au modérateur  

>> http://www.tuto-paradize.com <<
Re:Comment ca marche ASP sous Visual Basic. Net ??
« Répondre #5 sur: le 01-09-2003 a 20:23:59 »
Netah
Modérateur Global
*****

Hors-Ligne

Sexe: Male
Messages: 1256



ZoneB.org
netah_x@yahoo.com
Voir le Profil    WWW
Répondre avec citation

Salut... Un peu de retard ce coup si... Je fais du sport et donc moins de net

Déjà tu ne déclares pas une variable mais une instance d'objet.

Si ta class CompteursProd est dans une dll, elle doit etre dans un sous dossier ./bin de l'application.

Attention à ta config server. Tu as par exemple le site par défault. Quand tu crées un dossier dedans, tu dois le transformer en application dans iis ou en faire un dossier virtuel. Dans ce sous dossier, tu auras ton dossier ./bin
ce qui donne http://localhost/monapp  dans lequel tu auras /bin
Dans iis pour faire du dossier monapp une application, tu cliques btn doit / répertoire de base. En face de la ligne application, tu cliques sur créer.

Pour tester, place à la racine de l'application:
default.aspx
Code:

<%@ Page Language="VB" Inherits="TestDotNet.HelloClass" %>
<html>
<head>
</head>
<body>
    <form runat="server">
        <p>
            <asp:Label id="lbl1" runat="server">
            </asp:Label>
        </p>
        <p>
            <asp:Button id="Button1" onclick="Button1_Click" runat="server" Text="Say hello">
            </asp:Button>
        </p>
    </form>
</body>
</html>

Compile avec la ligne de commande (si c la meme chose que csc.exe )
vbc /target:library test.vb
Code:

Imports System
Imports System.Web.UI
Imports System.Web.UI.WebControls

Namespace TestDotNet
    Public Class HelloClass
        Inherits Page
        Protected WithEvents Label1 As Label
        Public Sub Button1_Click(sender As Object, e As EventArgs)
            lbl1.Text = "Hello world !"
        End Sub
    End Class
End Namespace
Place test.dll dans le sous-dossier ./bin de l'application
Teste l'application http://localhost/monapp

Normalement, ca devrait fonctionner. Le principe est le meme pour ton autre class (avec l'autre dll).

Rapporter au modérateur  

skalae.frStages photo - Blog Webmaster - Twitter TLS
Re:Comment ca marche ASP sous Visual Basic. Net ??
« Répondre #6 sur: le 02-09-2003 a 09:14:11 »
Cocci
Brit Deluxe
Guru
*****

Hors-Ligne

Sexe: Male
Messages: 1169



.: In the Mix :.
cocci_87
Voir le Profil    WWW
Répondre avec citation

Alors, tout dabord merci de t'attarder a mon problème ! 

Alors, dans iis j'ai belle et bien crée un répertoire virtuel avec ma dll qui se trouve bien dans le répertoire bin !

Le petit exemple que tu ma passé fonctionne a merveille !!

Mais mon programme...toujours pas !!! 

Citation:
Détails de l'exception: System.NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.

Code:

Ligne 46 :    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Ligne 47 :       '''Placez ici le code utilisateur pour initialiser la page
Ligne 48 :       Dim cpt As New CompteursProd()
Ligne 49 :       'h = cpt.stat_lig1.A_lancer
Ligne 50 :       lbll1_cha.Text = cpt.stat_lig1.Charge

Ce que je n'arrive pas a comprendre, c'est que lorsque l'on procede  à un Dim, cela a comme objectif de créer et d'instancier l'objet !! NON ??!? 

Donc d'ou peut bien provenir cette erreur (les mots me manque là !! )

Rapporter au modérateur  

>> http://www.tuto-paradize.com <<
Re:Comment ca marche ASP sous Visual Basic. Net ??
« Répondre #7 sur: le 03-09-2003 a 08:38:40 »
Netah
Modérateur Global
*****

Hors-Ligne

Sexe: Male
Messages: 1256



ZoneB.org
netah_x@yahoo.com
Voir le Profil    WWW
Répondre avec citation

Tu as raison sur le principe. Es-tu certain du fonctionnement de la dll (nom de la class, type...) ?
Je ne peux plus trop t'aider car j'ai un peu (bcp) oublié la syntaxe vb. Je m'y pencherais surement la semaine prochaine et je serais plus à meme de t'aider mais j'ai peur que ça soit trop tard Dsl

Rapporter au modérateur  

skalae.frStages photo - Blog Webmaster - Twitter TLS
Re:Comment ca marche ASP sous Visual Basic. Net ??
« Répondre #8 sur: le 10-09-2003 a 16:37:18 »
Cocci
Brit Deluxe
Guru
*****

Hors-Ligne

Sexe: Male
Messages: 1169



.: In the Mix :.
cocci_87
Voir le Profil    WWW
Répondre avec citation

Merci pour ton aide....

je t'écris pour t'avertir de ne plus chercher sur ce problème,...bon...je ne l'ai pas résolu... ...mais comme tout problèmes..il n'existe jamais qu'une seul solution..alors j'ai procédé autrement et tout fonctionne...

Et oui..je sais je suis un petit malin..j'évite les problemes quand ceci devienne trop conséquent !!

++

Rapporter au modérateur  

>> http://www.tuto-paradize.com <<
Répondre    Aviser des réponses    Envoyer le sujet    Imprimer
Pages: [1] Monter
« Précédent Suivant »
Sauter à: 

Votre statut : Invité
Vous devez être membre pour participer.
 
 
Let’s Encrypt : le certificat SSL gratuit
Tester votre site internet sur différents navigateurs
[WordPress] Des problèmes avec l’administration ?
Rappel : Mettez à jour vos CMS et vos sites E-commerce
Le .fr fête ses 25 années d’existence !
Mesurer votre audience en temps réel avec BubbleStat
Porter réclamation contre Google Panda ?
Zlio n’est plus …
 
 
 
 
 

Copyright (c) Devclic 2002 - 2026 - Tous droits réservés

creation site internet strasbourg