Solved

Set Template Label Value To Vb.Net Variable

Posted on 2011-03-07
2
773 Views
Last Modified: 2012-06-21
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
Comment
Question by:thedeal56
2 Comments
 
LVL 4

Accepted Solution

by:
Tuyau2poil earned 500 total points
ID: 35063144
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
 

Author Closing Comment

by:thedeal56
ID: 35063305
That did it.  Thanks.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now