Sheritlw
asked on
Client Side Set QueryString from Hidden Field
Hi EE,
I have an href control in my aspx code. I want to redirect with a querystring to another page.
The querystring needs to be developed from an hidden field on the form.
How do I do this?
Thanks
I have an href control in my aspx code. I want to redirect with a querystring to another page.
The querystring needs to be developed from an hidden field on the form.
How do I do this?
Thanks
<a href='<%# "Portfolio.aspx?StylistID="+StylistID.Value %>' />
ASKER
I would rather use client side.
I've already tried response.redirect on the server also, but it didn't work.
Thanks
Response.Redirect("Portfolio.aspx?StylistID=" & Me.StylistID.Value & "")
My solution is client side (javascript) and it is opening a new window.
If you need to open the link in the same window, the javascript method should be:
function showNewLink()
{
window.location = "Portfolio.aspx?StylistID= "+StylistI D.Value;
}
Note: In your server code, have you checked that the StylistID.Value is assigned in the client code only?
For more info in hidden value usage, check:
http://www.daniweb.com/forums/thread26184.html
If you need to open the link in the same window, the javascript method should be:
function showNewLink()
{
window.location = "Portfolio.aspx?StylistID=
}
Note: In your server code, have you checked that the StylistID.Value is assigned in the client code only?
For more info in hidden value usage, check:
http://www.daniweb.com/forums/thread26184.html
ASKER
I've checked that there is a value in hidden field.
I'm not sure what you mean by window.location??
I just want to open another page. In the page load of the page I want to open, I request the query string.
When I walk through the code, Response.Redirect("Portfol io.aspx?St ylistID=" & Me.StylistID.Value & "")
I get the error Operator '==' incompatible with operand types 'Int32' and 'Object' before the page load fires on the page I want to open.
Thanks
I'm not sure what you mean by window.location??
I just want to open another page. In the page load of the page I want to open, I request the query string.
When I walk through the code, Response.Redirect("Portfol
I get the error Operator '==' incompatible with operand types 'Int32' and 'Object' before the page load fires on the page I want to open.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<a onclick=showNewLink(); />
function showNewLink()
{
window.open('Portfolio.asp
}
For more info on window open, check:
http://msdn.microsoft.com/en-us/library/ms536651(v=vs.85).aspx