get label value

Results 1 to 2 of 2

Thread: get label value

  1. #1
    Join Date
    Dec 1969

    Default get label value

    i am trying to get the value of a label to read in my update statement. any solutions?<BR><BR>place init value into label<BR>Sub Page_Load ( s As Object, e As EventArgs )<BR> user_id = session("user_id")<BR> lblID.text = session("user_id")<BR>End Sub<BR><BR>label<BR>&#060;asp:Label id="lblID" Text="&#060;%# user_id %&#062;" runat="server" /&#062; // value is 35<BR><BR>update stmt<BR>"WHERE user_id=" & lblID.Text // right now the value is 0<BR><BR>please let me know if i can supply further info to help this...

  2. #2
    Join Date
    Dec 1969

    Default Can't do it...

    A label is *NOT* a form field. It&#039;s just a convenient way for ASP.NET to dump formatted text into the HTML output.<BR><BR>If you need to pass something like this back to the next page, try passing it in a HIDDEN form field.<BR><BR>[I&#039;m not 100% sure on this, because I&#039;m not a .NET junkie, but having seen the HTML that a &#060;asp:Label .../&#062; generates, I think I am. Certainly there is nothing in the HTML that would allow that value to be passed on to the next server-side page invocation.]<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts