Click here to Skip to main content
15,900,589 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I am working on an auction site which is in 3-Tier architecture.There is one server side method in AuctionHub.cs file as follows:

C#
public BAL.LiveAuctionBAL AuctionBid(string Lot_Id, string InputAmt, string vendorid, string V_AuctionID, string AddModBy, string OpenBidAmt, string Decrementbid, string LastBidAmount, string auctionEndTimer)
{
BAL.LiveAuctionBAL BAL = new BAL.LiveAuctionBAL();
string result = "";
string msg = "", message = "";
try
{
BAL.Auction_Id = Convert.ToInt32(V_AuctionID);
BAL.Lot_Id = Convert.ToInt32(Lot_Id);
BAL.Vendor_Id = Convert.ToInt32(vendorid);
BAL.Bid_Amount = Convert.ToDouble(InputAmt);
if (auctionEndTimer != "")
{
BAL.AuctionEndTimer = DateTime.Parse(auctionEndTimer.ToString());
}
else
{
BAL.AuctionEndTimer = Convert.ToDateTime("01/01/1900");
}

BAL.AddMod_By = AddModBy;

result = BAL.AddAuctionBid();

if (result != "")
{
msg = result;
this.Clients.All.bidUpdated(result);
}
}
catch
{

}
return BAL;
}
}


Now I am trying to call this method at client side as follows:
JavaScript
var chat = $.connection.auctionhub;
$(function () {
$.connection.hub.start().done(function () {
chat.server.auctionbid(Lot_Id, InputAmt, vendorid, V_AuctionID, AddModBy, OpenBidAmt, Decrementbid, LastBidAmount, auctionEndTimer);
 });
});

but the method is not getting called at client side...Can anyone help me please? its urgent.
Posted
Updated 15-Jul-15 3:46am
v2

1 solution

It's only the first char that changes to lowercase:

JavaScript
var chat = $.connection.auctionhub;
$(function () 
  {
      $.connection.hub.start().done(function () {
          chat.server.auctionBid(
                Lot_Id, 
                InputAmt, 
                vendorid, 
                V_AuctionID, 
                AddModBy, 
                OpenBidAmt, 
                Decrementbid, 
                LastBidAmount, 
                auctionEndTimer
         ).done(function(returnVal)
                  {
                     //only if you need this
                  });
     });
  });



You can check the browser resources. There will be a subfolder called signalr that contains hub.js. This is the clientside code for interacting with the server.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900