ASP.NET Wizard Control inline editing - c#

I have being developing a form with the wizard control. The final step is a summary of the content that has been entered by the user as a confirmation step before submit the form.
These summary sections also catgorised into visual sections that corresponds with the each WizardSteps.
Each summary section is provided with an edit button that should allow user to edit the content then and there and update the content.
However the form should work without javascript so no use of AJAX. I'm not sure how this can be achieved? Is there a way to assign corresponding WizardStep to a placeholder onClick of the "EDIT" button for that summary section or is there any other way to do this?

Personally i would not bother trying to create a website in asp.net were one specification was that it should have to work without javascript. It is possible but your options are very limited. Here is a list of controls that don't work without javascript. I'm afraid wizard is one of them. If you must not use javascript you are going to have to create your own control that mimics what the wizard does but without JS.

Related

Validating Text boxes and drop down lists

I am currently working on a visual studio asp.net website and have a web aspx page with textboxes drop down lists, and a submit button at the bottom of the page. I want the submit button to not function unless all the text boxes are filled and a selection from the drop down menu is made...how can i do this the easiest way possible? I have tried using required field validators and done research still cant seem to achieve this... any help would be great!
I would use for textbox validation Angular and JavaScript which you could integrate with your ASP.NET project. With angular you can use ng-disabled to disabled a button it's very easy.

How to manipulate the order of validation messages using Sitecore Webforms For Markters?

For a project I'm using Sitecore Webforms For Marketers (WFFM). I have created a webform with some custom fieds e.g. required checkbox (created conform the manual, page 19). The manual contains the following note: "In the Web Forms for Marketers module, the Checkbox field does not support the 'required' validation rule". There is also a special field: the captcha field. All fields are required.
Now I have a problem with the order of the validation messages are displayed. If the textbox fields are empty, the required field messages are displayed. After the text fields are filled in and not the checkbox is checked, the checkbox error message is displayed. I want them to be displayed all at once.
Does anyone know how to do that?
Thanks a lot.
Jordy
You can use JQuery to manage this think. If you want I can share some code as well.
Try unchecking client side validation tickbox for each of your fields in Sitecore content tree.
This will allow you to fill in all fields and it will only validate after you have clicked the submit button.
Bit of a stab in the dark, but: Does the custom code you've created to validate your checkbox use only server-side validation?
The last time I encountered a similar issue (where one group of fields were validated first, and then another group were validated later) it wasn't using WFfM, but it turned out that the set of fields being validated first were triggering a client-side validation script. Since these are run in the browser, they always happen before any validation code which runs on the server.
You may be able to fix the problem by getting your custom checkbox field to register a client-side validation script.
Depending on how your custom field is working there are different ways you could make this happen. One pattern would be to create a CustomValidator control which contains both your server-side and client-side validation logic, and add that to your custom field control. MSDN describes the basic process here:
How to: Validate with a Custom Function for ASP.NET Server Controls
An alternative pattern might be to use a more generic approach to registering a block of custom script which gets run when your page renders:
Working with Client-Side Script
And that block could contain script to hook into the validation process.
WFFM have some limitation. You can apply jquery custom validations but that is not good solution. this may be helpful http://petersondave.wordpress.com/tag/web-forms-for-marketers/

How to Create a Multi page form asp.net

I'm fairly new to programming and the .net framework, I'm trying to create a registration page that would require users to move from one step to another. There would be a button at the bottom of each page that takes the user to the next page, however is there a way I can do this without haveing to create multiple pages. I've tried creating multiple forms in the asp.net page but i can't add server controls to the other forms as they don't have the attribute "runat='server'".
Please help, how do i go about it?
Several ways you can accomplish this:
Put each section in its own div and use javascript to show/hide each section
Put each section in its own asp:Panel and show/hide each section on postback
Put each section in its own page and capture postback from previous page on the next page
Use the ASP.NET Wizard control: http://msdn.microsoft.com/en-us/library/w7dyf6b5%28v=vs.100%29.ASPX
Using Jquery you can get multiple page form facility.......
https://www.mindstick.com/forum/33822/how-to-use-jquery-steps-form-in-asp-dot-net

SharePoint 2007 Custom Webpart, saving data to the properties

How can I go about creating a custom Web Part that has a custom UI for editing. When the page is in Edit mode I have a special button show up "Edit" and when the user clicks on it it posts back to the page. I catch this and I want to display a custom UI so they can edit the web part properties. I need to be able to have rich text fields, and text fields that are editable and will post back so I can save them to the properties.
I'm struggling mostly with creating a RichTextField, or TextBox that I can grab the data in post back. I know how to do it if I outputted raw HTML to the page, then use HTTP.Context, but what's the C# way to do it?
Thanks!
You can check in your web part if page is in Edit mode or Display mode and render the controls accordingly.
How to tell if page is in edit mode on a non-publishing site
On postback, you can fetch the values and assign it to your web part properties. Since you are handing it custom, you will need to set dirty flag:
http://msdn.microsoft.com/en-us/library/ms157656.aspx
It sounds like you're putting a configuration UI into the web part itself?
The standard way to provide a configuration UI is via the toolpart - the tall thin window that appears down the right hand side of a page when you edit a web part.
These posts should give you a good introduction :-
How To: Custom Web Part Properties (ToolPart)
Creating a Web Part with a Custom Tool Part
(SharePoint 2003 but still relevant)

what is the best way to design a wizard form in ASP.NET MVC

i want to design a form in asp.net in Wizard style. do something in click next.
the form have 3 step
fill your information
add element [here if you type something wrong then you can edit or delete them before going to next step]
finish
what is the best practise to design this in ASP.NET MVC with a power of ajax.
are anyone show me the best way i can use to do this in MVC
Here's how you could proceed: the elements of each step of the wizard could go into a separate div. The Next and Previous buttons will show/hide the corresponding div. On the last step there will be a submit button which would send the entire form to the server.
You might also take a look at the jquery form wizard plugin.
One of the ways that I have implemented a wizard is to have a separate database table that contains all of the information you are required to store and to save/retrieve data to that table in each step of your wizard - obviously depending on the size and purpose of the wizard this may not be sensible with the number of database calls but I was implementing only a 5 page wizard with maximum 5-10 fields on each page. So when you land on a page you query the database and retrieve the information from the database or if it doesn't exist load a blank page where the user can then enter the information and it is saved when they click either Next or Previous.
For navigating between pages I simply built a helper class that accepted the page name and button type (Next/Previous) and had a simple switch statement which would return the page to navigate to and then used that in a RedirectToAction statement. Again this may not suit a larger application but you could also look at using Windows Workflow (touched on in this article http://www.devx.com/dotnet/Article/29992) as I know that it can be used to create wizard style applications.
It is not particularly an MVC solution but I advise a client-side implementation using JQuery LightBox.
You don't need any client side stuff to achieve this, it's also bad practise to use javascript for anything other than user convenience.
You have 2 problems with a wisard:
1: maintaining state. ie saving data between requests.
2: figuring out which action (usually next or previous) to take.
Maintaining state.
You can use the session object but ideally (and so you can unit test them) all actions should be pure functions. I use hidden inputs to save data between requests.
User actions.
For a next / previous view. Add 2 submit buttons to your form and give them names. When you
POST the form, the button with the none null value was the button pressed. Then redirect to the appropriate action.

Categories