Solved

goto aspx page based on id value

Posted on 2010-08-24
6
422 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

706 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now