JQuery: Is there a way to show status msg from code behind (asp.net) -


i trying figure out how display message box after done executing server side code

here code works client side still looking way make work code-behind

.aspx

<div id="status"></div>  

script:

$("#status").fadeto(500, 1, function() { $(this).html("you registered!").fadeto(7000, 0); }) 

not sure why fading status div twice.

i now. trying show div , fade away. try this:

$("#status").html("you registered!").show().fadeto(7000, 0); 

or use fadein , fadeout make them both fade, this:

$("#status").html("you registered!").fadein(500).fadeout(7000); 

server side

to on server side use registerclientscriptblock method of scriptmanager class so:

scriptmanager.registerclientscriptblock(me, me.gettype(), "clientscript", "$(function() { $('#status').html('you registered!').fadein(500).fadeout(7000); });", true) 

the first parameter page using on. type, can use me.gettype() get, name method isn't important call it, , actual jquery code. last parameter boolean whether include script tags or not. if put them in jquery code, set false, otherwise keep true.

also, may need scriptmanager control between form tags on page use on. , done using vb code.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -