.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

JSP to C# ASP.NET

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :ASP.Net
 


Hi there,

I need to create an aspx page that is equivalent to a JSP page I have. It's nothing very complicated, but I'm having trouble all the same.


The problem is that JSP allows me to declare static methods within the script itself, but I can't see how to do this in C#/ASP. In JSP I have something like this:

<%@ page import="java.net.*, java.io.*, java.security.*" %>
<%
out.println("Doing some stuff!");

//Calling myFunction which is defined in the same JSP page below
out.println(myFunction());

%>
<%!

String myFunction() {
  //This is myFunction defined in the JSP page
  return "hello";
}
%>


Basically I need to figure out how I can define and use the function myFunction in the aspx page.

All help greatly appreciated!

Regards

Subd




View Complete Post


More Related Resource Links

Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend