issue in sending query string.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nirmalsingh
    New Member
    • Sep 2006
    • 218

    issue in sending query string.

    hai all,

    i am using, ajax and c#.net.

    my problem is,

    i want to store a huge data in database using(c#), which is done in behind the screen. when i get data from a html textarea(more than 2000 characters), and pass to c# page through query string from javascript(ajax ). i cant pass the value. what is the solution to do this.

    thanx in advance.

    with lov
    Nirmal
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    #2
    Originally posted by nirmalsingh
    hai all,

    i am using, ajax and c#.net.

    my problem is,

    i want to store a huge data in database using(c#), which is done in behind the screen. when i get data from a html textarea(more than 2000 characters), and pass to c# page through query string from javascript(ajax ). i cant pass the value. what is the solution to do this.

    thanx in advance.

    with lov
    Nirmal
    Simply use "POST" method.

    Debasis Jana

    Comment

    • nirmalsingh
      New Member
      • Sep 2006
      • 218

      #3
      Originally posted by dmjpro
      Simply use "POST" method.

      Debasis Jana
      i am getting permission denied error.

      Comment

      • dmjpro
        Top Contributor
        • Jan 2007
        • 2476

        #4
        Originally posted by nirmalsingh
        i am getting permission denied error.
        Post your Code here.

        Debasis Jana

        Comment

        • nirmalsingh
          New Member
          • Sep 2006
          • 218

          #5
          Originally posted by dmjpro
          Post your Code here.

          Debasis Jana
          I pass more than 2000 character field parameter in terms and tried to save.
          Code:
          var termsxmlHttp=null;
          //Calling Ajax Page Function
          function CallAjax(param,terms,mode,term_id)
          {
          
          termsxmlHttp=termsGetXmlHttpObject();
          if (termsxmlHttp==null)
            {
            alert ("Your browser does not support AJAX!");
            return;
            } 
            
          var url="../Ajax_Pages/aj_terms_conditions.aspx";
          url=url+"?Ref="+param;
          url=url+"&Terms="+terms;
          url=url+"&mode="+mode;
          url=url+"&terms_id="+ term_id;
          url=url+"&sid="+Math.random();
          termsxmlHttp.onreadystatechange=termsstateChanged;
          termsxmlHttp.open("POST",url,true);
          termsxmlHttp.send(null);
          //changed
          }
          
          ////
          
          function termsGetXmlHttpObject()
          {
           var termsGetxmlHttp=null;
            try
              {
              // Firefox, Opera 8.0+, Safari
              termsGetxmlHttp=new XMLHttpRequest();
              }
            catch (e)
              {
              // Internet Explorer
              try
                {
                termsGetxmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
                }
              catch (e)
                {
                termsGetxmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
                }
              }
            return termsGetxmlHttp;
          }
          
          ///
          
          function termsstateChanged() 
          { 
              if (termsxmlHttp.readyState==4)
              { 
                  
                  hideProgressImage("DisplayMsg", "displayError", "btnClose");
                  var strArr = new Array();
                  strArr =  termsxmlHttp.responseText.split("^");
                  document.getElementById("DisplayMsg").innerHTML =strArr[0];
                  if (strArr[1]==1)
                  {
                      document.getElementById("displayError").style.color="Green";
                  }
                  else if (strArr[1]==2)
                  {
                      document.getElementById("displayError").style.color="Red";
                  }
                  document.getElementById("displayError").style.visibility = 'visible';
                  document.getElementById("btnClose").style.visibility = 'visible';
                  document.getElementById("btnClose").focus();
                  document.getElementById("txtRef").value="";
                  document.getElementById("txtTerms").value="";
                  document.getElementById("terms_id").value="0";
                  document.getElementById("hmode").value = "Save";
                  CallAjaxList(1,'','','../Ajax_Pages/aj_terms_conditions.aspx');//nirmal from 21
              }
          }

          Comment

          • dmjpro
            Top Contributor
            • Jan 2007
            • 2476

            #6
            I think you are using IE.
            Then enable your Activex Control.

            Debasis Jana

            Comment

            • nirmalsingh
              New Member
              • Sep 2006
              • 218

              #7
              Originally posted by dmjpro
              I think you are using IE.
              Then enable your Activex Control.

              Debasis Jana
              yes of course, i'm using ie, how to enable the activex control?

              with lov
              Nirmal

              Comment

              • dmjpro
                Top Contributor
                • Jan 2007
                • 2476

                #8
                Originally posted by nirmalsingh
                yes of course, i'm using ie, how to enable the activex control?

                with lov
                Nirmal

                Tools->Internet Options->Security Tab->Custob Level->[automatic prompting for activex control=>disabl e,download activex control=>enable ,intialize and script activex ..... =>enable,run activex control=>enable and script activex controls ... =>enable]

                Debasis Jana

                Comment

                • nirmalsingh
                  New Member
                  • Sep 2006
                  • 218

                  #9
                  Originally posted by dmjpro
                  Tools->Internet Options->Security Tab->Custob Level->[automatic prompting for activex control=>disabl e,download activex control=>enable ,intialize and script activex ..... =>enable,run activex control=>enable and script activex controls ... =>enable]

                  Debasis Jana
                  I have done as u said, but still i am getting unspecified error.

                  Comment

                  • dmjpro
                    Top Contributor
                    • Jan 2007
                    • 2476

                    #10
                    Originally posted by nirmalsingh
                    I have done as u said, but still i am getting unspecified error.
                    Do one thing ..... Simply try this code.

                    [code=javascript]
                    try
                    {
                    termsGetxmlHttp =new ActiveXObject(" Msxml2.XMLHTTP" );
                    }
                    catch (e)
                    {
                    termsGetxmlHttp =new ActiveXObject(" Microsoft.XMLHT TP");
                    }
                    [/code]

                    Actually the error comes from here or somewhere else.
                    Let me know that please.

                    Debasis Jana

                    Comment

                    • nirmalsingh
                      New Member
                      • Sep 2006
                      • 218

                      #11
                      Originally posted by dmjpro
                      Do one thing ..... Simply try this code.

                      [code=javascript]
                      try
                      {
                      termsGetxmlHttp =new ActiveXObject(" Msxml2.XMLHTTP" );
                      }
                      catch (e)
                      {
                      termsGetxmlHttp =new ActiveXObject(" Microsoft.XMLHT TP");
                      }
                      [/code]

                      Actually the error comes from here or somewhere else.
                      Let me know that please.

                      Debasis Jana
                      thanx jana but,
                      same thing is done in my posted code line no:38 to 46.
                      and also refer this link

                      Comment

                      • dmjpro
                        Top Contributor
                        • Jan 2007
                        • 2476

                        #12
                        Originally posted by nirmalsingh
                        thanx jana but,
                        same thing is done in my posted code line no:38 to 46.
                        and also refer this link

                        http://www.webmasterworld.com/forum21/6607.htm
                        So you have that error from somewhere else.
                        Right?
                        So you have the error with "Query String"?
                        Did you do with "POST" method.

                        Have a look at this code fragment.

                        [code=javascript]
                        xhreq.open("pos t", "sumPostForm.ph tml", true);
                        xhReq.setReques tHeader('Conten t-Type', 'application/x-www-form-urlencoded');
                        var query = "param1=paramva lue1&param2=par amvalue2....... ............... ........";
                        xhReq.send(quer y);
                        [/code]

                        Good Luck with this code !

                        Debasis Jana.

                        Comment

                        • nirmalsingh
                          New Member
                          • Sep 2006
                          • 218

                          #13
                          Originally posted by dmjpro
                          So you have that error from somewhere else.
                          Right?
                          So you have the error with "Query String"?
                          Did you do with "POST" method.

                          Have a look at this code fragment.

                          [code=javascript]
                          xhreq.open("pos t", "sumPostForm.ph tml", true);
                          xhReq.setReques tHeader('Conten t-Type', 'application/x-www-form-urlencoded');
                          var query = "param1=paramva lue1&param2=par amvalue2....... ............... ........";
                          xhReq.send(quer y);
                          [/code]

                          Good Luck with this code !

                          Debasis Jana.
                          this is very new for me. can u integrate this code with previously posted code by me, i don't know how to use this.

                          Comment

                          • dmjpro
                            Top Contributor
                            • Jan 2007
                            • 2476

                            #14
                            Originally posted by nirmalsingh
                            this is very new for me. can u integrate this code with previously posted code by me, i don't know how to use this.
                            First let me know with that code fragment "ActiveXObj ect" is working without error.
                            First let me know that, then I will integrate that one.

                            Debasis Jana

                            Comment

                            • nirmalsingh
                              New Member
                              • Sep 2006
                              • 218

                              #15
                              Originally posted by dmjpro
                              First let me know with that code fragment "ActiveXObj ect" is working without error.
                              First let me know that, then I will integrate that one.

                              Debasis Jana
                              dear jana
                              code fragment "ActiveXObj ect" is working without error.

                              Comment

                              Working...