Click here to Skip to main content
15,892,643 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
sir,
i want to redirect to EmployeeRegistration.aspx based on the empid=" + empid +.
i use this code
C#
Response.Redirect("../Hr/ Response.Redirect("../Hr/EmployeeRegistration.aspx?empid=" + empid + "", false);
,but its generates error page.
if anyone knows the answer please help me...
Posted
Updated 29-Nov-13 20:17pm
v6
Comments
Homero Rivera 29-Nov-13 23:56pm    
Can you post your code in a code block please?
Tom Marvolo Riddle 30-Nov-13 0:49am    
post your code.without code,it is difficult to get solutions
Karthik_Mahalingam 30-Nov-13 2:15am    
please post your code inside this..

<pre lang="c#">
// paste your code in this area.
</pre>
Thomas ktg 30-Nov-13 2:23am    
It would be more easy to get solutions if you could provide the error also. So that everyone can easily guess the solution you need and will be solved soon.
Karthik_Mahalingam 30-Nov-13 2:58am    
first of all its a compile error.. then how to proceed ???

1 solution

I didn't get the question clearly without your code.I guess you are trying to do this:
Try this:
C#
 SqlDataReader dr;
 cmd = new SqlCommand("select * from tbl_ins where empid='"+empid+"'", con);
 dr = cmd.ExecuteReader();
 dr.Read();
 if (dr.HasRows)
 {
     int empid = Convert.ToInt32( dr[0].ToString());
     dr.close();
     if(empid==1)//just for an example
     {
     Response.Redirect("../Hr/EmployeeRegistration.aspx", false);
     }
     if(empid==2)// and so on
     {
      //other page
     }
 }
else
 {

 dr.Close();
 }
 
Share this answer
 
v4
Comments
vineethnair 1-Dec-13 23:39pm    
sir,
thanks for your reply...i got the solution
vineethnair 1-Dec-13 23:39pm    
sir,
error is in my code....
Tom Marvolo Riddle 2-Dec-13 0:01am    
post your code.i'll try to fix it
vineethnair 2-Dec-13 22:50pm    
sir,
I solved the error..
vineethnair 2-Dec-13 22:50pm    
thanks for your reply.....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900