Solved

Set Template Label Value To Vb.Net Variable

Posted on 2011-03-07
2
774 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

815 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

13 Experts available now in Live!

Get 1:1 Help Now