p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_codeclinic thread: Help ASP People


Message #1 by "Ahmed Barradah" <havana200@h...> on Thu, 12 Jul 2001 02:50:37
yes

looks good

have you tried it?  does it work?




At 10:10 PM 7/12/2001 +0000, you wrote:
>Dear Mr. Chartier,
>     Thank you for your reply. I am just conerned with outputing the
>Session variable to the applet parameter. Is this line correct?:
>
><PARAM NAME=3D"Username" VALUE=3D"<%=3DSession("Username")%>">
>
>Thank you,
>Ahmed
>
> > when you create the reference to the applet in the HTML code you send
>to=3D20
> > the client you can specify PARAMETERS...just output the session
>("username")=3D
> > =3D20
> > for one of these parameters.
> >
> >
> >
> >
> > At 02:50 AM 7/12/2001 +0000, you wrote:
> >
> >
> > >Hi,
> > >   I have an applet in HTML page. However, in order to access that
>applet
> > >you will have to enter a username. Now, I have a develped a login page
>in
> > >ASP which will ask the user to enter their Username and Password and
>then
> > >store it in a Session variable such as : Session("Username") and
 Session
> > >("Password"). The applet is written in Java as follow:
> > >
> > >import java.awt.event.*;
> > >import javax.swing.*;
> > >
> > >public class PredictOnlineLogin extends JApplet
> > >{
> > >     JButton button_Login =3D3D new JButton("LOGIN");
> > >     JFrame  f;
> > >
> > >     public void init()
> > >     {
> > >         getContentPane().add(button_Login);
> > >         button_Login.addActionListener
> > >             (new ActionListener()
> > >                 {
> > >                      public void actionPerformed(ActionEvent e)
> > >                      {
> > >                         String user_name =3D3D
>JOptionPane.showInputDialog
> > >("Enter your user name:");
> > >                         if (user_name !=3D3D null   &&   !
>user_name.equals
> > >("")) {
> > >                              f =3D3D new JFrame();
> > >                              PredictOnline p =3D3D new PredictOnline
> > >(user_name);
> > >                              p.button_Logout.addActionListener
> > >                                 (new ActionListener()
> > >                                      {
> > >                                         public void actionPerformed
> > >(ActionEvent e)
> > >                                         {
> > >                                              f.dispose();
> > >                                         }
> > >                                      }
> > >                                   );
> > >                              f.getContentPane().add(p);
> > >                              f.pack();
> > >                              f.show();
> > >                         }
> > >                      }
> > >                 }
> > >              );
> > >     }
> > >}
> > >
> > >what I would like to do is to pass the values of the Session variables
>for
> > >username and password that I got from the login page in ASP to the
>applet
> > >so the user won't have to enter his/her username again to access the
> > >applet. I would appreciate any suggestions or comments since it is very
> > >very urgent.


Robert Chartier
Author, AspFree.com
xxx-xxx-xxxx
rob@a...
http://www.aspfree.com/devlinks
http://www.aspfree.com/authors/robert
http://www.aspalliance.com/nothingmn


  Return to Index