I've been trying to resolve this problem for a couple of days and have given up so here goes........
I have a page in vb.net that displays a record, there is a button which is used to delete the record. When the user clicks the button a confirmation message pops up with OK/Cancel to carry out the deletion, if they select OK another confirmation message pops up with OK/Cancel to archive the record. If they select Ok the record is deleted and a file is created on their local drive.
The confirmations are written in Javascript and a parameter is added to a url depending on whether they want to delete and/or archive.
I want to use the parameter in my code-behind to determine whether to delete and/or archive but I cannot see the query string parameter in the code-behind when I do a Request.Querystring, only the id for the record is shown.
When I do an alert fromn javascript for the xmlHttp.responseText te uerystring parameter is their
Any help would be greatly appreciated
below is the javascript code:-
<script type="text/javascript">
function confirmation() {
var answer = confirm("Do you want to delete this record?")
if (answer==true)
{
var ans = confirm("Do yo want to archive this record?")
if(ans)
{
delete_record("Archive");
}
else
{
delete_record("No Archive");
}
}
}
// create HttpRequest Object
function GetXmlHttpObject()
{
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
}
function delete_record(archive){
var addr = "DeletePractice.aspx?archive=" + archive
//create the http request object
xmlHttp=GetXmlHttpObject()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("POST",addr, true);
xmlHttp.setRequestHeader("Content-type", "application/x- xmlHttp.setRequestHeader("Content-length", addr.length);
xmlHttp.setRequestHeader("Connection", "close")
xmlHttp.send(addr)
}
function stateChanged(){
if (xmlHttp.readyState==4 || xmlHttp.readyState==200){
alert(xmlHttp.responseText);
window.reload();
}
}
</script>
Many thanks
I have a page in vb.net that displays a record, there is a button which is used to delete the record. When the user clicks the button a confirmation message pops up with OK/Cancel to carry out the deletion, if they select OK another confirmation message pops up with OK/Cancel to archive the record. If they select Ok the record is deleted and a file is created on their local drive.
The confirmations are written in Javascript and a parameter is added to a url depending on whether they want to delete and/or archive.
I want to use the parameter in my code-behind to determine whether to delete and/or archive but I cannot see the query string parameter in the code-behind when I do a Request.Querystring, only the id for the record is shown.
When I do an alert fromn javascript for the xmlHttp.responseText te uerystring parameter is their
Any help would be greatly appreciated
below is the javascript code:-
<script type="text/javascript">
function confirmation() {
var answer = confirm("Do you want to delete this record?")
if (answer==true)
{
var ans = confirm("Do yo want to archive this record?")
if(ans)
{
delete_record("Archive");
}
else
{
delete_record("No Archive");
}
}
}
// create HttpRequest Object
function GetXmlHttpObject()
{
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
}
function delete_record(archive){
var addr = "DeletePractice.aspx?archive=" + archive
//create the http request object
xmlHttp=GetXmlHttpObject()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("POST",addr, true);
xmlHttp.setRequestHeader("Content-type", "application/x- xmlHttp.setRequestHeader("Content-length", addr.length);
xmlHttp.setRequestHeader("Connection", "close")
xmlHttp.send(addr)
}
function stateChanged(){
if (xmlHttp.readyState==4 || xmlHttp.readyState==200){
alert(xmlHttp.responseText);
window.reload();
}
}
</script>
Many thanks