Why the error is giving "The name 'ScriptManager' does not exist in the current context" in the following line.How to define script manager
<html>
<head>
<title>Entry for notification</title>
<script type="text/javascript">
function Showalert(username) {
alert(username + ' details updated successfully.');
}
My HTML Code is given below
</head>
<body>
<script src="../nicEdit.js" type="text/javascript"></script>
<script type="text/javascript">
bkLib.onDomLoaded(function() {
['fontSize','bold','italic','underline','strikeThrough','subscript','superscript','html','image']}).panelInstance('area4');
new nicEditor({maxHeight : 400}).panelInstance('ta1');
});
</script>
<form runat="server">
<textarea style="height: 100px;" cols="80" id="ta1" runat="server"></textarea><br><br>
<asp:Button ID="b1" Text="Submit" OnClick="submit" runat="server"/>
</form>
</body></html>
My CS Code is given below
<%@ Page validateRequest="false" Debug="True"%>
<%@Import Namespace="System.Data"%>
<%@Import Namespace="System.Data.OleDb"%>
<script runat="server" language="c#">
OleDbConnection con;
OleDbCommand com;
OleDbDataAdapter da;
DataSet ds;
string a1,st;
void page_Load(Object sender,EventArgs e)
{
con=new OleDbConnection();
con.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/nicedit/adv_web.mdb") + "";
con.Open();
ds=new DataSet();
string sql="select * from notification";
da=new OleDbDataAdapter(sql,con);
da.Fill(ds,"notification");
}
void submit(Object sender, EventArgs e)
{
con.Open();
com=con.CreateCommand();
com.CommandText="UPDATE notification SET notice = '" + ta1.Value + "' where id='" + 1 + "'";
int result= com.ExecuteNonQuery();
con.Close();
if(result==1)
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "ShowSuccess", "javascript:Showalert('"+ta1.Value+"')", true);
}
}
</script>