473,394 Members | 2,100 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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 2561
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

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

Similar topics

1
by: Durairaj Avasi | last post by:
#!/usr/bin/perl -w use Net::LDAP; use Net::LDAP::Util qw(ldap_error_name ldap_error_text); my $ldap = Net::LDAP->new('xy.webdurai.net', port=> 389) or die "$@"; $ldap->debug(15); my @args = (...
0
by: Miranda Evans | last post by:
I noticed several postings about issues related to "run-time error 3061", and I observed that the solutions to these issues appear to involve correcting something within the SQL code. I'm...
4
by: Brian Mink | last post by:
I am having trouble getting one database to export data that another one can import. The problem is a dash "-". I have a group of numbers entered in my database that have a dash in them (e.g....
4
by: acni | last post by:
I have the following peice of code to try and send an email to selected contacts in my form.The problem is this line: StrStore = DLookup("", "qrySelectEmail", "??????") This looks up the email...
4
by: Proc | last post by:
I am hoping someone here can point me in the right direction with a problem my user's are experiencing. Here is what is happening: I have an ASP.NET application that several users will use at...
1
by: stewart.fay | last post by:
Dear all, I am using the HttpWebRequest and HttpWebRequest to send an XML request to an ASPX page. When I use the browser and add my XML request the request is posted fine and an answer is...
9
by: Kelii | last post by:
I've been trying to get this piece to work for a few hours, but have given up. I hope someone out there can help, I think the issue is relatively straightforward, but being a novice, I'm stumped....
1
by: wkerplunk | last post by:
Below is what I have build with several different languages. It works great but I need help, I am stuck. When you click on an item in the dropdown autocomplete div it does a mousedown function...
2
nirmalsingh
by: nirmalsingh | last post by:
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.