Solved

goto aspx page based on id value

Posted on 2010-08-24
6
448 Views
Last Modified: 2012-05-10
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

0
Comment
Question by:danielivanov2
  • 3
  • 2
6 Comments
 
LVL 4

Assisted Solution

by:udaydidigam
udaydidigam earned 125 total points
ID: 33510429
in onload
Response.Redirect("your_url.aspx?your_url_variable=" + @variable_from_form);
http://www.xcess.info/request_url_parameters_details_asp_net_aen.aspx 
0
 
LVL 35

Expert Comment

by:YZlat
ID: 33510537
in order to retrieve the ID on DateClient.aspx page, use  Page.Request.QueryString["ID"] or Page.Request.QueryString[0]
0
 
LVL 35

Accepted Solution

by:
YZlat earned 125 total points
ID: 33510563
if you are using C#, try

int ID = Convert.ToInt32(Page.Request.QueryString["ID"]);

or

int ID = Convert.ToInt32(Page.Request.QueryString[0]);

or if you are using VB.NET, try

Dim ID as Integer = CInt(Page.Request.QueryString("ID");

or
Dim ID as Integer = CInt(Page.Request.QueryString(0);

Then you can just use ID variable in your code
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

 

Author Comment

by:danielivanov2
ID: 33510909
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 (#,-)?
0
 
LVL 35

Expert Comment

by:YZlat
ID: 33511475
Do you really need ResponseRedirect? Specifying NavigateUrl in your Hyperlink should be enough, shouldn't it?
0
 

Author Comment

by:danielivanov2
ID: 33511563
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.
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

Suggested Solutions

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 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