Solved

goto aspx page based on id value

Posted on 2010-08-24
6
455 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

735 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