Saturday, March 24, 2012

about syntax error!

error: syntax error
source document :http://localhost/MyDream/AboutConten.asmx/js
line:3
source code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

my AboutConten.asmx is:

<%@dotnet.itags.org. WebService Language="C#" Class="MyDream1.AbouConten" %>

using System;
using System.Web;
using System.Data.SqlClient;
using System.Configuration;
using System.Web.Services;
using System.Web.Services.Protocols;
namespace MyDream1
{
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class AbouConten : System.Web.Services.WebService
{

[WebMethod]
public string HelloWorld()
{
return "Hello World";
}
[WebMethod]
public string ShowContent(string myId)
{
int id = Convert.ToInt32(myId);
string connStr = ConfigurationManager.AppSettings[0].ToString();
SqlConnection conn = new SqlConnection(connStr);
string cmdStr = "select this_content from myTopic where this_id = @dotnet.itags.org.this_id";
SqlCommand comm = new SqlCommand(cmdStr, conn);
comm.Parameters.AddWithValue("@dotnet.itags.org.this_id", id);
conn.Open();
SqlDataReader dr = comm.ExecuteReader();
dr.Read();
string returnStr = dr[0].ToString();
dr.Close();
conn.Close();
return returnStr;
}

}
}

why?

please help me!

thanks!

What do you see when you navigate to the proxy directly from the browser (typehttp://localhost/MyDream/AboutConten.asmx/js in your address bar)?

No comments:

Post a Comment