How can call a jQuery function when it is inside the formview (asp.net control)?
- by ricky roy
Hi,
All I have a Span in side the Form view. I wanted to Call a Jquery Fucntion when the from load how can i do this?
Thanks
Waiting for your reply
here is my code
<asp:FormView ID="FormView1" runat="server" OnItemCommand="FormView1_ItemCommand">
<ItemTemplate>
<asp:HiddenField ID="hidProductID" Value='<%#Eval("ProductID") %>' runat="server" />
<asp:HiddenField ID="hidCustomerID" Value='<%#Eval("CustomerID") %>' runat="server" />
<a href='<%=WinToSave.SettingsConstants.SiteURL%>WintoSave/AuctionProduct.aspx?id=<%#Eval("ProductID") %>'>
<%#Eval("ProductName")%>
</a>
<br />
<img src='<%#Eval("ImagePath")%>' alt="Image No available" />
<br />
<asp:Label ID="lblTime" runat="server" Text='<%#Convert.ToDateTime(Eval("ModifiedOn")).ToString("hh:mm:ss") %>'></asp:Label>
<span id='Countdown_<%#Eval("ProductID") %>' onload="GetTimeOnLoad('<%#Eval("ModifiedOn")%>','Countdown_<%#Eval("ProductID") %>');"></span>
<br />
<asp:Label ID="lblFinalPrice" runat="server" Text='<%#Convert.ToDouble(Eval("FinalPrice")).ToString("#.00")%>'></asp:Label>
<br />
<asp:Label ID="lblFullName" runat="server" Text='<%#Eval("FullName") %>'></asp:Label>
<br />
<asp:Button ID="btnAddbid" Text="Bid" CommandName="AddBid" CommandArgument='<%#Eval("ID")%>'
runat="server" />
</ItemTemplate>
</asp:FormView>
and following is my jquery code
function GetTimeOnLoad(shortly,DivID)
{
var dt = new Date(shortly);
alert(dt);
alert(shortly);
alert(DivID);
var ProductDivID = "#" +DivID;
alert(ProductDivID);
$(ProductDivID).countdown({
until: dt, onExpiry: liftOff, onTick: watchCountdown,
format: 'HMS', layout: '{hnn}{sep}{mnn}{sep}{snn}'
});
}
function liftOff(){};
function watchCountdown(){};
In above code I Used
' onload="GetTimeOnLoad('<%#Eval("ModifiedOn")%','Countdown_<%#Eval("ProductID") %');"
but is not working