开发者

Function call problem in asp.net

开发者 https://www.devze.com 2023-01-27 05:05 出处:网络
I have written a function scroll() in code my behind, and called it using <% Response.Write(scroll()); %> in ASPX page. Function is worki开发者_开发百科ng properly but in Internet Explorer it sh

I have written a function scroll() in code my behind, and called it using <% Response.Write(scroll()); %> in ASPX page. Function is worki开发者_开发百科ng properly but in Internet Explorer it shows Error on Page message at corner.

I also tried <%=scroll() %> to call it, still showing error on page message.

Can anybody tell me another way to call function?

Plz help.

Thanks.


I think you are doing some thing wrong, We can call server side function in code behind file like:

Default.aspx

Form tag start Div start <%= Scroll() %> Div end Form tag closed

Default.aspx.cs

public partial class _Default : System.Web.UI.Page {
protected void Page_Load(object sender, EventArgs e) {

    }
    public string Scroll()
    {
        return "test";
    }        

}

try it out its working and match it with your code.

0

精彩评论

暂无评论...
验证码 换一张
取 消