Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. how to access .cs page values in aspx page????

how to access .cs page values in aspx page????

Scheduled Pinned Locked Moved ASP.NET
designsecurityhelptutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sarala s
    wrote on last edited by
    #1

    This is my first.cs page..... namespace testvalueobject { /// <summary> /// Summary description for first /// </summary> [Serializable] public class first { int a, b, c; public first() { a = 10; b = 20; } [XmlAttribute] public int add() { c = a + b; return c; } } } this is my default.aspx.cs page.... using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using App_Data.testvalueobject; using App_Data.testvalueobject.first; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } } i can't access the methods of cs page in aspx.cs page...... kindly help me soon sarala.s

    M A 2 Replies Last reply
    0
    • S sarala s

      This is my first.cs page..... namespace testvalueobject { /// <summary> /// Summary description for first /// </summary> [Serializable] public class first { int a, b, c; public first() { a = 10; b = 20; } [XmlAttribute] public int add() { c = a + b; return c; } } } this is my default.aspx.cs page.... using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using App_Data.testvalueobject; using App_Data.testvalueobject.first; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } } i can't access the methods of cs page in aspx.cs page...... kindly help me soon sarala.s

      M Offline
      M Offline
      meeram395
      wrote on last edited by
      #2

      Create an object of the class file in aspx file and then you can access the variables. You can also access it using properties.

      Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

      1 Reply Last reply
      0
      • S sarala s

        This is my first.cs page..... namespace testvalueobject { /// <summary> /// Summary description for first /// </summary> [Serializable] public class first { int a, b, c; public first() { a = 10; b = 20; } [XmlAttribute] public int add() { c = a + b; return c; } } } this is my default.aspx.cs page.... using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using App_Data.testvalueobject; using App_Data.testvalueobject.first; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } } i can't access the methods of cs page in aspx.cs page...... kindly help me soon sarala.s

        A Offline
        A Offline
        Abhijit Jana
        wrote on last edited by
        #3
        First F=new First();
        int a=F.Add()
        

        What is issue with that ? are you talking about some thing different ?

        cheers, Abhijit

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups