Page. registerclientscriptblock method [C #]
Allows the ASP. NET Server Control to issue client script blocks in the page.
Parameters
Key
Unique key that identifies the script block.
Script
The content of the script sent to the client.
Example:
<HTML>
<Head>
<Script language = "C #" runat = "server">
Public void page_load (Object sender, eventargs e ){
// Form the script that is to be registered at client side.
String scriptstring = "<script language = JavaScript> function doclick (){";
Scriptstring + = "myform. Show. value = 'Welcome to Microsoft. net'} <";
Scriptstring + = "/";
Scriptstring + = "script> ";
If (! This. isclientscriptblockregistered ("clientscript "))
This. registerclientscriptblock ("clientscript", scriptstring );
}
</SCRIPT>
</Head>
<Body topmargin = "20" leftmargin = "10">
<Form ID = "myform" runat = "server">
<Input type = "text" id = "show" style = "width = 200"> <input type = "button" value = "clickme" onclick = "doclick ()">
</Form>
</Body>
</Html>