0x800a1391 - Microsoft JScript runtime error: 'Sys' is undefined.My code is Below.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Forward.aspx.cs" Inherits="WebApplication2.Forward" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
Untitled Page
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
aspx.xs page is below
using System;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using AjaxControlToolkit;
namespace WebApplication2
{
public partial class Forward : System.Web.UI.Page
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["CON"].ToString());
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindGridData();
}
}
protected void BindGridData()
{
con.Open();
SqlCommand cmd = new SqlCommand("Select id,sender,reciver from inbox", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
gvdetails.DataSource = dt;
gvdetails.DataBind();
}
protected void btnUpdate_Click(object sender, EventArgs e)
{
//con.Open();
//SqlCommand cmd = new SqlCommand("update Table_1 set Name=@Name,Designation=@Designation where ID=@ID", con);
//cmd.Parameters.AddWithValue("@Name", lblusername.Text);
//cmd.Parameters.AddWithValue("@Designation", txtDesg.Text);
//cmd.Parameters.AddWithValue("@ID", Convert.ToInt32(lblID.Text));
//cmd.ExecuteNonQuery();
//con.Close();
//lblresult.Text = lblusername.Text + " Details Updated Successfully";
//lblresult.ForeColor = Color.Green;
//BindGridData();
}
protected void imgbtn_Click(object sender, ImageClickEventArgs e)
{
ImageButton btndetails = sender as ImageButton;
GridViewRow gvrow = (GridViewRow)btndetails.NamingContainer;
lblID.Text = gvdetails.DataKeys[gvrow.RowIndex].Value.ToString();
lblusername.Text = gvrow.Cells[2].Text;
txtDesg.Text = gvrow.Cells[3].Text;
this.ModalPopupExtender1.Show();
}
}
}
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using AjaxControlToolkit;
namespace WebApplication2
{
public partial class Forward : System.Web.UI.Page
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["CON"].ToString());
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindGridData();
}
}
protected void BindGridData()
{
con.Open();
SqlCommand cmd = new SqlCommand("Select id,sender,reciver from inbox", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
gvdetails.DataSource = dt;
gvdetails.DataBind();
}
protected void btnUpdate_Click(object sender, EventArgs e)
{
//con.Open();
//SqlCommand cmd = new SqlCommand("update Table_1 set Name=@Name,Designation=@Designation where ID=@ID", con);
//cmd.Parameters.AddWithValue("@Name", lblusername.Text);
//cmd.Parameters.AddWithValue("@Designation", txtDesg.Text);
//cmd.Parameters.AddWithValue("@ID", Convert.ToInt32(lblID.Text));
//cmd.ExecuteNonQuery();
//con.Close();
//lblresult.Text = lblusername.Text + " Details Updated Successfully";
//lblresult.ForeColor = Color.Green;
//BindGridData();
}
protected void imgbtn_Click(object sender, ImageClickEventArgs e)
{
ImageButton btndetails = sender as ImageButton;
GridViewRow gvrow = (GridViewRow)btndetails.NamingContainer;
lblID.Text = gvdetails.DataKeys[gvrow.RowIndex].Value.ToString();
lblusername.Text = gvrow.Cells[2].Text;
txtDesg.Text = gvrow.Cells[3].Text;
this.ModalPopupExtender1.Show();
}
}
}
mohit guptaPosted Sep 18, 2014, 5:46 AM
Dipankar BiswasPosted Sep 18, 2014, 5:13 AM
http://stackoverflow.com/questions/1931701/microsoft-jscript-runtime-error-sys-is-undefined