Saturday, March 24, 2012

web service problem

Hi,
i create a web service. The File's name is "warning.ascx"
and my part of the codes of webform1.aspx:

in HTML:
<%@dotnet.itags.org. Control ClassName="warning"%
in aspx.cs

private void Button1_Click(object sender, System.EventArgs e)
{
warning warn=(warning)LoadControl("warning.ascx");
warn.WM="hi";
}

when i write warn, after dot(warn.) i can see the WM(attribute)
and i can write whatever i want

But when i start program an error occured:

Parser Error Message:The directive'Control' is unknown

ascx file is ="warning.ascx"
class in this ascx file is=public class warning : System.Web.UI.UserControl

anybody help me?

Thanks1. You're confusing web service and user control. An ascx file defines a user control.
2. In an aspx page, you should have a Page directive, not a Control directive (these are for ascx files)

0 comments:

Post a Comment