2/21/2012 7:01:23 PM
1871
Reputation
252
Total posts
Ok..
I got it working but its firing too soon... any one have any idea how to delay it ?
Below is what i got working now..
protected
void
Page_Load(
object
sender, EventArgs e)
{
string
javaScriptFunction =
"function pageLoad() {"
+
"$(function () {"
+
"$('.btnClick').click(function () {"
+
"alert('Alert: Hello from jQuery! - ' + $('.txtid').val());"
+
"});"
+
"});"
+
"}"
;
MonoSoftware.MonoX.Utilities.JavascriptUtility.RegisterClientScriptBlock(UpdatePanel1x,
this
.GetType(),
"myScript"
, javaScriptFunction,
true
);
//string javascripturl = "/TheScene/js/thesceneplayer.js";
// MonoSoftware.MonoX.Utilities.JavascriptUtility.RegisterClientScriptInclude(UpdatePanel1x, javascripturl);
}
Then my markup looks a little like this..
insisde update panel
<asp:TextBox
class
=
'txtid'
ID=
"txtid"
runat=
"server"
></asp:TextBox>
<asp:button id=
"Play"
runat=
"server"
class
=
"btnClick"
CommandArgument=
'<%# Eval("SongId") %>'
CommandName=
"PlaySong"
OnClick=
"PlayerBtnHandler"
Text=
"PLAY"
/>
clicking the button sends a ajax query to the server and then it returns with the txtid
set
..
My problem is my jquery is firing to soon before the server responds with the id..
Rating history (Content is rated 0.00 of 0 vote(s).)
Shows who have rated the content, and the rating score.