Default.aspx
<script type="text/javascript">
$(function() {
$("#add_questions").click(function() {
var question = $("#wmd-output").val();
var option1 = $("#option1").val();
var option2 = $("#option2").val();
var option3 = $("#option3").val();
var option4 = $("#option4").val();
var answer = $("#answer").val();
var paper = $("#txt_subject_id").val();
var dataString = 'question='+ question +'&option1='+option1 +'&option2='+option2 +'&option3='+option3 +'&option4='+option4 +'&answer='+answer+'&paper='+paper;
$("#flash").show();
$("#flash").fadeIn(400).html('<img src="../images/validate.gif" align="absmiddle">');
//alert(dataString)
$.ajax({
type: "GET",
url: "Default2.aspx",
data: dataString,
cache: false,
success: function(html){
$("#display").after(html);
//alert(html)
//document.getElementById('content').value='';
//document.getElementById('content').focus();
$("#flash").hide();
}
});
return false;
});
});
</script>
Let
dataString="question=p>hello</p>&option1=option1&option2=option2&option3=option3&option4=option4&answer=answer&paper=paper"
How could I pass this query string to next page using jquery? I didn’t get response from the next page, which means the question=<p>hello</p> not getting the value.
Default2.aspx
Dim question As String
question = Request.QueryString("question")
Response.Write(question)
I also tried encodeUri and encodeURIcomponent.
First of all thanks to everyone for their effort.
This is what i did
I have used
encodeURIComponenttwice and while decoding at the server sidequest = Server.UrlDecode(question)display the correct value.
Thanks again for help !!