Solved

Set Template Label Value To Vb.Net Variable

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 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