Using Mooncake Template - asp.net

Here is the Mooncake template link: Mooncake template. Has anyone ever used it? I'm trying to apply this template to my ASP.NET website, using ASP.NET controls, but I have some problems about this.
First, in the Forget password menu, when a user clicks the Reset button, it will post back to the server and do some validations. If it doesn't pass the validations, the form will be displayed again with error messages. The problem is when the page reloads, it changes back to the default view, which is Login menu, so I have to change to Forget password menu to see the error messages. How can I make it display Forget password menu directly?
The second thing is how can I apply table format to my grid view? The column of a table in this template can be sorted without posting back by clicking on the header.
Any of your help will be highly appreciated. Thanks in advance :)

Related

Create sign out button in master page in ASP.Net

I am trying to create a master page with a sign out button. And to clear session on sign out button, I need to wrap that button in a form tag. Pretty straight forward, right?
Problem is that the content page will have their own form tag as well. So, application crashes saying "page can have only one form".
Now, I need to figure out a way to have that sign out button make a server side call without using form tag. How can I achieve this?
As of now, I have two ideas in mind. First is to redirect to an intermediary log out page. Second is to wrap the whole master page in a form, so content page will never need a form tag. Is there a better way to acheive this?

Ruby-on-Rails toggleable sidebar to edit particular item of list

I have a table displaying a collection of cards, one card per row. When I click on a particular row, I get redirected to the page where I can edit this card. I would like to edit them in a toggleable sidebar, which would appear on the right of my table of tasks. I have a menu on the other side, also toggleable and designed in my application layout, and I tried to reproduce and customize it inside of the cards' index view, but it didn't work.
First, would I do that with a modal, or an actual sidebar ? How to change the content dynamically, according to the parameters, should it contain a partial ?
I am a bit lost on the way to do it, if anyone has ever done something similar or could help me, I would really appreciate.
You can make a partial that contains the usual form_for element, with the right text boxes and error messages and so on. But in the index controller action for this page (I assume it's something like cards_controller#index), you'll need to set up an instance variable with the empty model for the form_for to use.
Then you'll need to decide how the card will be submitted. If you're okay with a page reload, it can submit to the cards_controller#create or cards_controller#update actions... but those actions will want to redirect back to the index view if successful. It may be easier with an AJAX request. You'll have the form submit back to the same actions, but use a respond_to block. When the request is a json type, submit the right status code, and respond on the page appropriately.
Good luck!

add "back" button to a form in ploneformgen

I have a multipage form in Plone using ploneformgen. I would like the user to be able to navigate back with a back button. Can someone please point how can I add a back button to my form?
I don't think there's a trivial way to do this in PFG, but you could use http://plone.org/products/collective.z3cform.wizard. Warning: this is not point-and-click configuration.

Input buttons as links?

Is their a case for using input buttons as page links, when your linking to the next of a series of pages of a form where your filling out information?
UPDATE - Ive inherited a site. One section is a series of pages of forms that users fill in. The 'next' link to the next page is currently an input button, not a normal link.
Is this bad from a standards / semantics point of view?
I am not sure what you exactly want. But what about, you can use the button to navigate through the pages. Just put the url address of the next page.
<form action="page_number_2.htm">
But you will need to store formulat data from every page. I mean, if the user fill the formular on one page and go to the next formular, you don't want to lose the data from the filled formular. You can stored them with php until the user will reach the final formular step, where he will klick submit-button.
Actually the link is used for navigation through the pages. But in this case, if I understand right, you need to send data from formular, if the user go to the next formular. So in this case, better to use button. Still you can make this button look like link.
It is possible to make links appear as buttons. However, in the situation you describe, it would be a bad idea. The form data will only be submitted to your server if you use a form. Allowing the user to click a link to go to the next page will cause you to lose all of the data they entered (Unless you are collecting that data via AJAX).
It is usually best to allow page element to perform the functions they were designed for to avoid confusing your users. Users expects links to work like links, and buttons to work like buttons.

Running code/script as a result of a form submission in ASP.NET

An outside vendor did some html work for us, and I'm filling in the actual functionality. I have an issue that I need help with.
He created a simple html page that is opened as a modal pop-up. It contains a form with a few input fields and a submit button. On submitting, an email should be sent using info from the input fields.
I turned his simple html page into a simple aspx page, added runat=server to the form, and added the c# code inside script tags to create and send the email.
It technically works but has a big issue. After the information is submitted and the email is sent, the page (which is supposed to just be a modal pop-up type thing) gets reloaded, but it is now no longer a pop-up. It's reloaded as a standalone page.
So I'm trying to find out if there is a way to get the form to just execute those few lines of c# code on submission without reloading the form. I'm somewhat aware of cgi scripts, but from what I've read, that can be buggy with IIS and all. Plus I'd like to think I could get these few lines of code to run without creating a separate executable.
Any help is greatly appreciated.
If you don't want the page to reload after submission, you will need to use AJAX. that is alot more complicated. you would still need the submit.aspx, you cannot send email with javascript.
Code a redirect after the form submission, so instead of getting the same form back in the main document/page, you could get something like a blank page saying "Thanks for your submission!" or something of that nature.
Might be more simple to redirect the user to a result page using Respone.Redirect that displays some sort of "Your email has been sent" message, or even just redirect back to the base page.

Resources