Click here to Skip to main content
13,256,716 members (53,277 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Why the error is giving "The name 'ScriptManager' does not exist in the current context" in the following line.How to define script manager

<title>Entry for notification</title>
<script type="text/javascript">
function Showalert(username) {
alert(username + ' details updated successfully.');
My HTML Code is given below
<script src="../nicEdit.js" type="text/javascript"></script>
<script type="text/javascript">
bkLib.onDomLoaded(function() {
new nicEditor({maxHeight : 400}).panelInstance('ta1');
<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"/>

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") + "";
ds=new DataSet();
string sql="select * from notification";
da=new OleDbDataAdapter(sql,con);
void submit(Object sender, EventArgs e)
com.CommandText="UPDATE notification SET notice = '" + ta1.Value + "' where id='" + 1 + "'";
int result= com.ExecuteNonQuery();
ScriptManager.RegisterStartupScript(this, this.GetType(), "ShowSuccess", "javascript:Showalert('"+ta1.Value+"')", true);
Posted 15-Feb-12 23:25pm
Updated 15-Feb-12 23:30pm
NikulDarji 16-Feb-12 4:31am
pre tag added.....

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

include following code inside the form
<asp:scriptmanager id="ScriptManager1" runat="server"/>
Janardan Pandey 16-Feb-12 4:41am
Error is giving: Unknown server tag 'asp:ScriptManager'
digimanus 16-Feb-12 4:49am
place that line of code inside your form tags
Jeevitha royapathi 16-Feb-12 6:50am
Use NameSpace "System.Web.UI" in cs page

and remove this code from design page
<asp:scriptmanager id="ScriptManager1" runat="server"/>
blue_developer 20-Sep-12 10:33am
Thank you Jeevitha!!
That worked for me.
Cheers. ;]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.171114.1 | Last Updated 16 Feb 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100