473,397 Members | 2,056 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

How do I pass a NavigateURL result to another web form

I've got a web form working with a repeater, using code below. My goal is to
generate a list of hyperlinks that, once clicked, take me to another page
with related information that was clicked.

If I hover over the link, I can see that the correct title's ID is there.
Now how do I "pass" the result to another page (with that ID).

So let's say that I have 3 items generated from the code below:

Title_1
Title_B
Title_Z

When I click on Title_B, I want to redirect to a web form that contain that
title's Code. So if Title_B's CodeID is 2 (which I can see by hovering over
it with the mouse), I would imagine I would want some SQL like (this is how
I would select it in Access):

SELECT tblCode.Code, tblCode.CodeID FROM tblCode WHERE
(((tblCode.CodeID)=2));

How do I do this with Asp.Net by "linking" the web forms?

'--------------------------------------------------------
<%@ Import namespace="System.Data" %>
<%@ Import namespace="System.Data.OleDb" %>
<%@ Page debug="true" %>
<html>
<asp:Repeater id="Repeater1" runat="server">
<ItemTemplate>
<asp:HyperLink id="HyperLink1" runat="server"
NavigateUrl='<%#"http://localhost/ngrid1/repeater.aspx?a=" &
Container.DataItem("CodeID")%>'>'<%# DataBinder.Eval(Container.DataItem,
"Title")%>'</asp:HyperLink>
<br>
</ItemTemplate>
</asp:Repeater>
</html>
<script language="VB" runat="server">
Sub Page_Load(Source As Object, E As EventArgs)
Dim strConnection As String = "Provider=Microsoft.Jet.OleDb.4.0;" & _
"data source=D:\Data\Codelib\codelib.mdb;"
Dim objConnection As New OleDbConnection(strConnection)
Dim strSQL As String = "SELECT CodeID, Title from tblCode;"
Dim objCommand As New OleDbCommand(strSQL, objConnection)
objConnection.Open()
Repeater1.DataSource = objCommand.ExecuteReader()
Repeater1.DataBind()
objConnection.Close()
End Sub
</script>
'----------------------------------------------
Nov 18 '05 #1
2 1613
Nobody can help me out here?

"timmso" <ti**************@Yahoo.com> wrote in message
news:eB**************@TK2MSFTNGP12.phx.gbl...
I've got a web form working with a repeater, using code below. My goal is to generate a list of hyperlinks that, once clicked, take me to another page
with related information that was clicked.

If I hover over the link, I can see that the correct title's ID is there.
Now how do I "pass" the result to another page (with that ID).

So let's say that I have 3 items generated from the code below:

Title_1
Title_B
Title_Z

When I click on Title_B, I want to redirect to a web form that contain that title's Code. So if Title_B's CodeID is 2 (which I can see by hovering over it with the mouse), I would imagine I would want some SQL like (this is how I would select it in Access):

SELECT tblCode.Code, tblCode.CodeID FROM tblCode WHERE
(((tblCode.CodeID)=2));

How do I do this with Asp.Net by "linking" the web forms?

'--------------------------------------------------------
<%@ Import namespace="System.Data" %>
<%@ Import namespace="System.Data.OleDb" %>
<%@ Page debug="true" %>
<html>
<asp:Repeater id="Repeater1" runat="server">
<ItemTemplate>
<asp:HyperLink id="HyperLink1" runat="server"
NavigateUrl='<%#"http://localhost/ngrid1/repeater.aspx?a=" &
Container.DataItem("CodeID")%>'>'<%# DataBinder.Eval(Container.DataItem,
"Title")%>'</asp:HyperLink>
<br>
</ItemTemplate>
</asp:Repeater>
</html>
<script language="VB" runat="server">
Sub Page_Load(Source As Object, E As EventArgs)
Dim strConnection As String = "Provider=Microsoft.Jet.OleDb.4.0;" & _
"data source=D:\Data\Codelib\codelib.mdb;"
Dim objConnection As New OleDbConnection(strConnection)
Dim strSQL As String = "SELECT CodeID, Title from tblCode;"
Dim objCommand As New OleDbCommand(strSQL, objConnection)
objConnection.Open()
Repeater1.DataSource = objCommand.ExecuteReader()
Repeater1.DataBind()
objConnection.Close()
End Sub
</script>
'----------------------------------------------

Nov 18 '05 #2
Nobody can help me out here?

"timmso" <ti**************@Yahoo.com> wrote in message
news:eB**************@TK2MSFTNGP12.phx.gbl...
I've got a web form working with a repeater, using code below. My goal is to generate a list of hyperlinks that, once clicked, take me to another page
with related information that was clicked.

If I hover over the link, I can see that the correct title's ID is there.
Now how do I "pass" the result to another page (with that ID).

So let's say that I have 3 items generated from the code below:

Title_1
Title_B
Title_Z

When I click on Title_B, I want to redirect to a web form that contain that title's Code. So if Title_B's CodeID is 2 (which I can see by hovering over it with the mouse), I would imagine I would want some SQL like (this is how I would select it in Access):

SELECT tblCode.Code, tblCode.CodeID FROM tblCode WHERE
(((tblCode.CodeID)=2));

How do I do this with Asp.Net by "linking" the web forms?

'--------------------------------------------------------
<%@ Import namespace="System.Data" %>
<%@ Import namespace="System.Data.OleDb" %>
<%@ Page debug="true" %>
<html>
<asp:Repeater id="Repeater1" runat="server">
<ItemTemplate>
<asp:HyperLink id="HyperLink1" runat="server"
NavigateUrl='<%#"http://localhost/ngrid1/repeater.aspx?a=" &
Container.DataItem("CodeID")%>'>'<%# DataBinder.Eval(Container.DataItem,
"Title")%>'</asp:HyperLink>
<br>
</ItemTemplate>
</asp:Repeater>
</html>
<script language="VB" runat="server">
Sub Page_Load(Source As Object, E As EventArgs)
Dim strConnection As String = "Provider=Microsoft.Jet.OleDb.4.0;" & _
"data source=D:\Data\Codelib\codelib.mdb;"
Dim objConnection As New OleDbConnection(strConnection)
Dim strSQL As String = "SELECT CodeID, Title from tblCode;"
Dim objCommand As New OleDbCommand(strSQL, objConnection)
objConnection.Open()
Repeater1.DataSource = objCommand.ExecuteReader()
Repeater1.DataBind()
objConnection.Close()
End Sub
</script>
'----------------------------------------------

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Wayne Wengert | last post by:
I have an application where a session variable is set in an ASPX page, The process calls an ASP page and when in that page the session variable appears to be null. How can I pass a session variable...
1
by: Greg Reynolds | last post by:
Hi, I need to create datagrid hyperlink columns with multiple parameters in the URL. In my research on how to do this, it is recommended to create a template column which I have done. The code...
4
by: Tomek R. | last post by:
Hello ! This post does'nt regard column hyperlink. I just have single hyperlink and want to create it's NavigateUrl dynamically. This is my test page <form id="Form1" method="post"...
1
by: samir dsf | last post by:
hi i can send and retrieve a single value. but now i have around 3-4 values which i want to pass, from a link and receive in another page. here is how i am currently doing: Dim urlParams As...
2
by: c676228 | last post by:
Hi, This is my first time to post asp.net question on this forum. I have a question for "How to pass the first form value to the next form" I have enrollinfo.aspx form which look like as follow:...
5
by: Vear | last post by:
Sorry, very Newbie question here. I don't know what I'm doing wrong. I have to use a <asp:hyperlink> to go to another page. I want to pick up the value in a text box. This is what I've tried and It...
2
by: =?Utf-8?B?cm9kY2hhcg==?= | last post by:
hey all, i'm in a template column of a gridview. i have a hyperlink in the Item Template and i'm trying to do a custom binding expression to it. So far i have the following: Eval("FILE_ID",...
7
by: Boki | last post by:
Hi All, I can't pass data to another form: in form2: private void button1_Click(object sender, EventArgs e) { Form1 form_copy = new Form1();
9
by: JRough | last post by:
I tried to pass the $result from a mysql_query in a url like this line Header("Location:clm_historyXL.php?_result=".$result); but on the redirect location clm_history.php page I get an error on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.