Link to home
Start Free TrialLog in
Avatar of danielivanov2
danielivanov2Flag for Romania

asked on

goto aspx page based on id value

I have an asp.net 2.0 FormView that displays customer data as summary.
I need to navigate to the customer details page, based on click event on customer_id field.
The problem is that I dont know how to configure the destination page to display proper data based on customer_id parameter (somethiing like: customer_id=1234, redirect to DateClient.aspx?id=1234)
Some code attached. Thanks

<asp:HyperLink runat="server" NavigateUrl='<%# Eval("Customer_Id", "~/DateClient.aspx?ID={0}")  %>'>
<%# Eval("Customer_Id")%>
</asp:HyperLink>

Open in new window

<asp:HyperLink runat="server" NavigateUrl='<%# Eval("Customer_Id", "~/DateClient.aspx?ID={0}")  %>'>
<%# Eval("Customer_Id")%>
</asp:HyperLink>

Open in new window

SOLUTION
Avatar of udaydidigam
udaydidigam

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of YZlat
in order to retrieve the ID on DateClient.aspx page, use  Page.Request.QueryString["ID"] or Page.Request.QueryString[0]
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of danielivanov2

ASKER

I have tried to use Response.Redirect,  using a session variable as response variable,
Response.Redirect("DateClient.aspx?Id=" + Session["SelectedCustomersList"].ToString());

but browser response is:
"The page isn't redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete."
URL="http://localhost:3474/Pricing%20Tool%20version6/App_Pages/DateClient.aspx?Id=1,10018000"

is comma "guilt" of that? should I replace comma with some other character (#,-)?
Do you really need ResponseRedirect? Specifying NavigateUrl in your Hyperlink should be enough, shouldn't it?
Yes, I dont need specifically the ResponseRedirect, but in this case, when the user clicks the link, i want to set the session variable with the formview value and thereafter to call a method (found in a third page) that populate a gridview (that is located within the masterpage)

to be more clear:

the dateclient.aspx would be accessed either:
1. search page->add selected customers (1 or many) to selectiongridview and thereafter displaying the dateclient.aspx page by oressing a button, or
2. search pricing case->display customer details in a formview - when presssing customerid link, selectiongridview  will be filled with details and user is redirected to dateclient.aspx page.