| | |
pass id wont work
Please support our ASP.NET advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Jun 2009
Posts: 14
Reputation:
Solved Threads: 0
Please help me, i tried to pass information from detailed view and to another detailed view in another page. I put this code in the first page
and to the second page
but this second page won't show the id i select at the first detailed view, it only shows the first record in the database. If i pass it to gridview, it will show every record in the database.. please help me,thanks very much
asp.net Syntax (Toggle Plain Text)
protected void ViewRemuneration_Click(object sender, EventArgs e) { //Button ViewRemuneration = (Button)sender; //string sendID = ViewRemuneration.ID; Response.Redirect("Remuneration.aspx?employeeId=" + DetailsView1.SelectedValue); }
and to the second page
asp.net Syntax (Toggle Plain Text)
protected void Page_Load(object sender, EventArgs e) { if (null == Session["UserId"]) { Response.Redirect("login.aspx"); } string employeeId = Request["employeeId"].ToString(); }
but this second page won't show the id i select at the first detailed view, it only shows the first record in the database. If i pass it to gridview, it will show every record in the database.. please help me,thanks very much
•
•
Join Date: Jun 2009
Posts: 14
Reputation:
Solved Threads: 0
oh and one more, in the website it displays like this :
http://localhost:1193/ViewReports.aspx?employeeId=4
so it has read which Id i select, but won't show the particular detail i need. thanks again
http://localhost:1193/ViewReports.aspx?employeeId=4
so it has read which Id i select, but won't show the particular detail i need. thanks again
You're passing the employee ID in the query string but checking a session variable? That doesn't make any sense.
First page is OK:
Change the second page to:
First page is OK:
c# Syntax (Toggle Plain Text)
protected void ViewRemuneration_Click(object sender, EventArgs e) { //Button ViewRemuneration = (Button)sender; //string sendID = ViewRemuneration.ID; Response.Redirect("Remuneration.aspx?employeeId=" + DetailsView1.SelectedValue); }
Change the second page to:
c# Syntax (Toggle Plain Text)
protected void Page_Load(object sender, EventArgs e) { string employeeId = Convert.ToString(Request["employeeId"]); if (string.IsNullOrEmpty(employeeId)) { Response.Redirect("login.aspx"); } else { //Set your session variable here } }
•
•
Join Date: Jun 2009
Posts: 14
Reputation:
Solved Threads: 0
hi thanks for the reply, i have tried but now it displays nothing.
the code in the second page looks like this
the code in the second page looks like this
asp.net Syntax (Toggle Plain Text)
protected void Page_Load(object sender, EventArgs e) { if (null == Session["UserId"]) { Response.Redirect("login.aspx"); } string employeeId = Convert.ToString(Request["employeeId"]); string reportsSql = string.Format( "SELECT Performance.PerformanceID, Employee.LastName, Employee.FirstName, Performance.DateofRemark, Performance.MyPerformance, Performance.EmployeePerformance, Performance.RemarkedBy " + "FROM Employee INNER JOIN Performance ON Employee.ID = Performance.ID " + "WHERE Employee.ID = " + employeeId); AccessDataSource accessDataSource1 = new AccessDataSource(); accessDataSource1.DataFile = "~/App_Data/Copy of elog.mdb"; GridView1.DataSource = accessDataSource1; accessDataSource1.SelectCommand = reportsSql; GridView1.DataBind();
![]() |
Similar Threads
- Plshelp! sims2 autorun wont work! (Windows Vista and Windows 7)
- Why wont this work!!! (C++)
- Mouse and keyboard wont work (Windows NT / 2000 / XP)
- New Pc parts wont work correctly (Motherboards, CPUs and RAM)
- Help! My mouse wont work! (USB Devices and other Peripherals)
- mouse wont work! (Windows NT / 2000 / XP)
- IPSec Pass-thru (Networking Hardware Configuration)
Other Threads in the ASP.NET Forum
- Previous Thread: Message doesn't work:-
- Next Thread: dynamic comments box
| Thread Tools | Search this Thread |
.net 2.0 3.5 ajax alltypeofvideos appliances asp asp.net beginner box browser businesslogiclayer button c# cac checkbox class commonfunctions compatible content contenttype control countryselector courier dataaccesslayer database datagrid datagridview datalist deployment development dgv dialog dropdownlist dropdownmenu dynamic dynamically edit embeddingactivexcontrol fileuploader fill findcontrol flash flv gridview gudi iis javascript list listbox login menu microsoft mouse mssql nameisnotdeclared news novell numerical opera order panelmasterpagebuttoncontrols problem radio ratings redirect registration relationaldatabases reportemail schoolproject search security serializesmo.table sessionvariables silverlight smoobjects software sql sql-server sqlserver2005 ssl tracking treeview validatedate validation vb.net videos vista visual-studio visualstudio vs2008 web webapplications webarchitecture webdevelopment webprogramming webservice wizard xsl youareanotmemberofthedebuggerusers






