Click here to Skip to main content
15,886,067 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi,


I need to pass 3 command arguments in rowcommand event and by passing that 3 arguments i need to redirect another page

can anybody help?
Posted

you can see This
 
Share this answer
 
C#
protected void gridview_RowCommand(object sender, GridViewCommandEventArgs e)
{
      string[] arg = new string[2];
      arg = e.CommandArgument.ToString().Split(';');
      Session["IdTemplate"] = arg[0];
      Session["IdEntity"] = arg[1];
      Response.Redirect("Samplepage.aspx");
}


pls check this
 
Share this answer
 
pls check this
Ok
 
Share this answer
 
[This is abuse! Why did you put it as an answer? Worse, why did you accepted it formally? Please, un-accept it, to avoid reporting for cheating. — SA]

it was fine but i need to pass those arguments in page redirect

C#
if (e.CommandName == "Edit")
           {

             string[] commandArgs =e.CommandArgument.ToString().Split(new char[] { ',' });

             string  deptid = commandArgs[0];
             string classname = commandArgs[1];
             string sem = commandArgs[2];

               //int Studid = Convert.ToInt32(e.CommandArgument.ToString());
             Response.Redirect("AddSubjects.aspx?Deptid=" + deptid + "?classid=" + classname + "?Sem=" + sem + "");
           }



This is my code but its nt work
 
Share this answer
 
v3

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