how i can create a page that works like stackoverflow
i want to know how did these pages work! like this :
http://stackoverflow.com/questions/ask
there is no extension in end of the address!
is this a way to call webmethods directly?! i wrote this page , but i
think its not right!
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string name= Request.QueryString["name"];
if (Request.PathInfo == "/SayHi")Response.Write( SayHi(name));
}
[WebMethod]
public static string SayHi(string name)
{
return "Hi " + name;
}
//[WebMethod]
//public static string SayHi()
//{
// return "Hi ";
//}
}
No comments:
Post a Comment