DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2007
    Posts
    4

    Start an .aspx object in C# classes

    Hi All!

    I created an object of page type like:

    Page myPage = new anonym(); // which anonym is an anonym.aspx page

    know wich I want is:

    1. access myPage variables.

    2. start (browse) this object in a browser.

    thanks for your help.

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    I don't understand what you're trying to do. Usually, the code-behind for an ASP.NET page executes when a user requests the page in a browser (e.g., http://servername/appname/anonym.aspx). This also displays the page in the user's browser.

    Can you describe in more detail what you are trying to do?
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Aug 2007
    Posts
    4
    no it is not the code behind.
    suppose we have a class in C# and here we want to create an object of type .aspx. than after we created it we want to browse it. because Response.Redirect(....); doesn't work.
    here is a simple example:
    public class Newaspx
    {
    public Newaspx()
    {
    }

    public void start()
    {
    Page df = new _Default();
    ((_Default)df).Lbl.Text = "hi";//this throws an exception

    //here I'd like to browse it ???????????
    Process def= new Process();

    def.StartInfo.FileName = "df ";
    }
    }

  4. #4
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Is this code a Windows Forms application running on the user's PC? Or a Web application running on a Web server?
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  5. #5
    Join Date
    Aug 2007
    Posts
    4
    web application

  6. #6
    Join Date
    Aug 2007
    Posts
    4
    that mean in an .aspx I create a new object of this class
    than i call the start() method

  7. #7
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    The only ways I know how to transfer control from one page to another in an ASP.NET application are Response.Redirect and Server.Transfer.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

Similar Threads

  1. Replies: 26
    Last Post: 12-01-2012, 04:12 AM
  2. help needed! C# object cache class..
    By djbyrne in forum .NET
    Replies: 3
    Last Post: 02-02-2007, 03:47 PM
  3. Replies: 0
    Last Post: 08-08-2002, 05:56 AM
  4. Even C++ had this much right...
    By Derek Mooney in forum .NET
    Replies: 94
    Last Post: 10-29-2001, 08:44 PM
  5. HtmlSelectElement Object
    By JD in forum Web
    Replies: 0
    Last Post: 05-01-2001, 02:46 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links