Junior_Developer
asked on
Pass values in Hyperlink to other page
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
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?
in page_load:
HyperLink1.NavigateUrl = "Details.aspx?ddl=" & dropdownlist.SelecyedItem. value & "&textbox=" & textbox.text
HyperLink1.NavigateUrl = "Details.aspx?ddl=" & dropdownlist.SelecyedItem.
ASKER
this makes a little more sense let me try this
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
ASKER
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.
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.
did you try my solution posted?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks a lot
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
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
ASKER
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.V alue & "&EmpID=" & strEmpID
Thanks for all your help
here is what worked for me.
HyperLink1.NavigateUrl = "Details.aspx?EmpName=" & ddlEmpNames.SelectedItem.V
Thanks for all your help
HyperLink1.NavigateUrl = "Details.aspx?ddl="" + " & dropdownlist.clientid & ".value + ""&textbox="" + " & textbox.clientid & ".value"