why this "printtext()" fun. not calling?
using System;
using System.Configuration;
using System.Data;
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;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
public string printtext()
{
return "Hello";
}
}
Loading

Raja KrishnamurthyPosted Mar 11, 2011, 7:12 AM
HTH.
Happy Programming!!!
Regards,
Raja
Edit: took off the semicolon.... thanks Vulpes :-)
Vikas AhlawatPosted Mar 11, 2011, 7:37 AM
VulpesPosted Mar 11, 2011, 7:15 AM
<%Response.Write(printtext());%>
Incidentally, Raja's suggestion should also work if you remove the semicolon after the function call:
<%=printtext()%>
Krishna GaradPosted Mar 11, 2011, 7:15 AM