Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Pass values in Hyperlink to other page

Posted on 2006-07-12
10
Medium Priority
?
849 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 18

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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 18

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
 
LVL 18

Expert Comment

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

Accepted Solution

by:
Pratima Pharande earned 2000 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 18

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
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…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

916 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