469,612 Members | 1,673 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,612 developers. It's quick & easy.

issue in sending query string.

nirmalsingh
218 100+
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
Oct 11 '07 #1
25 2341
dmjpro
2,476 2GB
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
Oct 11 '07 #2
nirmalsingh
218 100+
Simply use "POST" method.

Debasis Jana
i am getting permission denied error.
Oct 11 '07 #3
dmjpro
2,476 2GB
i am getting permission denied error.
Post your Code here.

Debasis Jana
Oct 11 '07 #4
nirmalsingh
218 100+
Post your Code here.

Debasis Jana
I pass more than 2000 character field parameter in terms and tried to save.
Expand|Select|Wrap|Line Numbers
  1. var termsxmlHttp=null;
  2. //Calling Ajax Page Function
  3. function CallAjax(param,terms,mode,term_id)
  4. {
  5.  
  6. termsxmlHttp=termsGetXmlHttpObject();
  7. if (termsxmlHttp==null)
  8.   {
  9.   alert ("Your browser does not support AJAX!");
  10.   return;
  11.   } 
  12.  
  13. var url="../Ajax_Pages/aj_terms_conditions.aspx";
  14. url=url+"?Ref="+param;
  15. url=url+"&Terms="+terms;
  16. url=url+"&mode="+mode;
  17. url=url+"&terms_id="+ term_id;
  18. url=url+"&sid="+Math.random();
  19. termsxmlHttp.onreadystatechange=termsstateChanged;
  20. termsxmlHttp.open("POST",url,true);
  21. termsxmlHttp.send(null);
  22. //changed
  23. }
  24.  
  25. ////
  26.  
  27. function termsGetXmlHttpObject()
  28. {
  29.  var termsGetxmlHttp=null;
  30.   try
  31.     {
  32.     // Firefox, Opera 8.0+, Safari
  33.     termsGetxmlHttp=new XMLHttpRequest();
  34.     }
  35.   catch (e)
  36.     {
  37.     // Internet Explorer
  38.     try
  39.       {
  40.       termsGetxmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  41.       }
  42.     catch (e)
  43.       {
  44.       termsGetxmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  45.       }
  46.     }
  47.   return termsGetxmlHttp;
  48. }
  49.  
  50. ///
  51.  
  52. function termsstateChanged() 
  53.     if (termsxmlHttp.readyState==4)
  54.     { 
  55.  
  56.         hideProgressImage("DisplayMsg", "displayError", "btnClose");
  57.         var strArr = new Array();
  58.         strArr =  termsxmlHttp.responseText.split("^");
  59.         document.getElementById("DisplayMsg").innerHTML =strArr[0];
  60.         if (strArr[1]==1)
  61.         {
  62.             document.getElementById("displayError").style.color="Green";
  63.         }
  64.         else if (strArr[1]==2)
  65.         {
  66.             document.getElementById("displayError").style.color="Red";
  67.         }
  68.         document.getElementById("displayError").style.visibility = 'visible';
  69.         document.getElementById("btnClose").style.visibility = 'visible';
  70.         document.getElementById("btnClose").focus();
  71.         document.getElementById("txtRef").value="";
  72.         document.getElementById("txtTerms").value="";
  73.         document.getElementById("terms_id").value="0";
  74.         document.getElementById("hmode").value = "Save";
  75.         CallAjaxList(1,'','','../Ajax_Pages/aj_terms_conditions.aspx');//nirmal from 21
  76.     }
  77. }
  78.  
Oct 11 '07 #5
dmjpro
2,476 2GB
I think you are using IE.
Then enable your Activex Control.

Debasis Jana
Oct 11 '07 #6
nirmalsingh
218 100+
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
Oct 11 '07 #7
dmjpro
2,476 2GB
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=>disable,download activex control=>enable,intialize and script activex ..... =>enable,run activex control=>enable and script activex controls ... =>enable]

Debasis Jana
Oct 11 '07 #8
nirmalsingh
218 100+
Tools->Internet Options->Security Tab->Custob Level->[automatic prompting for activex control=>disable,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.
Oct 12 '07 #9
dmjpro
2,476 2GB
I have done as u said, but still i am getting unspecified error.
Do one thing ..... Simply try this code.

Expand|Select|Wrap|Line Numbers
  1. try
  2.       {
  3.       termsGetxmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  4.       }
  5.     catch (e)
  6.       {
  7.       termsGetxmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  8.       }
  9.  
Actually the error comes from here or somewhere else.
Let me know that please.

Debasis Jana
Oct 12 '07 #10
nirmalsingh
218 100+
Do one thing ..... Simply try this code.

Expand|Select|Wrap|Line Numbers
  1. try
  2.       {
  3.       termsGetxmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  4.       }
  5.     catch (e)
  6.       {
  7.       termsGetxmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  8.       }
  9.  
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

http://www.webmasterworld.com/forum21/6607.htm
Oct 12 '07 #11
dmjpro
2,476 2GB
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.

Expand|Select|Wrap|Line Numbers
  1. xhreq.open("post", "sumPostForm.phtml", true);
  2. xhReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  3. var query = "param1=paramvalue1&param2=paramvalue2..............................";
  4. xhReq.send(query);
  5.  
Good Luck with this code !

Debasis Jana.
Oct 12 '07 #12
nirmalsingh
218 100+
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.

Expand|Select|Wrap|Line Numbers
  1. xhreq.open("post", "sumPostForm.phtml", true);
  2. xhReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  3. var query = "param1=paramvalue1&param2=paramvalue2..............................";
  4. xhReq.send(query);
  5.  
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.
Oct 12 '07 #13
dmjpro
2,476 2GB
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 "ActiveXObject" is working without error.
First let me know that, then I will integrate that one.

Debasis Jana
Oct 12 '07 #14
nirmalsingh
218 100+
First let me know with that code fragment "ActiveXObject" is working without error.
First let me know that, then I will integrate that one.

Debasis Jana
dear jana
code fragment "ActiveXObject" is working without error.
Oct 12 '07 #15
dmjpro
2,476 2GB
dear jana
code fragment "ActiveXObject" is working without error.
One more thing let me know.
Tell me the length of url by alerting that url.
Is that more than "1350"?

Expand|Select|Wrap|Line Numbers
  1. alert(url.length); //after setting all parameters how long it is ....
  2.  
If it is then, try this one ..............

Expand|Select|Wrap|Line Numbers
  1. termsxmlHttp.open("POST",url,true);
  2. termsxmlHttp.onreadystatechange=termsstateChanged;
  3. termsxmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  4. termsxmlHttp.send(url);
  5.  
Debasis Jana
Oct 12 '07 #16
nirmalsingh
218 100+
One more thing let me know.
Tell me the length of url by alerting that url.
Is that more than "1350"?

Expand|Select|Wrap|Line Numbers
  1. alert(url.length); //after setting all parameters how long it is ....
  2.  
If it is then, try this one ..............

Expand|Select|Wrap|Line Numbers
  1. termsxmlHttp.open("POST",url,true);
  2. termsxmlHttp.onreadystatechange=termsstateChanged;
  3. termsxmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  4. termsxmlHttp.send(url);
  5.  
Debasis Jana
yes, it is more than 1350. that is 2576(according to my parameter i passed to save).
Oct 12 '07 #17
dmjpro
2,476 2GB
yes, it is more than 1350. that is 2576(according to my parameter i passed to save).
Then use my Code.

Debasis Jana
Oct 12 '07 #18
nirmalsingh
218 100+
Then use my Code.

Debasis Jana
sorry jana,
still i am getting unspecified error!
Oct 12 '07 #19
dmjpro
2,476 2GB
Oppssss !
Sorry the code mistyped.

Expand|Select|Wrap|Line Numbers
  1. var url="Ref="+param;
  2. url=url+"&Terms="+terms;
  3. url=url+"&mode="+mode;
  4. url=url+"&terms_id="+ term_id;
  5. url=url+"&sid="+Math.random();
  6. termsxmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  7. termsxmlHttp.onreadystatechange=termsstateChanged;
  8. termsxmlHttp.open("POST","../Ajax_Pages/aj_terms_conditions.aspx",true);
  9. termsxmlHttp.send(url);
  10.  
Now have a try with this.
Good Luck !

Debasis Jana
Oct 12 '07 #20
nirmalsingh
218 100+
Oppssss !
Sorry the code mistyped.

Expand|Select|Wrap|Line Numbers
  1. var url="Ref="+param;
  2. url=url+"&Terms="+terms;
  3. url=url+"&mode="+mode;
  4. url=url+"&terms_id="+ term_id;
  5. url=url+"&sid="+Math.random();
  6. termsxmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  7. termsxmlHttp.onreadystatechange=termsstateChanged;
  8. termsxmlHttp.open("POST","../Ajax_Pages/aj_terms_conditions.aspx",true);
  9. termsxmlHttp.send(url);
  10.  
Now have a try with this.
Good Luck !

Debasis Jana
sorry to say jana.
again the same problem.
unspecified error in ie
and
uncaught error in firefox.
Oct 12 '07 #21
dmjpro
2,476 2GB
sorry to say jana.
again the same problem.
unspecified error in ie
and
uncaught error in firefox.
I am trying to update the "function termsstateChanged()"
Just try this and let me know what happens.

Expand|Select|Wrap|Line Numbers
  1. function termsstateChanged()
  2. {
  3.     if (termsxmlHttp.readyState==4 && termsxmlHttp.status==200)
  4.      alert("Ajax Call Done ......... Yahoo!!!");
  5. }
  6.  
Please let me know, whether you get the alert or not?

Debasis Jana
Oct 12 '07 #22
nirmalsingh
218 100+
I am trying to update the "function termsstateChanged()"
Just try this and let me know what happens.

Expand|Select|Wrap|Line Numbers
  1. function termsstateChanged()
  2. {
  3.     if (termsxmlHttp.readyState==4 && termsxmlHttp.status==200)
  4.      alert("Ajax Call Done ......... Yahoo!!!");
  5. }
  6.  
Please let me know, whether you get the alert or not?

Debasis Jana
the error occured b4 statechanged function. so no alert displayed.
Oct 12 '07 #23
dmjpro
2,476 2GB
the error occured b4 statechanged function. so no alert displayed.
Try it .............

Expand|Select|Wrap|Line Numbers
  1.       function termsstateChanged()
  2.       {
  3.           alert("helllo world");
  4.           if (termsxmlHttp.readyState==4 && termsxmlHttp.status==200)
  5.            alert("Ajax Call Done ......... Yahoo!!!");
  6.       }
  7.  
  8.  
Watch it, how many times "hello world" gets alerted.
Good Luck !

Debasis Jana
Oct 12 '07 #24
nirmalsingh
218 100+
Try it .............

Expand|Select|Wrap|Line Numbers
  1.       function termsstateChanged()
  2.       {
  3.           alert("helllo world");
  4.           if (termsxmlHttp.readyState==4 && termsxmlHttp.status==200)
  5.            alert("Ajax Call Done ......... Yahoo!!!");
  6.       }
  7.  
  8.  
Watch it, how many times "hello world" gets alerted.
Good Luck !

Debasis Jana
thanx jana.
i tried but no alert is dsipalyed.
Oct 12 '07 #25
dmjpro
2,476 2GB
thanx jana.
i tried but no alert is dsipalyed.
Send me the code, so far what you tried.

Debasis Jana
Oct 12 '07 #26

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Miranda Evans | last post: by
4 posts views Thread by Proc | last post: by
1 post views Thread by stewart.fay | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.