Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Please help????


Message #1 by Philip Tham <philipt1@s...> on Sat, 22 Feb 2003 09:32:33 -0600
I am trying to issue a control block from within a text lable, can you help?
I need to come out with a solution by Monday....

The reason for this solution is able to use the correct control display base
on the codes and issue the control within a text label...

Thanks in advance!

Philip Tham

Message #2 by "Paul Riley" <rilez@t...> on Sat, 22 Feb 2003 15:42:33 -0000
You've lost me completely. If I understand you correctly you want to put
a control inside a label? You can't do that to my knowledge. You could
however define a span or a div with some text in it (your label) and
then put the control in the span as well. This should work fine.

All the best and good luck

Paul Riley

-----Original Message-----
From: Philip Tham [mailto:philipt1@s...] 
Sent: 22 February 2003 15:33
To: ASP.NET
Subject: [aspx] Please help????


I am trying to issue a control block from within a text lable, can you
help? I need to come out with a solution by Monday....

The reason for this solution is able to use the correct control display
base on the codes and issue the control within a text label...

Thanks in advance!

Philip Tham



Message #3 by Philip Tham <philipt1@s...> on Sat, 22 Feb 2003 09:48:04 -0600
Thanks Paul, can you send me a couple of line on how to define span and div?

Philip
----- Original Message ----- 
From: "Paul Riley" <rilez@t...>
To: "ASP.NET" <aspx@p...>
Sent: Saturday, February 22, 2003 9:42 AM
Subject: [aspx] RE: Please help????


> You've lost me completely. If I understand you correctly you want to put
> a control inside a label? You can't do that to my knowledge. You could
> however define a span or a div with some text in it (your label) and
> then put the control in the span as well. This should work fine.
> 
> All the best and good luck
> 
> Paul Riley
> 
> -----Original Message-----
> From: Philip Tham [mailto:philipt1@s...] 
> Sent: 22 February 2003 15:33
> To: ASP.NET
> Subject: [aspx] Please help????
> 
> 
> I am trying to issue a control block from within a text lable, can you
> help? I need to come out with a solution by Monday....
> 
> The reason for this solution is able to use the correct control display
> base on the codes and issue the control within a text label...
> 
> Thanks in advance!
> 
> Philip Tham
> 
> 
> 
> 
Message #4 by "Paul Riley" <rilez@t...> on Sat, 22 Feb 2003 16:10:22 -0000
Not really got the time to give you custom code but heres the MSDE link
to use

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/h
tml/vbtskaddingcontrolstowebformspageprogrammatically.asp

That should help you out :)

-----Original Message-----
From: Philip Tham [mailto:philipt1@s...] 
Sent: 22 February 2003 15:48
To: ASP.NET
Subject: [aspx] RE: Please help????


Thanks Paul, can you send me a couple of line on how to define span and
div?

Philip
----- Original Message ----- 
From: "Paul Riley" <rilez@t...>
To: "ASP.NET" <aspx@p...>
Sent: Saturday, February 22, 2003 9:42 AM
Subject: [aspx] RE: Please help????


> You've lost me completely. If I understand you correctly you want to 
> put a control inside a label? You can't do that to my knowledge. You 
> could however define a span or a div with some text in it (your label)

> and then put the control in the span as well. This should work fine.
> 
> All the best and good luck
> 
> Paul Riley
> 
> -----Original Message-----
> From: Philip Tham [mailto:philipt1@s...]
> Sent: 22 February 2003 15:33
> To: ASP.NET
> Subject: [aspx] Please help????
> 
> 
> I am trying to issue a control block from within a text lable, can you

> help? I need to come out with a solution by Monday....
> 
> The reason for this solution is able to use the correct control 
> display base on the codes and issue the control within a text label...
> 
> Thanks in advance!
> 
> Philip Tham
> 
> 
> 
> 


Message #5 by Philip Tham <philipt1@s...> on Sat, 22 Feb 2003 13:13:15 -0600
Can we combine a button control and text?

Example:

lblMessage.Text = "Hello, World!" & "<asp:Button id=""Button1""
runat=""server"" Text=""Button""></asp:Button>%>"

When I execute this all I received was "Hello, World!"  - The button is not
display.  Can somebody help??

Thanks
Philip

----- Original Message -----
From: "Paul Riley" <rilez@t...>
To: "ASP.NET" <aspx@p...>
Sent: Saturday, February 22, 2003 10:10 AM
Subject: [aspx] RE: Please help????


> Not really got the time to give you custom code but heres the MSDE link
> to use
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/h
> tml/vbtskaddingcontrolstowebformspageprogrammatically.asp
>
> That should help you out :)
>
> -----Original Message-----
> From: Philip Tham [mailto:philipt1@s...]
> Sent: 22 February 2003 15:48
> To: ASP.NET
> Subject: [aspx] RE: Please help????
>
>
> Thanks Paul, can you send me a couple of line on how to define span and
> div?
>
> Philip
> ----- Original Message -----
> From: "Paul Riley" <rilez@t...>
> To: "ASP.NET" <aspx@p...>
> Sent: Saturday, February 22, 2003 9:42 AM
> Subject: [aspx] RE: Please help????
>
>
> > You've lost me completely. If I understand you correctly you want to
> > put a control inside a label? You can't do that to my knowledge. You
> > could however define a span or a div with some text in it (your label)
>
> > and then put the control in the span as well. This should work fine.
> >
> > All the best and good luck
> >
> > Paul Riley
> >
> > -----Original Message-----
> > From: Philip Tham [mailto:philipt1@s...]
> > Sent: 22 February 2003 15:33
> > To: ASP.NET
> > Subject: [aspx] Please help????
> >
> >
> > I am trying to issue a control block from within a text lable, can you
>
> > help? I need to come out with a solution by Monday....
> >
> > The reason for this solution is able to use the correct control
> > display base on the codes and issue the control within a text label...
> >
> > Thanks in advance!
> >
> > Philip Tham
> >
> >
> >
> >
>
>
>

Message #6 by "Mike Amundsen" <mike@a...> on Sat, 22 Feb 2003 14:47:32 -0500
Why not just do this?

lblMessage.Text =3D "Hello, World!"
<asp:Button id=3D"Button1" runat=3D"server" 
Text=3D"Button"></asp:Button>

if you're trying to add a button at runtime (instead of designing it 
into
the page, you will need to do something like this:

add a PlaceHolder control to a page with the id=3D"ph" then add the 
following
to the page_load event:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
   System.EventArgs) Handles MyBase.Load

   Dim lbMessage As Label =3D New Label
   lbMessage.Text =3D "Hello, World!"

   Dim Button1 As Button =3D New Button
   Button1.Text =3D "Button"

   ph.Controls.Add(lbMessage)
   ph.Controls.Add(Button1)

End Sub


This will get both items on the page as you seem to want to do. 

MCA

> -----Original Message-----
> From: Philip Tham [mailto:philipt1@s...]
> Sent: Saturday, February 22, 2003 2:13 PM
> To: ASP.NET
> Subject: [aspx] RE: Please help????
>
> Can we combine a button control and text?
>
> Example:
>
> lblMessage.Text =3D "Hello, World!" & "<asp:Button id=3D""Button1""
> runat=3D""server"" Text=3D""Button""></asp:Button>%>"
>
> When I execute this all I received was "Hello, World!"  - The button 
is
> not
> display.  Can somebody help??
>
> Thanks
> Philip
>
> ----- Original Message -----
> From: "Paul Riley" <rilez@t...>
> To: "ASP.NET" <aspx@p...>
> Sent: Saturday, February 22, 2003 10:10 AM
> Subject: [aspx] RE: Please help????
>
>
> > Not really got the time to give you custom code but heres the MSDE 
link
> > to use
> >
> > 
http://msdn.microsoft.com/library/default.asp?url=3D/library/en-us/vbcon/
h
> > tml/vbtskaddingcontrolstowebformspageprogrammatically.asp
> >
> > That should help you out :)
> >
> > -----Original Message-----
> > From: Philip Tham [mailto:philipt1@s...]
> > Sent: 22 February 2003 15:48
> > To: ASP.NET
> > Subject: [aspx] RE: Please help????
> >
> >
> > Thanks Paul, can you send me a couple of line on how to define span 
and
> > div?
> >
> > Philip
> > ----- Original Message -----
> > From: "Paul Riley" <rilez@t...>
> > To: "ASP.NET" <aspx@p...>
> > Sent: Saturday, February 22, 2003 9:42 AM
> > Subject: [aspx] RE: Please help????
> >
> >
> > > You've lost me completely. If I understand you correctly you want 
to
> > > put a control inside a label? You can't do that to my knowledge. 
You
> > > could however define a span or a div with some text in it (your 
label)
> >
> > > and then put the control in the span as well. This should work 
fine.
> > >
> > > All the best and good luck
> > >
> > > Paul Riley
> > >
> > > -----Original Message-----
> > > From: Philip Tham [mailto:philipt1@s...]
> > > Sent: 22 February 2003 15:33
> > > To: ASP.NET
> > > Subject: [aspx] Please help????
> > >
> > >
> > > I am trying to issue a control block from within a text lable, can 
you
> >
> > > help? I need to come out with a solution by Monday....
> > >
> > > The reason for this solution is able to use the correct control
> > > display base on the codes and issue the control within a text 
label...
> > >
> > > Thanks in advance!
> > >
> > > Philip Tham
> > >
> > >
> > >
> > >
> >
> >
> >
>
>

Message #7 by Philip Tham <philipt1@s...> on Sat, 22 Feb 2003 14:30:24 -0600
Thanks Mike,  the placeHolder did work out in display the button
dynamically.  However, I can not define the Onclick="SubmitBtn1_Click

Can you help me to understand how to insert the Onclick event?

Philip


----- Original Message -----
From: "Mike Amundsen" <mike@a...>
To: "ASP.NET" <aspx@p...>
Sent: Saturday, February 22, 2003 1:47 PM
Subject: [aspx] RE: Please help????


Why not just do this?

lblMessage.Text = "Hello, World!"
<asp:Button id="Button1" runat="server" Text="Button"></asp:Button>

if you're trying to add a button at runtime (instead of designing it into
the page, you will need to do something like this:

add a PlaceHolder control to a page with the id="ph" then add the following
to the page_load event:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
   System.EventArgs) Handles MyBase.Load

   Dim lbMessage As Label = New Label
   lbMessage.Text = "Hello, World!"

   Dim Button1 As Button = New Button
   Button1.Text = "Button"

   ph.Controls.Add(lbMessage)
   ph.Controls.Add(Button1)

End Sub


This will get both items on the page as you seem to want to do.

MCA

> -----Original Message-----
> From: Philip Tham [mailto:philipt1@s...]
> Sent: Saturday, February 22, 2003 2:13 PM
> To: ASP.NET
> Subject: [aspx] RE: Please help????
>
> Can we combine a button control and text?
>
> Example:
>
> lblMessage.Text = "Hello, World!" & "<asp:Button id=""Button1""
> runat=""server"" Text=""Button""></asp:Button>%>"
>
> When I execute this all I received was "Hello, World!"  - The button is
> not
> display.  Can somebody help??
>
> Thanks
> Philip
>
> ----- Original Message -----
> From: "Paul Riley" <rilez@t...>
> To: "ASP.NET" <aspx@p...>
> Sent: Saturday, February 22, 2003 10:10 AM
> Subject: [aspx] RE: Please help????
>
>
> > Not really got the time to give you custom code but heres the MSDE link
> > to use
> >
> > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/h
> > tml/vbtskaddingcontrolstowebformspageprogrammatically.asp
> >
> > That should help you out :)
> >
> > -----Original Message-----
> > From: Philip Tham [mailto:philipt1@s...]
> > Sent: 22 February 2003 15:48
> > To: ASP.NET
> > Subject: [aspx] RE: Please help????
> >
> >
> > Thanks Paul, can you send me a couple of line on how to define span and
> > div?
> >
> > Philip
> > ----- Original Message -----
> > From: "Paul Riley" <rilez@t...>
> > To: "ASP.NET" <aspx@p...>
> > Sent: Saturday, February 22, 2003 9:42 AM
> > Subject: [aspx] RE: Please help????
> >
> >
> > > You've lost me completely. If I understand you correctly you want to
> > > put a control inside a label? You can't do that to my knowledge. You
> > > could however define a span or a div with some text in it (your label)
> >
> > > and then put the control in the span as well. This should work fine.
> > >
> > > All the best and good luck
> > >
> > > Paul Riley
> > >
> > > -----Original Message-----
> > > From: Philip Tham [mailto:philipt1@s...]
> > > Sent: 22 February 2003 15:33
> > > To: ASP.NET
> > > Subject: [aspx] Please help????
> > >
> > >
> > > I am trying to issue a control block from within a text lable, can you
> >
> > > help? I need to come out with a solution by Monday....
> > >
> > > The reason for this solution is able to use the correct control
> > > display base on the codes and issue the control within a text label...
> > >
> > > Thanks in advance!
> > >
> > > Philip Tham
> > >
> > >
> > >
> > >
> >
> >
> >
>
>



Message #8 by Philip Tham <philipt1@s...> on Sun, 23 Feb 2003 00:29:20 -0600
Can someone tell me why nothing happen when the button clicked.  Here is the
codes:

<%@ Page Language="vb" %>
<script runat="server">

    Sub Page_Load(sender as Object, e as EventArgs)
        Dim lblMessage as New Label()
        Dim butAlone1 as New Button()
        lblMessage.Text = "Hello, World!"
        lblMessage.Font.Bold = True
        butAlone1.text = "Dynamic Button"
        PutLabelHere.Controls.Add(lblMessage)
        PutLabelHere.Controls.Add(butAlone1)
    End Sub

    Protected WithEvents butAlone1 As _
    System.Web.UI.WebControls.Button

    Sub butAlone1_Click(Sender As System.Object, _
         E As System.EventArgs) Handles butAlone1.Click
         Label1.Text = "You clicked the button "
    End Sub
</script>

Here is the form:

 <asp:PlaceHolder id="PutLabelHere" runat="server"></asp:PlaceHolder>
 <p>
 <asp:Label id="Label1" runat="server"></asp:Label>


Thanks

Philip Tham

----- Original Message -----
From: "Mike Amundsen" <mike@a...>
To: "ASP.NET" <aspx@p...>
Sent: Saturday, February 22, 2003 1:47 PM
Subject: [aspx] RE: Please help????


Why not just do this?

lblMessage.Text = "Hello, World!"
<asp:Button id="Button1" runat="server" Text="Button"></asp:Button>

if you're trying to add a button at runtime (instead of designing it into
the page, you will need to do something like this:

add a PlaceHolder control to a page with the id="ph" then add the following
to the page_load event:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
   System.EventArgs) Handles MyBase.Load

   Dim lbMessage As Label = New Label
   lbMessage.Text = "Hello, World!"

   Dim Button1 As Button = New Button
   Button1.Text = "Button"

   ph.Controls.Add(lbMessage)
   ph.Controls.Add(Button1)

End Sub


This will get both items on the page as you seem to want to do.

MCA

> -----Original Message-----
> From: Philip Tham [mailto:philipt1@s...]
> Sent: Saturday, February 22, 2003 2:13 PM
> To: ASP.NET
> Subject: [aspx] RE: Please help????
>
> Can we combine a button control and text?
>
> Example:
>
> lblMessage.Text = "Hello, World!" & "<asp:Button id=""Button1""
> runat=""server"" Text=""Button""></asp:Button>%>"
>
> When I execute this all I received was "Hello, World!"  - The button is
> not
> display.  Can somebody help??
>
> Thanks
> Philip
>
> ----- Original Message -----
> From: "Paul Riley" <rilez@t...>
> To: "ASP.NET" <aspx@p...>
> Sent: Saturday, February 22, 2003 10:10 AM
> Subject: [aspx] RE: Please help????
>
>
> > Not really got the time to give you custom code but heres the MSDE link
> > to use
> >
> > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/h
> > tml/vbtskaddingcontrolstowebformspageprogrammatically.asp
> >
> > That should help you out :)
> >
> > -----Original Message-----
> > From: Philip Tham [mailto:philipt1@s...]
> > Sent: 22 February 2003 15:48
> > To: ASP.NET
> > Subject: [aspx] RE: Please help????
> >
> >
> > Thanks Paul, can you send me a couple of line on how to define span and
> > div?
> >
> > Philip
> > ----- Original Message -----
> > From: "Paul Riley" <rilez@t...>
> > To: "ASP.NET" <aspx@p...>
> > Sent: Saturday, February 22, 2003 9:42 AM
> > Subject: [aspx] RE: Please help????
> >
> >
> > > You've lost me completely. If I understand you correctly you want to
> > > put a control inside a label? You can't do that to my knowledge. You
> > > could however define a span or a div with some text in it (your label)
> >
> > > and then put the control in the span as well. This should work fine.
> > >
> > > All the best and good luck
> > >
> > > Paul Riley
> > >
> > > -----Original Message-----
> > > From: Philip Tham [mailto:philipt1@s...]
> > > Sent: 22 February 2003 15:33
> > > To: ASP.NET
> > > Subject: [aspx] Please help????
> > >
> > >
> > > I am trying to issue a control block from within a text lable, can you
> >
> > > help? I need to come out with a solution by Monday....
> > >
> > > The reason for this solution is able to use the correct control
> > > display base on the codes and issue the control within a text label...
> > >
> > > Thanks in advance!
> > >
> > > Philip Tham
> > >
> > >
> > >
> > >
> >
> >
> >
>
>



Message #9 by "Rohit Arora" <rohit_arora@i...> on Sun, 23 Feb 2003 12:24:16 +0530
In page directive add autoeventwireup to true or add a handler in
initializecomponent for button click

Regards
Rohit Arora
Intersolutions (P) Ltd
B - 21, Sector 58,
Noida - 201301
Tel : 91-2585703/04/05 Extn: 229


-----Original Message-----
From: Philip Tham [mailto:philipt1@s...]
Sent: Sunday, February 23, 2003 11:59 AM
To: ASP.NET
Subject: [aspx] RE: Please help????


Can someone tell me why nothing happen when the button clicked.  Here is the
codes:

<%@ Page Language="vb" %>
<script runat="server">

    Sub Page_Load(sender as Object, e as EventArgs)
        Dim lblMessage as New Label()
        Dim butAlone1 as New Button()
        lblMessage.Text = "Hello, World!"
        lblMessage.Font.Bold = True
        butAlone1.text = "Dynamic Button"
        PutLabelHere.Controls.Add(lblMessage)
        PutLabelHere.Controls.Add(butAlone1)
    End Sub

    Protected WithEvents butAlone1 As _
    System.Web.UI.WebControls.Button

    Sub butAlone1_Click(Sender As System.Object, _
         E As System.EventArgs) Handles butAlone1.Click
         Label1.Text = "You clicked the button "
    End Sub
</script>

Here is the form:

 <asp:PlaceHolder id="PutLabelHere" runat="server"></asp:PlaceHolder>
 <p>
 <asp:Label id="Label1" runat="server"></asp:Label>


Thanks

Philip Tham

----- Original Message -----
From: "Mike Amundsen" <mike@a...>
To: "ASP.NET" <aspx@p...>
Sent: Saturday, February 22, 2003 1:47 PM
Subject: [aspx] RE: Please help????


Why not just do this?

lblMessage.Text = "Hello, World!"
<asp:Button id="Button1" runat="server" Text="Button"></asp:Button>

if you're trying to add a button at runtime (instead of designing it into
the page, you will need to do something like this:

add a PlaceHolder control to a page with the id="ph" then add the following
to the page_load event:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
   System.EventArgs) Handles MyBase.Load

   Dim lbMessage As Label = New Label
   lbMessage.Text = "Hello, World!"

   Dim Button1 As Button = New Button
   Button1.Text = "Button"

   ph.Controls.Add(lbMessage)
   ph.Controls.Add(Button1)

End Sub


This will get both items on the page as you seem to want to do.

MCA

> -----Original Message-----
> From: Philip Tham [mailto:philipt1@s...]
> Sent: Saturday, February 22, 2003 2:13 PM
> To: ASP.NET
> Subject: [aspx] RE: Please help????
>
> Can we combine a button control and text?
>
> Example:
>
> lblMessage.Text = "Hello, World!" & "<asp:Button id=""Button1""
> runat=""server"" Text=""Button""></asp:Button>%>"
>
> When I execute this all I received was "Hello, World!"  - The button is
> not
> display.  Can somebody help??
>
> Thanks
> Philip
>
> ----- Original Message -----
> From: "Paul Riley" <rilez@t...>
> To: "ASP.NET" <aspx@p...>
> Sent: Saturday, February 22, 2003 10:10 AM
> Subject: [aspx] RE: Please help????
>
>
> > Not really got the time to give you custom code but heres the MSDE link
> > to use
> >
> > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/h
> > tml/vbtskaddingcontrolstowebformspageprogrammatically.asp
> >
> > That should help you out :)
> >
> > -----Original Message-----
> > From: Philip Tham [mailto:philipt1@s...]
> > Sent: 22 February 2003 15:48
> > To: ASP.NET
> > Subject: [aspx] RE: Please help????
> >
> >
> > Thanks Paul, can you send me a couple of line on how to define span and
> > div?
> >
> > Philip
> > ----- Original Message -----
> > From: "Paul Riley" <rilez@t...>
> > To: "ASP.NET" <aspx@p...>
> > Sent: Saturday, February 22, 2003 9:42 AM
> > Subject: [aspx] RE: Please help????
> >
> >
> > > You've lost me completely. If I understand you correctly you want to
> > > put a control inside a label? You can't do that to my knowledge. You
> > > could however define a span or a div with some text in it (your label)
> >
> > > and then put the control in the span as well. This should work fine.
> > >
> > > All the best and good luck
> > >
> > > Paul Riley
> > >
> > > -----Original Message-----
> > > From: Philip Tham [mailto:philipt1@s...]
> > > Sent: 22 February 2003 15:33
> > > To: ASP.NET
> > > Subject: [aspx] Please help????
> > >
> > >
> > > I am trying to issue a control block from within a text lable, can you
> >
> > > help? I need to come out with a solution by Monday....
> > >
> > > The reason for this solution is able to use the correct control
> > > display base on the codes and issue the control within a text label...
> > >
> > > Thanks in advance!
> > >
> > > Philip Tham
> > >
> > >
> > >
> > >
> >
> >
> >
>
>






  Return to Index