I have done it before, but it's not working this time.

All I'm trying to do is delete an entry from a table, and as you can see, it is supposed to output "ok" if it succeeds, (and I *have* manually checked the querystring data and everything matches what its trying to delete, even all the conditions are also met), but it isn't deleting.

```
@{
    var message = "";
    try
    {
        var d = Database.Open("tgyytuyt");
        var query = "DELETE FROM Cart WHERE OrderId = '" + Request.QueryString["Value"] + "' AND UserId = '" + Request.QueryString["SubValue"] + "' AND PartNumber = '" + Request.QueryString["Final"] + "'";
        d.Execute(query);

        message = "ok";
        //Response.Redirect("~/OSM/Default.cshtml");
    }
    catch(Exception ex)
    {
        message = ex.Message;
    }
}
<p>@message</p>

```

Is there something that I'm doing wrong that could be causing the item to not be deleted?
['https://Stackoverflow.com/questions/7204024', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/908110/']
It looks fine. It will fail when you've *actually* a `rendered` attribute set on the link or one of its parents and the bean is in request scope. This should work if the bean is put in the view scope and you always return `null` or `void` from link actions which should return to the same view. This way the conditions for the `rendered` attribute will be preserved. JSF namely rechecks this condition during apply request values phase of the form submit as part of safeguard against hacked/tampered requests.

### See also:

* [commandButton/commandLink/ajax action/listener method not invoked or input value not updated](https://stackoverflow.com/questions/2118656/hcommandlink-is-not-being-invoked) (lists all possible causes)
i think first command link should be inside h:form