Multiple Pages Displayed Using Select Case

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Multiple Pages Displayed Using Select Case

RunningBeare

Dean,

I am writting a site where authors upload their manuscripts, the submission is split over a number of pages all held in one page called submission.aspx I then display the desired page by using the querystring and a select case.

Unfortunately I'm getting some minor errors with IE when loading non upload related pages. Details below -

Object Required
function NeatUpload_AddHandler(id, eventName, handler)
{
 var elem = document.getElementById(id);
 if (elem.addEventListener)


----------------------------------------------------------------------------------------

Document.getElementbyId(...) is null or not an object
document.getElementById('frmUpload').onsubmit
 = NeatUpload_CombineHandlers(document.getElementById('frmUpload').onsubmit, NeatUpload_OnSubmitForm_frmUpload);

----------------------------------------------------------------------------------------

Object Required
function NeatUpload_AddSubmitHandler(formID, isPopup, handler)
{
 var elem = document.getElementById(formID);

I know that this is because required upload stuff isn't being loaded, is there a way to stop this from happening?

The obvious solution is to split the upload page out, but I'd rather not do that.

Cheers Al

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple Pages Displayed Using Select Case

Dean Brettle
Administrator
Hi Al,

I'm not sure exactly what you mean by "a number of pages all held in one page".  Do you mean you have multiple <form> elements and set Visible=false on all but the desired one?  If you can send me (dean at brettle dot com) submission.aspx and it's codebehind I'm sure it will be clear what's going on.  If you are using multiple <form> elements, I might be able to change NeatUpload to deal with that.  Alternatively, you might be able to workaround the issue by using one <form> element with multiple <div> elements (with all but one <div> hidden).

--Dean

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple Pages Displayed Using Select Case

RunningBeare

Dean,

It's one page but I use a select case and the query string to determine which part or portion of the page to display
at the moment I have three forms with unique names, but only one is ever displayed
An email is winging it's way to you.
Cheers Al
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple Pages Displayed Using Select Case

Dean Brettle
Administrator
Thanks for the files.  I think the problem is that you're SELECT is inlined in your aspx.  That means that it is effectively inside your page's Render() method.  NeatUpload registers the javascript to be inserted into the page during the PreRender phase.  My understanding is that is the correct place to do that.  Since the scripts are registered before Render() is called, NeatUpload doesn't know which of your forms will actually be present.

I recommend removing the SELECT code from your aspx, and instead doing something like this in your codebehind class (untested):

...
    Protected WithEvents frmpage1 As System.Web.UI.HtmlControls.HtmlForm
    Protected WithEvents frmUpload As System.Web.UI.HtmlControls.HtmlForm
    Protected WithEvents frmPage3 As System.Web.UI.HtmlControls.HtmlForm
...
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.frmpage1.Visible = False
        Me.frmUpload.Visible = False
        Me.frmPage3.Visible = False
        Select Case Request.QueryString("page")

            Case Is = 1, ""
                Me.frmpage1.Visible = True
            Case Is = 2

                Me.frmUpload.Visible = True
            Case Is = 3
                Me.frmPage3.Visible = True
        End Select
...

I think that will work because PreRender is not called for controls that are not Visible (either because they or a containing control has Visible=false).

Hope that helps,

--Dean

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple Pages Displayed Using Select Case

RunningBeare

Dean,

Nice one that seems to work perfectly.

Think I'm ready to start integrating this into my site now

Thanks a bunch!

Cheers Al

Loading...