Solved

asp.net vb.net code behind

Posted on 2011-09-14
3
267 Views
Last Modified: 2012-06-21
I would like to carry the value of SelectedPartNo  from code behind to aspx
and i have id2=<%=SelectedPartNo%> and it is not working now.

How can I fix it?
Test.vb

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim SelectedId = String.Empty
        SelectedId = Request.QueryString("id")
        Dim SelectedPartNo = String.Empty
        If (SelectedId <> "") Then
            SelectedPartNo = SingleItem(SelectedId, "1")
        End If
End Sub

Text.aspx
<asp:DataList RepeatColumns="4" Font-Bold="true" 
        ID="DataList1" runat="server" DataSourceID="SqlDataSource1" Width="630px">
        <ItemTemplate>
            <br /><a href=Default.aspx?PL=Sitemap&id=<%# Eval("CATEGORY")%>&id2=<%=SelectedPartNo%>><font color="blue" size="2"><%# Eval("CATEGORY") %></font></a><br />
        </ItemTemplate>
    </asp:DataList>

Open in new window

0
Comment
Question by:Webboy2008
  • 3
3 Comments
 
LVL 51

Expert Comment

by:HainKurt
ID: 36538785
try

<a href="Default.aspx?PL=Sitemap&id=<%# Eval("CATEGORY")%>&id2=<%=SelectedPartNo%>">

what is not working? any error message? what is rendered html?
0
 
LVL 51

Expert Comment

by:HainKurt
ID: 36538787
make sure SelectedPartNo is defined as public/friend
0
 
LVL 51

Accepted Solution

by:
HainKurt earned 500 total points
ID: 36538795
Dim SelectedPartNo = String.Empty
-->
public SelectedPartNo = String.Empty

and move it to line 2
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

759 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

20 Experts available now in Live!

Get 1:1 Help Now