Help me - asp( i have written code)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nguyenlh
    New Member
    • Mar 2007
    • 25

    Help me - asp( i have written code)

    I hava ( application web in asp ) fowllowing :
    I want load - Default2.aspx and Default3.aspx - I use a treeview but when
    there is a error - ex: Default2.aspx not inherite System.Web.UI.U serControl;

    using System.Web;
    using System.Web.Secu rity;
    using System.Web.UI;
    using System.Web.UI.W ebControls;
    using System.Web.UI.W ebControls.WebP arts;
    using System.Web.UI.H tmlControls;



    public partial class _Default : System.Web.UI.P age
    {
    protected void Page_Load(objec t sender, EventArgs e)
    {

    }
    protected void TreeView1_Selec tedNodeChanged( object sender, EventArgs e )
    {
    String c = TreeView1.Selec tedNode.Value;
    switch (c)
    {
    case "Not1":
    {
    PlaceHolder1.Co ntrols.Add((Use rControl)LoadCo ntrol("Default2 .aspx"));
    break;
    }
    case "Not2":
    {
    PlaceHolder1.Co ntrols.Add((Use rControl)LoadCo ntrol("Default3 .aspx"));
    break;
    }


    }
    }
    }
    thanks you...
  • sreemathy2000
    New Member
    • Oct 2007
    • 40

    #2
    Instaed of a place holder put a frame and change the src attributes of the frame.

    Code:
        if (TreeView.SelectedNode.Text =="Data Entry Screen")          {                   frame1.Attributes["src"] = "ReportCriteria.aspx";           }

    Comment

    • nguyenlh
      New Member
      • Mar 2007
      • 25

      #3
      Originally posted by sreemathy2000
      Instaed of a place holder put a frame and change the src attributes of the frame.

      Code:
          if (TreeView.SelectedNode.Text =="Data Entry Screen")          {                   frame1.Attributes["src"] = "ReportCriteria.aspx";           }
      but you I thinks code above !1
      It will run
      but I have a error

      Comment

      • Shashi Sadasivan
        Recognized Expert Top Contributor
        • Aug 2007
        • 1435

        #4
        the error lies in the declaration of default2.aspx

        Have you changed the inheriting class of it?

        Comment

        • nguyenlh
          New Member
          • Mar 2007
          • 25

          #5
          Originally posted by Shashi Sadasivan
          the error lies in the declaration of default2.aspx

          Have you changed the inheriting class of it?
          Suppose I have a default2.aspx is <%@ Page Language="C#" Debug ="true" AutoEventWireup ="true" CodeFile="Defau lt2.aspx.cs" Inherits="Defau lt2" %>
          You help me
          I can change that but I try ,.,.., but it can't run and error
          You can help me

          Comment

          • nguyenlh
            New Member
            • Mar 2007
            • 25

            #6
            Originally posted by nguyenlh
            Suppose I have a default2.aspx is <%@ Page Language="C#" Debug ="true" AutoEventWireup ="true" CodeFile="Defau lt2.aspx.cs" Inherits="Defau lt2" %>
            You help me
            I can change that but I try ,.,.., but it can't run and error
            You can help me
            I understand this problems
            Thanks you !!

            Comment

            Working...