I am using one form tag in my master template. However I have content panels that pull in html into a sidebar. This concept from the Standard Website Starter Kit by Chris Koiak.
OK.
So the buttons all work fine in the main content panel but the sidbar content panels do not show buttons etc. This is because the content sidebar panels are just straight html without Head or Body tags associated so they are not picking up the form tag and cannot run the controls.
So the question is how do I get around this. I can only have one form tag but I need to get objects that post, going on the sidebar too.
I cannot inherit from my master page, else I get all the markup from that template (which I don't want, just the html).
I cannot add another form tag in the sidebarcontent panel else I get "The state information is invalid for this page and might be corrupted." error.
I am a bit stuck resolving this one.
I have tried breaking down the master pages into smaller sections and inheriting just the previous form but I am also inheriting the head and body tags which is also causing issues.
Coud you perhaps post some of the code from your template?
I think it will be a bit easier to help you out if you post this. But I guess it's becaue you have all your content in a server-side form right? <form runat="server">...
So I guess the real issue is that when you submit a form it's the form in your center-content that gets submitted no matter, which form you submit. Right?
Which looks at the object called ContentPanels in the currentpage which is associated at the document type with the template called "ContentPanel" which runs this:
The content panel is not a subordinate of the main master template
Any html in the directory "ContentPanels" that are selected (to be shown in the settings of the page) will be rendered with the main master template (with the form). However selected panels with ASP:Button & Label objects do not render properly unless I manually wrap a form tag around them. In which case they do render but other objects on the page complain of a corruption of state and duplicate form tag.
And a little confusing as well (But sometimes it can be hard to get what others are thinking 100%, right :))
Is the serverside form needed in order for your page to work? If not then you should remove it and then you can use as many <form> elements you can fancy. But I guess it's probably not that simple in this case?
Otherwise I guess you could use a fieldset to wrap around your input fields from the different panels perhaps? There is a good guide on how to do that and make the keypress event trigger the correct "form" - I guess you need to make an onclick event listener as well if I do remember correctly. http://beardscratchers.com/journal/fixing-the-enter-keypress-event-in-aspnet-with-jquery
Thanks for the article.It seems a backward to ditch asp controls and return to the fieldset and input controls.
The master page form is there to handle actions that require post back events and there could be many of them on a single page. Would muliple form cause a Multiple Forms error?
HTML <Form> problem.
I have a problem with the good old form tag.
I am using one form tag in my master template. However I have content panels that pull in html into a sidebar. This concept from the Standard Website Starter Kit by Chris Koiak.
OK.
So the buttons all work fine in the main content panel but the sidbar content panels do not show buttons etc. This is because the content sidebar panels are just straight html without Head or Body tags associated so they are not picking up the form tag and cannot run the controls.
So the question is how do I get around this. I can only have one form tag but I need to get objects that post, going on the sidebar too.
I cannot inherit from my master page, else I get all the markup from that template (which I don't want, just the html).
I cannot add another form tag in the sidebarcontent panel else I get "The state information is invalid for this page and might be corrupted." error.
I am a bit stuck resolving this one.
I have tried breaking down the master pages into smaller sections and inheriting just the previous form but I am also inheriting the head and body tags which is also causing issues.
Any ideas
Hi Streety
Coud you perhaps post some of the code from your template?
I think it will be a bit easier to help you out if you post this. But I guess it's becaue you have all your content in a server-side form right? <form runat="server">...
So I guess the real issue is that when you submit a form it's the form in your center-content that gets submitted no matter, which form you submit. Right?
/Jan
Well the master template is as you would expect a html page to look like with a form tag below the body (no scriptmanager).
The ContentSide placeholder runs an XSLT called SidePanels
Which looks at the object called ContentPanels in the currentpage which is associated at the document type with the template called "ContentPanel" which runs this:
This is the interesting bit.
The content panel is not a subordinate of the main master template
Any html in the directory "ContentPanels" that are selected (to be shown in the settings of the page) will be rendered with the main master template (with the form). However selected panels with ASP:Button & Label objects do not render properly unless I manually wrap a form tag around them. In which case they do render but other objects on the page complain of a corruption of state and duplicate form tag.
Sorry a long post.
Hi Streety...
And a little confusing as well (But sometimes it can be hard to get what others are thinking 100%, right :))
Is the serverside form needed in order for your page to work? If not then you should remove it and then you can use as many <form> elements you can fancy. But I guess it's probably not that simple in this case?
Otherwise I guess you could use a fieldset to wrap around your input fields from the different panels perhaps? There is a good guide on how to do that and make the keypress event trigger the correct "form" - I guess you need to make an onclick event listener as well if I do remember correctly. http://beardscratchers.com/journal/fixing-the-enter-keypress-event-in-aspnet-with-jquery
Hope this helps...
/Jan
Thanks for the article.It seems a backward to ditch asp controls and return to the fieldset and input controls.
The master page form is there to handle actions that require post back events and there could be many of them on a single page. Would muliple form cause a Multiple Forms error?
I'll look into this.
Thanks Jan
Hi Streety
Well, it's the joy of working with web forms I guess.
But if the panel content comes from a user control you should be able to group it correctly so the correct form is triggered on submit.
/Jan
is working on a reply...