1

I can not get value parameter description from ajax post, this value is undefined, but c_id and status i can. The problem here is take the text data from ajax post. How to get this description parameter ? Tks all.

 function Reset_Status(obj) {
        $.ajax(
              {
                  type: "POST",
                  async: false,
                  url: "Tasks.aspx?t_id=" + $(obj).prev().val() + "&status=" + $(obj).val() + "&description=update" ,
                  error: function (XMLHttpRequest, textStatus, errorThrown) {
                      alert('Error: ' + XMLHttpRequest.responseText)
                  }, success: function () {
                      //alert('Succsess')
                  }
              })
    }

Code behind:

protected void Page_Load(object sender, EventArgs e)
{
    Update();
}
private void  Update()
{
    string s = "";
    int c_id=0,status=-1;
    c_id=Utils.GetDefautInteger(Request.QueryString["C_id"].ToString(), 0);
    status = Utils.GetDefautInteger(Request.QueryString["status"].ToString(), 0);
    s = (Request.QueryString["description"].ToString(); return;}

string s is undefined

1 Answer 1

1

There seems to be a typo here s = (Request.QueryString["description"].ToString(); return;}

Try

s = Request.QueryString["description"].ToString();

And then just remove the return and leave the } alone on the last row. Like so:

private void Update()
{
    string s = "";
    int c_id=0, status=-1; c_id=Utils.GetDefautInteger(Request.QueryString["C_id"].ToString(), 0);
    status = Utils.GetDefautInteger(Request.QueryString["status"].ToString(), 0);
    s = Request.QueryString["description"].ToString();
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.