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. Frameset

Frameset

Scheduled Pinned Locked Moved ASP.NET
26 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.
  • T terjk

    But one thing... How can i link the things in the different frames together? Eg, i have a checkbox list of name on the left frame. Upon selection, a table in the main frame will be generate based on the name selected. What should i do? Can this be solved?

    J Offline
    J Offline
    John Kuhn
    wrote on last edited by
    #17

    Normally, with two or three frames (i.e., a "toc" frame and a "main" frame) the items in the TOC simply refer to pages that should appear in the Main frame, so something like <a href="MyPage.aspx" target="main">Display Page One</a> in the HTML of the page in the TOC frame results in another page displayed in the Main frame. In your case, I think one of two things might work out: 1) Substitute a DataList of LinkButtons in place of the CheckBoxList, and set the target attribute of each LinkButton to the name of the frame in which the content corresponding to that item should appear. LinkButton can be data bound, so that shouldn't be too much of a change. 2) Create a client-side JavaScript (JScript) method invoked from the client-side scripting onClick event that handles the process of what happens when a CheckBoxList item is checked or unchecked on the client, rather than posting back to the server. In this fashion, you could control what appears in the Main frame as well, but coding the solution will be trickier and you'd have to be very familiar with the DOM and DHTML events or find a good reference to those elements involved. Other than that, are you sure you need frames? Perhaps you might think of a way of getting from point a to point b without them. What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.

    T 1 Reply Last reply
    0
    • J John Kuhn

      Normally, with two or three frames (i.e., a "toc" frame and a "main" frame) the items in the TOC simply refer to pages that should appear in the Main frame, so something like <a href="MyPage.aspx" target="main">Display Page One</a> in the HTML of the page in the TOC frame results in another page displayed in the Main frame. In your case, I think one of two things might work out: 1) Substitute a DataList of LinkButtons in place of the CheckBoxList, and set the target attribute of each LinkButton to the name of the frame in which the content corresponding to that item should appear. LinkButton can be data bound, so that shouldn't be too much of a change. 2) Create a client-side JavaScript (JScript) method invoked from the client-side scripting onClick event that handles the process of what happens when a CheckBoxList item is checked or unchecked on the client, rather than posting back to the server. In this fashion, you could control what appears in the Main frame as well, but coding the solution will be trickier and you'd have to be very familiar with the DOM and DHTML events or find a good reference to those elements involved. Other than that, are you sure you need frames? Perhaps you might think of a way of getting from point a to point b without them. What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.

      T Offline
      T Offline
      terjk
      wrote on last edited by
      #18

      I guess both cant work for me. First, im not familiar with DOM and DHTML. Secondly, I have to use checkbox. (allow multiple clicks which link button don't allow) And finally, i required to used frames. Not that i wanted but i'm asked to do so. =( What should I do. Checkboxlist doesn't allow the use of tooltip for each item in the list too.

      J 1 Reply Last reply
      0
      • T terjk

        I guess both cant work for me. First, im not familiar with DOM and DHTML. Secondly, I have to use checkbox. (allow multiple clicks which link button don't allow) And finally, i required to used frames. Not that i wanted but i'm asked to do so. =( What should I do. Checkboxlist doesn't allow the use of tooltip for each item in the list too.

        J Offline
        J Offline
        John Kuhn
        wrote on last edited by
        #19
        1. Go back to the person writing the specifications and tell him or her that frames suck and that they're hard to work with. 2) Put a button at the end of the checkboxlist called "Submit" or something, store all the checkboxlist values in session, then redirect the entire app back to the original frameset page, and reload everything in each of the frames from scratch based on the values stored in session. 3) Good luck... What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
        T 1 Reply Last reply
        0
        • J John Kuhn
          1. Go back to the person writing the specifications and tell him or her that frames suck and that they're hard to work with. 2) Put a button at the end of the checkboxlist called "Submit" or something, store all the checkboxlist values in session, then redirect the entire app back to the original frameset page, and reload everything in each of the frames from scratch based on the values stored in session. 3) Good luck... What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
          T Offline
          T Offline
          terjk
          wrote on last edited by
          #20

          hee... now there is no need for me to do the frames anymore. I free from this now! Thanks for your help. I told my supervisor what you have told me. but now i have another problem not sure if you could help me with it. It regarding imagebutton. To add an handler to the imagebutton that i create programmatically (not user control) imgholi.ImageUrl = Server.MapPath("Pics\pencil.gif") AddHandler imgholi.Click, AddressOf Me.ImageClickHandler cellleft.Controls.Add(imgholi) Private Sub ImageClickHandler(ByVal sender As Object, ByVal e As ImageClickEventArgs) Response.Redirect("MyBookingNewBooking.aspx") End Sub why is it that when i click on the image button, there is no event call. If a user control was used. the sub routine will end with .handles img.click. Is this where the problem lies? Since my imgbtn is not delcared therefore i cannot add .handles img.click. Another thing, when dim img as new IMAGE they prompt me with an error. why is it that imagebutton can be new and image cannot. Must i import ot inherit anything?

          J 1 Reply Last reply
          0
          • T terjk

            hee... now there is no need for me to do the frames anymore. I free from this now! Thanks for your help. I told my supervisor what you have told me. but now i have another problem not sure if you could help me with it. It regarding imagebutton. To add an handler to the imagebutton that i create programmatically (not user control) imgholi.ImageUrl = Server.MapPath("Pics\pencil.gif") AddHandler imgholi.Click, AddressOf Me.ImageClickHandler cellleft.Controls.Add(imgholi) Private Sub ImageClickHandler(ByVal sender As Object, ByVal e As ImageClickEventArgs) Response.Redirect("MyBookingNewBooking.aspx") End Sub why is it that when i click on the image button, there is no event call. If a user control was used. the sub routine will end with .handles img.click. Is this where the problem lies? Since my imgbtn is not delcared therefore i cannot add .handles img.click. Another thing, when dim img as new IMAGE they prompt me with an error. why is it that imagebutton can be new and image cannot. Must i import ot inherit anything?

            J Offline
            J Offline
            John Kuhn
            wrote on last edited by
            #21

            helpNeeded wrote: why is it that when i click on the image button, there is no event call This is due to the infamous "dynamic objects don't exist on postback" conundrum. Here's the solution:

            Protected buttonCreated As Boolean
            
            Private Sub Page\_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
                If Not Session("ButtonCreated") Is Nothing Then
                    buttonCreated = CType(Session("ButtonCreated"), Boolean)
                Else
                    buttonCreated = False
                End If
                If IsPostBack And buttonCreated Then
                    CreateDynamicButton()
                End If
            End Sub
            
            Private Sub Button1\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
                CreateDynamicButton()
            End Sub
            
            Private Sub ImageClickHandler(ByVal sender As Object, ByVal e As ImageClickEventArgs)
                Response.Redirect("AnotherPage.aspx")
            End Sub
            
            Private Sub CreateDynamicButton()
                Dim img As New ImageButton
                img.ID = "dynamicImageButton"
                img.ImageUrl = "images/happy.gif"
                AddHandler img.Click, AddressOf ImageClickHandler
                phButtonGoesHere.Controls.Add(img)
                buttonCreated = True
                Session("ButtonCreated") = buttonCreated
            End Sub
            

            So, you have to create the control dynamically to display, then re-create it during postback so that the server can handle the event. helpNeeded wrote: when dim img as new IMAGE they prompt me with an error This is due to the fact that the Image class exists in more than one namespace, both System.Web.UI.WebControls and System.Drawing, and thus the code is ambiguous as is. The System.Drawing Image is abstract (MustInherit) and leaves the implementation to you, or you must use an existing derived class. The System.Web.UI.WebControls Image can be created using New.

            Private Sub CreateImageObjects()
                Dim oneImage As New System.Web.UI.WebControls.Image
                Dim anotherImage As System.Drawing.Image
            End Sub
            

            What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.

            T 3 Replies Last reply
            0
            • J John Kuhn

              helpNeeded wrote: why is it that when i click on the image button, there is no event call This is due to the infamous "dynamic objects don't exist on postback" conundrum. Here's the solution:

              Protected buttonCreated As Boolean
              
              Private Sub Page\_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
                  If Not Session("ButtonCreated") Is Nothing Then
                      buttonCreated = CType(Session("ButtonCreated"), Boolean)
                  Else
                      buttonCreated = False
                  End If
                  If IsPostBack And buttonCreated Then
                      CreateDynamicButton()
                  End If
              End Sub
              
              Private Sub Button1\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
                  CreateDynamicButton()
              End Sub
              
              Private Sub ImageClickHandler(ByVal sender As Object, ByVal e As ImageClickEventArgs)
                  Response.Redirect("AnotherPage.aspx")
              End Sub
              
              Private Sub CreateDynamicButton()
                  Dim img As New ImageButton
                  img.ID = "dynamicImageButton"
                  img.ImageUrl = "images/happy.gif"
                  AddHandler img.Click, AddressOf ImageClickHandler
                  phButtonGoesHere.Controls.Add(img)
                  buttonCreated = True
                  Session("ButtonCreated") = buttonCreated
              End Sub
              

              So, you have to create the control dynamically to display, then re-create it during postback so that the server can handle the event. helpNeeded wrote: when dim img as new IMAGE they prompt me with an error This is due to the fact that the Image class exists in more than one namespace, both System.Web.UI.WebControls and System.Drawing, and thus the code is ambiguous as is. The System.Drawing Image is abstract (MustInherit) and leaves the implementation to you, or you must use an existing derived class. The System.Web.UI.WebControls Image can be created using New.

              Private Sub CreateImageObjects()
                  Dim oneImage As New System.Web.UI.WebControls.Image
                  Dim anotherImage As System.Drawing.Image
              End Sub
              

              What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.

              T Offline
              T Offline
              terjk
              wrote on last edited by
              #22

              Well well well. Thanks for your help! The codes are workable for my daily and weekly calendar but for the monthly... There is a problem. Dealing with event calendar. So i use a calendar control and the method dayRender. If IsPostBack And buttoncreated Then 'calEvent_DayRender() createcalendar() End If For the rest of my calendar, i have a sub routine to create the calendar which is liek your method createDynamicButton. Since The calendar control, make use of the dayRender method, So how can i pass in the method?

              J 1 Reply Last reply
              0
              • J John Kuhn

                helpNeeded wrote: why is it that when i click on the image button, there is no event call This is due to the infamous "dynamic objects don't exist on postback" conundrum. Here's the solution:

                Protected buttonCreated As Boolean
                
                Private Sub Page\_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
                    If Not Session("ButtonCreated") Is Nothing Then
                        buttonCreated = CType(Session("ButtonCreated"), Boolean)
                    Else
                        buttonCreated = False
                    End If
                    If IsPostBack And buttonCreated Then
                        CreateDynamicButton()
                    End If
                End Sub
                
                Private Sub Button1\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
                    CreateDynamicButton()
                End Sub
                
                Private Sub ImageClickHandler(ByVal sender As Object, ByVal e As ImageClickEventArgs)
                    Response.Redirect("AnotherPage.aspx")
                End Sub
                
                Private Sub CreateDynamicButton()
                    Dim img As New ImageButton
                    img.ID = "dynamicImageButton"
                    img.ImageUrl = "images/happy.gif"
                    AddHandler img.Click, AddressOf ImageClickHandler
                    phButtonGoesHere.Controls.Add(img)
                    buttonCreated = True
                    Session("ButtonCreated") = buttonCreated
                End Sub
                

                So, you have to create the control dynamically to display, then re-create it during postback so that the server can handle the event. helpNeeded wrote: when dim img as new IMAGE they prompt me with an error This is due to the fact that the Image class exists in more than one namespace, both System.Web.UI.WebControls and System.Drawing, and thus the code is ambiguous as is. The System.Drawing Image is abstract (MustInherit) and leaves the implementation to you, or you must use an existing derived class. The System.Web.UI.WebControls Image can be created using New.

                Private Sub CreateImageObjects()
                    Dim oneImage As New System.Web.UI.WebControls.Image
                    Dim anotherImage As System.Drawing.Image
                End Sub
                

                What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.

                T Offline
                T Offline
                terjk
                wrote on last edited by
                #23

                help help help please...

                1 Reply Last reply
                0
                • J John Kuhn

                  helpNeeded wrote: why is it that when i click on the image button, there is no event call This is due to the infamous "dynamic objects don't exist on postback" conundrum. Here's the solution:

                  Protected buttonCreated As Boolean
                  
                  Private Sub Page\_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
                      If Not Session("ButtonCreated") Is Nothing Then
                          buttonCreated = CType(Session("ButtonCreated"), Boolean)
                      Else
                          buttonCreated = False
                      End If
                      If IsPostBack And buttonCreated Then
                          CreateDynamicButton()
                      End If
                  End Sub
                  
                  Private Sub Button1\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
                      CreateDynamicButton()
                  End Sub
                  
                  Private Sub ImageClickHandler(ByVal sender As Object, ByVal e As ImageClickEventArgs)
                      Response.Redirect("AnotherPage.aspx")
                  End Sub
                  
                  Private Sub CreateDynamicButton()
                      Dim img As New ImageButton
                      img.ID = "dynamicImageButton"
                      img.ImageUrl = "images/happy.gif"
                      AddHandler img.Click, AddressOf ImageClickHandler
                      phButtonGoesHere.Controls.Add(img)
                      buttonCreated = True
                      Session("ButtonCreated") = buttonCreated
                  End Sub
                  

                  So, you have to create the control dynamically to display, then re-create it during postback so that the server can handle the event. helpNeeded wrote: when dim img as new IMAGE they prompt me with an error This is due to the fact that the Image class exists in more than one namespace, both System.Web.UI.WebControls and System.Drawing, and thus the code is ambiguous as is. The System.Drawing Image is abstract (MustInherit) and leaves the implementation to you, or you must use an existing derived class. The System.Web.UI.WebControls Image can be created using New.

                  Private Sub CreateImageObjects()
                      Dim oneImage As New System.Web.UI.WebControls.Image
                      Dim anotherImage As System.Drawing.Image
                  End Sub
                  

                  What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.

                  T Offline
                  T Offline
                  terjk
                  wrote on last edited by
                  #24

                  help help help please...

                  1 Reply Last reply
                  0
                  • T terjk

                    Well well well. Thanks for your help! The codes are workable for my daily and weekly calendar but for the monthly... There is a problem. Dealing with event calendar. So i use a calendar control and the method dayRender. If IsPostBack And buttoncreated Then 'calEvent_DayRender() createcalendar() End If For the rest of my calendar, i have a sub routine to create the calendar which is liek your method createDynamicButton. Since The calendar control, make use of the dayRender method, So how can i pass in the method?

                    J Offline
                    J Offline
                    John Kuhn
                    wrote on last edited by
                    #25

                    I'm having a hard time visualizing your issue on this one... do you have a more complete sample of the code you're trying to build? What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.

                    T 1 Reply Last reply
                    0
                    • J John Kuhn

                      I'm having a hard time visualizing your issue on this one... do you have a more complete sample of the code you're trying to build? What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.

                      T Offline
                      T Offline
                      terjk
                      wrote on last edited by
                      #26

                      Well, here it goes. I have 3 event calendars(daily, weekly, monthly). With these, i have to generate html to contain the records of event for each day (daily, weekly) and as for the monthly i used the calendar control instead of html tables. Calendar control has a method call day_render. am i right? So to generate a event calendar for daily and weekly...here are my codes: Public Sub createCalendar() For i = 0 To cbxlistComp.Items.Count - 1 If cbxlistComp.Items(i).Selected = True Then Dim isClose As Boolean = False Dim isHoli As Boolean = False Dim tobook As Boolean = False Dim imgholi As ImageButton Dim row As New TableRow Dim cellleft As New TableCell Dim cellright As New TableCell Dim lblnametxt As New Label rname = cbxlistComp.Items(i).Text Dim rID As String = eResource.getResourceID(name) : : If isHoli Then imgholi.ImageUrl = Server.MapPath("Pics\icon_bell.gif") cellright.Controls.Add(imgholi) ElseIf isClose Then imgholi.ImageUrl = Server.MapPath("Pics\closure_icon.gif") cellright.Controls.Add(imgholi) ElseIf tobook Then imgholi.ID = rid imgholi.ImageUrl = Server.MapPath("Pics\pencil.gif") AddHandler imgholi.Click, AddressOf ImageClickHandler cellleft.Controls.Add(imgholi) buttoncreated = True Session("ButtonCreated") = buttoncreated bkresource = eResource.getBookingInfoDS(rid, g.Date) If bkresource.Tables(0).Rows.Count > 1 Then For j = 0 To bkresource.Tables(0).Rows.Count - 1 Dim lblbookinfo As New Label Dim lbltime As New HyperLink lbltime.NavigateUrl = "MyBookingViewAll.aspx" lbltime.ForeColor = Color.Black : : lbltime.Attributes.Add("ONMOUSEOVER", "this.style.color=""red""") lbltime.Attributes.Add("ONMOUSEOUT", "this.style.color="

                      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