Shyju
Shyju

Reputation: 218822

jQuery Ajax load function +returning a value other than the HTML

I am using the following jQuery code to fill my DIV in the ASPX page

   var div = $("#divPrice");  
   div.fadeOut('slow',function(){      
   div.load("../Lib/handlers/GetPrice.aspx?answers="+queryValues+"&item="+modelId,{ symbol: $("#txtSymbol" ).val() },function()
   {
      $(this).fadeIn('slow');                                           
   });

   });   
  $("#divBtns").fadeIn('slow');

This works fine. In Get price.aspx, it will return a HTML and it will be loaded in the div. Now i want to return another number along with this HTML to my javascript. How can i do that?

Upvotes: 1

Views: 1459

Answers (2)

lamy
lamy

Reputation: 1

use hidden control input to do that :

asp.net

<input type="hidden" id="yr_control" value="<%=Request.QueryString.Get("val_control") %>" />

code behind:

Request.QueryString.Get("val_control")

in ajax

$("#yr_control").attr("value")

Upvotes: 0

TheVillageIdiot
TheVillageIdiot

Reputation: 40517

please read these posts to get in depth knowledge about using jquery to play with asp.net.

Upvotes: 3

Related Questions