Frameset
-
Well, yes and no. Technically, you could create an ASP.NET Web Form that would generate a frameset page, but I can't imagine there would be much of a point to doing so. I suggest you right-click on your web project, select Add..., then select Add New Item..., then select Frameset from the Add New Item dialog box, and name the resulting page "Default.htm". Then, right-click on the main frame and select "Set Page for Frame" and then pick your existing ASP.NET web form. 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.
-
Correct, the Frameset will be a plain old HTML page stored in an .htm or an .html file. 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.
-
Correct, the Frameset will be a plain old HTML page stored in an .htm or an .html file. 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.
-
But the rest of mine web forms are in .aspx. Wouldn't it be strange if the program have both aspx and html pages?
Not at all -- it is a WEB application after all... all those ASPX pages do is generate HTML. You might consider starting your app at Default.aspx if you are using any kind of authentication or authorization, then redirect to the Frameset page. The same rules (Security, etc.) will still apply to the ASPX pages. 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.
-
Not at all -- it is a WEB application after all... all those ASPX pages do is generate HTML. You might consider starting your app at Default.aspx if you are using any kind of authentication or authorization, then redirect to the Frameset page. The same rules (Security, etc.) will still apply to the ASPX pages. 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.
-
When i set a ascx page for frame. It say: This type of page is not served. So does not mean that only aspx can be added to the frameset?
An ASCX is a user control, and no, it is not intended to serve itself. You have to put a user control on a page. Using a Frameset, though, you can target any other kind of URL that produces HTML at runtime: HTM, ASP, ASPX, JSP, etc... 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.
-
An ASCX is a user control, and no, it is not intended to serve itself. You have to put a user control on a page. Using a Frameset, though, you can target any other kind of URL that produces HTML at runtime: HTM, ASP, ASPX, JSP, etc... 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.
That means i got to put my ascx control into a aspx page before putting in into the frame? If my web form is already done but without the frames. Does that means i have to redo the sections on different pages so that i can insert into the different frames?
-
That means i got to put my ascx control into a aspx page before putting in into the frame? If my web form is already done but without the frames. Does that means i have to redo the sections on different pages so that i can insert into the different frames?
helpNeeded wrote: That means i got to put my ascx control into a aspx page before putting in into the frame? Yes. helpNeeded wrote: If my web form is already done but without the frames. Does that means i have to redo the sections on different pages so that i can insert into the different frames? Not sure what you're asking here, but here's what a frames page should look like:
<html>
<head>
<title>Hello!</title>
</head>
<frameset rows="64,*">
<frame name="banner" src="MyPage1.aspx" scrolling="no" noresize>
<frameset cols="150,*">
<frame name="contents" src="MyPage2.aspx">
<frame name="main" src="MyPage3.aspx">
</frameset>
<noframes>
<p>This HTML frameset displays multiple Web pages. To view this frameset, use a Web browser that supports HTML 4.0 and later.</p>
</noframes>
</frameset>
</html>... but where I've indicated the names of pages in bold, you should put the names of your actual pages. The frame named "main" should contain the first ASPX page you wish the application to present, or a blank HTML page, and then hyperlinks in the contents frame pointing to other ASPX pages. 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.
-
helpNeeded wrote: That means i got to put my ascx control into a aspx page before putting in into the frame? Yes. helpNeeded wrote: If my web form is already done but without the frames. Does that means i have to redo the sections on different pages so that i can insert into the different frames? Not sure what you're asking here, but here's what a frames page should look like:
<html>
<head>
<title>Hello!</title>
</head>
<frameset rows="64,*">
<frame name="banner" src="MyPage1.aspx" scrolling="no" noresize>
<frameset cols="150,*">
<frame name="contents" src="MyPage2.aspx">
<frame name="main" src="MyPage3.aspx">
</frameset>
<noframes>
<p>This HTML frameset displays multiple Web pages. To view this frameset, use a Web browser that supports HTML 4.0 and later.</p>
</noframes>
</frameset>
</html>... but where I've indicated the names of pages in bold, you should put the names of your actual pages. The frame named "main" should contain the first ASPX page you wish the application to present, or a blank HTML page, and then hyperlinks in the contents frame pointing to other ASPX pages. 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.
-
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?
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 aDataList
ofLinkButton
s in place of the CheckBoxList, and set the target attribute of eachLinkButton
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 scriptingonClick
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. -
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 aDataList
ofLinkButton
s in place of the CheckBoxList, and set the target attribute of eachLinkButton
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 scriptingonClick
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.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.
-
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.
- 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.
-
- 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.
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?
-
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?
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, bothSystem.Web.UI.WebControls
andSystem.Drawing
, and thus the code is ambiguous as is. TheSystem.Drawing
Image
is abstract (MustInherit
) and leaves the implementation to you, or you must use an existing derived class. TheSystem.Web.UI.WebControls
Image
can be created usingNew
.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.
-
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, bothSystem.Web.UI.WebControls
andSystem.Drawing
, and thus the code is ambiguous as is. TheSystem.Drawing
Image
is abstract (MustInherit
) and leaves the implementation to you, or you must use an existing derived class. TheSystem.Web.UI.WebControls
Image
can be created usingNew
.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.
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?
-
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, bothSystem.Web.UI.WebControls
andSystem.Drawing
, and thus the code is ambiguous as is. TheSystem.Drawing
Image
is abstract (MustInherit
) and leaves the implementation to you, or you must use an existing derived class. TheSystem.Web.UI.WebControls
Image
can be created usingNew
.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.
-
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, bothSystem.Web.UI.WebControls
andSystem.Drawing
, and thus the code is ambiguous as is. TheSystem.Drawing
Image
is abstract (MustInherit
) and leaves the implementation to you, or you must use an existing derived class. TheSystem.Web.UI.WebControls
Image
can be created usingNew
.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.
-
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?
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.
-
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.
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="