I have code which checks whether a datagrid is empty and if it is it shows a
panel on my page. If its not empty then Im using the server.transfer to go to
another page so as im able to use the items in an array list. My problem is
that I also have had to incorporate some Javascript to see whether the user
is ok with moving forward. Everything is fine and works apart from when the
user clicks cancel on the pop-up Internet Explorer window it stills lets them
move on. I need to be able to introduce something which keeps the user on the
same page if they click cancel.
Has anyone any idea how I can achieve this or if this is possible in my
circumstances.
private void checkdgSearchRe sults()
{
if(this.DataGri d1.Items.Count == 0)
{
this.pnlSearchA ddresses.Visibl e = true;
}
else
{
ArrayList addresses;
addresses = (ArrayList) ViewState["Addresses"];
Context.Items["TransferAddres ses"] = addresses;
string surname = this.Textbox7.T ext;
Context.Items["test"] = surname;
Response.Write( "<script language='JavaS cript'>(window. confirm('The
search fee will now be deducted for the criteria entered. Do you wish to
continue?'));</script>");
Server.Transfer ("ArrayListItem sDisplayed.aspx ");
}
}
panel on my page. If its not empty then Im using the server.transfer to go to
another page so as im able to use the items in an array list. My problem is
that I also have had to incorporate some Javascript to see whether the user
is ok with moving forward. Everything is fine and works apart from when the
user clicks cancel on the pop-up Internet Explorer window it stills lets them
move on. I need to be able to introduce something which keeps the user on the
same page if they click cancel.
Has anyone any idea how I can achieve this or if this is possible in my
circumstances.
private void checkdgSearchRe sults()
{
if(this.DataGri d1.Items.Count == 0)
{
this.pnlSearchA ddresses.Visibl e = true;
}
else
{
ArrayList addresses;
addresses = (ArrayList) ViewState["Addresses"];
Context.Items["TransferAddres ses"] = addresses;
string surname = this.Textbox7.T ext;
Context.Items["test"] = surname;
Response.Write( "<script language='JavaS cript'>(window. confirm('The
search fee will now be deducted for the criteria entered. Do you wish to
continue?'));</script>");
Server.Transfer ("ArrayListItem sDisplayed.aspx ");
}
}
Comment