when i click orders in DataGrid page is not transfering to order.aspx.
private void DataGrid1_ItemCommand(object source, DataGridCommandEventArgs e)
{
if (e.CommandName == "ORD")
{
string strISBN;
string strTitle;
string strAuthor;
strISBN = e.Item.Cells[1].Text;
strTitle = e.Item.Cells[2].Text;
strAuthor = e.Item.Cells[3].Text;
Response.Redirect("order.aspx?ISBN=" + strISBN + "@ Title=" + strTitle + "@ Author=" + strAuthor);
}
}
can someone help with this.
Thanks in advance.
Loading

Bechir BejaouiRank #144 · 15.9K reputationPosted Jan 27, 2009, 12:27 PM EST
parimal patel20 reputationPosted Jan 28, 2009, 6:19 AM EST
Bechir BejaouiRank #144 · 15.9K reputationPosted Jan 28, 2009, 9:03 AM EST
Are you sure that that page verb is set to get and not to post? This is another trick, try it if else // Initialize the WebRequest. WebRequest myRequest = WebRequest.Create(""order.aspx?ISBN=" + strISBN + "@ Title=" + strTitle + "@ Author=" + strAuthor"); // Return the response. WebResponse myResponse = myRequest.GetResponse(); // Code to use the WebResponse goes here. // Close the response to free resources. myResponse.Close();satya kishore5 reputationPosted Feb 6, 2009, 1:32 AM EST
use '&' instead of '@'
try it
private void DataGrid1_ItemCommand(object source, DataGridCommandEventArgs e)
{
if (e.CommandName == "ORD")
{
string strISBN;
string strTitle;
string strAuthor;
strISBN = e.Item.Cells[1].Text;
strTitle = e.Item.Cells[2].Text;
strAuthor = e.Item.Cells[3].Text;
Response.Redirect("order.aspx?ISBN=" + strISBN + "& Title=" + strTitle + "& Author=" + strAuthor);
}
}