Solved

asp.net vb.net code behind

Posted on 2011-09-14
3
271 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 51

Expert Comment

by:Huseyin KAHRAMAN
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:Huseyin KAHRAMAN
ID: 36538787
make sure SelectedPartNo is defined as public/friend
0
 
LVL 51

Accepted Solution

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

and move it to line 2
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

726 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