[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 786
  • Last Modified:

Set Template Label Value To Vb.Net Variable

I need to create a vb.net variable from a label's value inside of a template field.  This is what my template looks like:
 
<asp:TemplateField>
                    <ItemTemplate> 
                    <asp:Label ID="Label1" runat="server"  Text='<%# Bind("ctlmap") %>'></asp:Label>  </ItemTemplate> 
                    </asp:TemplateField>

Open in new window


How can I take the value of Label1 and set it to the string "ctlmap" in the following code?:
 
Sub GridView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)


   
     Dim row As GridViewRow = GridView1.SelectedRow
     
     dim ctlmap,bill_group,bill_parcel,propertyid,special as string
     ctlmap = HOW DO I SET THIS TO LABEL1?
     Session("ctlmap") = ctlmap
     response.redirect("Totals_test.aspx")
 

  End Sub

Open in new window

0
thedeal56
Asked:
thedeal56
1 Solution
 
Tuyau2poilCommented:
may be  that code  :

Sub GridView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
     Dim row As GridViewRow = GridView1.SelectedRow
    Dim label1 As label = DirectCast(Row.FindControl("label1"), label)     dim ctlmap,bill_group,bill_parcel,propertyid,special as string
     ctlmap = label1.text
     Session("ctlmap") = ctlmap
     response.redirect("Totals_test.aspx")
 

  End Sub

0
 
thedeal56Author Commented:
That did it.  Thanks.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now