Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

asp.net vb.net code behind

Posted on 2011-09-14
3
Medium Priority
?
276 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
3 Comments
 
LVL 60

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 60

Expert Comment

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

Accepted Solution

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

and move it to line 2
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

618 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