Solved

Pass values in Hyperlink to other page

Posted on 2006-07-12
10
841 Views
Last Modified: 2008-02-01
I have a hyperlink and need to pass 2 values from a page to be displayed on the different page (details.aspx page)

One value i want to send is selectedtext of dropdownlist and the other is in a textbox

<asp:hyperlink id="HyperLink1" runat="server" Width="120px" Target ="_blank" NavigateUrl="Details.aspx?">Add New Records

0
Comment
Question by:Junior_Developer
  • 4
  • 4
  • 2
10 Comments
 
LVL 17

Expert Comment

by:Elvio Lujan
ID: 17089808
in page_load:

HyperLink1.NavigateUrl = "Details.aspx?ddl="" + " & dropdownlist.clientid & ".value + ""&textbox="" + " & textbox.clientid & ".value"
0
 
LVL 39

Expert Comment

by:Pratima Pharande
ID: 17089901
in page_load:

HyperLink1.NavigateUrl = "Details.aspx?ddl=" &  dropdownlist.SelecyedItem.value & "&textbox="  &  textbox.text
0
 

Author Comment

by:Junior_Developer
ID: 17089918
this makes a little more sense let me try this
0
 
LVL 17

Expert Comment

by:Elvio Lujan
ID: 17089932
you can't use the pratima soluttion because you need to send the selected value in the moment when click the hyperlink... no in the page_load time
0
 

Author Comment

by:Junior_Developer
ID: 17090003
let me make it more clear what i want.
My dropdownlist has names of employees and i have to calling a stored procedure to get Ids of the selected employee.
i am calling a stored procedure to get ID's in dropdownlist _SelectedIndexChanged

Once this is done use can click on the Hyperlink and i want to pass the selected name in dropdown and the Id which i have as a string by calling the stored procedure.



0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 17

Expert Comment

by:Elvio Lujan
ID: 17090028
did you try my solution posted?
0
 
LVL 39

Accepted Solution

by:
Pratima Pharande earned 500 total points
ID: 17090197
use
HyperLink1.NavigateUrl = "Details.aspx?ddl=" &  dropdownlist.SelecyedItem.value & "&textbox="  &  textbox.text

at the end og  dropdownlist _SelectedIndexChanged
0
 

Author Comment

by:Junior_Developer
ID: 17091787
thanks a lot
0
 
LVL 17

Expert Comment

by:Elvio Lujan
ID: 17091831
this don't work for you...

try to select before the item in the dropdownlist and after write the textbox text...
and then press the hyperlink...
in the next page... you'll get an empty value for textbox text
0
 

Author Comment

by:Junior_Developer
ID: 17091972
instead of the textbox i have stored the id in a string and did exactly like pramita_mcs said
here is what worked for me.

HyperLink1.NavigateUrl = "Details.aspx?EmpName=" & ddlEmpNames.SelectedItem.Value & "&EmpID=" & strEmpID

Thanks for all your help
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

911 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

19 Experts available now in Live!

Get 1:1 Help Now