473,473 Members | 2,098 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Using a Link Button to redirect to another page by using data from

I'm trying to determine how to create a page with data from the database and
I want to use the link button to have the user click on. Once the user
clicks on the link button I want to transfer them to another page, passing,
for example, the customer id from my database.

How to I create a url for this link button, that includes the page name and
passing the page emp_id=1 as the argument?

--
Sincerely,

Keith
Nov 19 '05 #1
1 3606
Keith:
Your question is a little ambiguous. Is this in a databinding environment?
(ie, you have multiple records that you want to display mutiple links?) or a
single link?

In the first case, i'd use a binding control (repeater/datalist/datagrid,
depending on your needs) and simply do:

<itemTemplate>
<tr>
<td><%# DataBinder.Eval(Container.DataItem, "FirstName") %></td>
<td><a href='edit.aspx?uid=<%# DataBinder.Eval(Container.DataItem,
"UserId") %>'>edit</a></td>
</tr>
</itemTemplate>

in the 2nd case I'd create an HtmlAnchor in the html-->

<a id="logout" runat="Server" />

and in codebehind declare the control:

protected logout as HtmlAnchor

Sub Page_Load
dim ds as DataSet = GetDatabaseData()
logout.Href = "logout.aspx?userId=" +
ds.tables(0).Rows(0)("UserId").ToString()
end sub

in the above example a dataset is overkill for a single value..and you'd
want to do some error checking (what if ds is null for example)

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"GTDriver" <GT******@discussions.microsoft.com> wrote in message
news:6C**********************************@microsof t.com...
I'm trying to determine how to create a page with data from the database and I want to use the link button to have the user click on. Once the user
clicks on the link button I want to transfer them to another page, passing, for example, the customer id from my database.

How to I create a url for this link button, that includes the page name and passing the page emp_id=1 as the argument?

--
Sincerely,

Keith

Nov 19 '05 #2

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

Similar topics

3
by: Steven | last post by:
All I want to pop up a window before/during redirect to another page. Sort of a confirmation page: <? .... /* I need to pop up a window here */
2
by: terry | last post by:
Hi, I am using a FrameSet with three frames. In server code (c# code behind) is it possible for a page to call a function in another page of the frameset? I suspect that it is not possible but...
4
by: Dennis E. Jones, Jr. | last post by:
I need to post an ASP.NET form between sites for report processing. Site A contains the asp.net forms and site B contains Java Servlets for report processing. All form fields values must be...
0
by: Bidarkota | last post by:
Can i access serverside selectbox using javascript in another page. if it is possible please help me with sample code. thanks in advance
3
by: jonefer | last post by:
I've written the code to do a search from one page and display the results on another - and then I got stuck (because I'm just beginning) It's amazing how difficult it can be to find something so...
6
by: Matt | last post by:
On my master page i have build 5 link buttons. First Page I receive ID and set the ID in master page Property so i can do the work with it. How ever when i clicked to second button i lose this ID....
2
by: Newbie19 | last post by:
I am using VB, ASP, and SQL to create an application that pulls data from a Network Drive on my network. I was looking around and haven't found a way to do such. Any advice would be great.
2
cameokid
by: cameokid | last post by:
Hi, Here is the problem which i am facing. I am trying to delete rows (using nodes) containing XML data. I am doing this to add new set of data from XML file by using a dropdown selection. ...
6
by: smartic | last post by:
in my site I'm having gallery page that you can upload your pictures in steps first step you upload the picture then go to another page, my problem is i want to use this file that have been uploaded...
1
by: =?iso-8859-1?Q?Cleber_Sch=F6nhofen?= | last post by:
Hi, I have a page that returns data from other execution of the same page, if it occurs simultaneously consultation. Who knows why? -- Cleber Schönhofen Infobola
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
1
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.