Below is what I have been precisely looking for:

********

Private Sub Page_Load(ByVal sender As System.Object, _

ByVal e As System.EventArgs) Handles MyBase.Load

' Put user code to initialize the page here

Dim ck As Object, cmd As String

cmd = "SELECT ProductID, ProductName, UnitPrice " & _

"FROM Products WHERE ProductID IN ("

For Each ck In Session

cmd = cmd & ck.ToString & ", "

Next

cmd = cmd.Substring(0, cmd.Length - 2) & ")"

SqlConnection1.Open()

DASelectedProducts.SelectCommand.CommandText = cmd

DASelectedProducts.SelectCommand.CommandType = CommandType.Text

Dim Reader As Data.SqlClient.SqlDataReader = _

DASelectedProducts.SelectCommand.ExecuteReader

Dim prodName As String, prodID As Integer, prodPrice As Decimal

Dim subTotal As Decimal, table As String

table = "<TABLE BORDER='1'><TR>"

table = table & "<TD><B>Product Name</B></TD><TD><B>Quantity</B></TD>"

table = table & "<TD><B>Price</B></TD><TD><B>Subtotal</B></TD></TR>"

While Reader.Read

table = table & "<TR><TD>"

prodName = Reader.Item("ProductName")

prodID = Reader.Item("ProductID")

prodPrice = Reader.Item("UnitPrice")

table = table & prodName & "</TD>"

table = table & "<TD ALIGN='right'>" & Session(CStr(prodID)) & "</TD>"

table = table & "<TD ALIGN='right'>" & prodPrice & "</TD>"

subTotal = prodPrice * Session(CStr(prodID))

 

table = table & "<TD ALIGN='right'>" & subtotal & "</TD></TR>"

total = total + subTotal

End While

table = table & "</TABLE>"

table = table & "<P><B>Your total is " & total.ToString & "</B></P>"

lblBasket.Text = table

SqlConnection1.Close()

End Sub

 

 

*******

 

 

  _____  

From: Ben Miller [mailto:[EMAIL PROTECTED] 
Sent: Sunday, December 26, 2004 7:55 PM
To: [email protected]
Subject: Re: [AspNetAnyQuestionIsOk] Label.text= html code

 

You need to use an <asp:Literal /> instead.  The Label emits a <SPAN>
</SPAN> and that would not be good to put into the title.

When you use an <asp:Literal /> everything you put in the text goes in there
raw.

And you still use it like literal.Text (literal being the name of the
control in the ID="literal").

HTH.

Ben Miller

  ----- Original Message ----- 
  From: Usman Ghani 
  To: [email protected] 
  Sent: Sunday, December 26, 2004 5:34 AM
  Subject: RE: [AspNetAnyQuestionIsOk] Label.text= html code


  Yes I am trying to do something similar

    _____  

  From: Mahboob Ahmed [mailto:[EMAIL PROTECTED] 
  Sent: Saturday, December 25, 2004 10:43 AM
  To: [email protected]
  Subject: RE: [AspNetAnyQuestionIsOk] Label.text= html code




  hi,
  u can use this code
  here mytitle is field name which is in the data table

  <head><title><%=mytitle%></title>
  </head>


  ....................................................................

  >From: "Usman Ghani" <[EMAIL PROTECTED]>
  >Reply-To: [email protected]
  >To: <[email protected]>
  >Subject: [AspNetAnyQuestionIsOk] Label.text= html code
  >Date: Fri, 24 Dec 2004 21:13:31 +0300
  >
  >Hi All,
  >
  >
  >
  >I have a web page reply.aspx, I have a label control on it. Ok what I
want
  >to do is that I want to read from a data table using a datareader and
then
  >display the value in the label as html, I mean using asp script sytax. I
  >canot explain well here but it's like having an html code to be placed in
  >the text value of label. Reading from database not a problem but how it 
  >will
  >be inserted in the label as html code is something where I need help.
  >
  >
  >
  >Thanks,
  >
  >
  >
  >Usman
  >
  >
  >
  >[Non-text portions of this message have been removed]
  >

  _________________________________________________________________
  Express yourself instantly with MSN Messenger! Download today it's FREE! 
  http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/









  Yahoo! Groups Sponsor



  ADVERTISEMENT

 
<http://us.ard.yahoo.com/SIG=1294kc0ov/M=295196.4901138.6071305.3001176/D=gr
 
oups/S=1705006764:HM/EXP=1104049069/A=2128215/R=0/SIG=10se96mf6/*http:/compa
  nion.yahoo.com> click here



 
<http://us.adserver.yahoo.com/l?M=295196.4901138.6071305.3001176/D=groups/S=
  :HM/A=2128215/rand=224541147> 



    _____  

  Yahoo! Groups Links

  *      To visit your group on the web, go to:
  http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
    
  *      To unsubscribe from this group, send an email to:
  [EMAIL PROTECTED]
 
<mailto:[EMAIL PROTECTED]
  e> 
    
  *      Your use of Yahoo! Groups is subject to the Yahoo!
  <http://docs.yahoo.com/info/terms/>  Terms of Service. 



  [Non-text portions of this message have been removed]


        Yahoo! Groups Sponsor 
         
        Get unlimited calls to

        U.S./Canada
       
       


----------------------------------------------------------------------------
--
  Yahoo! Groups Links

    a.. To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
      
    b.. To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]
      
    c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.




[Non-text portions of this message have been removed]






Yahoo! Groups Sponsor



ADVERTISEMENT
 
<http://us.ard.yahoo.com/SIG=129rjlci9/M=294855.5468653.6549235.3001176/D=gr
oups/S=1705006764:HM/EXP=1104166624/A=2455396/R=0/SIG=119u9qmi7/*http:/small
business.yahoo.com/domains/> click here


 
<http://us.adserver.yahoo.com/l?M=294855.5468653.6549235.3001176/D=groups/S=
:HM/A=2455396/rand=772296735> 

 

  _____  

Yahoo! Groups Links

*       To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
  
*       To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]
e> 
  
*       Your use of Yahoo! Groups is subject to the Yahoo!
<http://docs.yahoo.com/info/terms/>  Terms of Service. 



[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to