---
title: "Keeping values on form after submition"  
description: "Keeping values on form after submition"  
author: "Jayden Bell"  
published: 2014-08-27  
updated: 2014-08-27  
canonical: https://www.mindstick.com/forum/2172/keeping-values-on-form-after-submition  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# Keeping values on form after submition

I'm trying to keep the entered data in the form after submitting by using "value=..."

I'm getting a [compilation error](https://www.mindstick.com/forum/159699/what-is-a-compilation-error-in-dot-net-core-explain-with-an-example) on the following code:

```
<form id="myform">           <input id="hour" type="text" name="hour"
value="<%=hour%>" style="width:30px;text-align:center;" /> :           <input id="minute" type="text" name="minute" value="<%=minute%>" style="width:30px;
text-align:center;" />           <br/>           <input type="submit" value="Validate!" /></form>
```

the error is : Description: An error occurred during the compilation of a [resource](https://www.mindstick.com/blog/43433/top-best-resources-for-women-about-beauty-and-health) [required](https://www.mindstick.com/forum/160269/what-is-required-data-annotation-how-does-it-affect-model-validation) to [service](https://www.mindstick.com/articles/105963/online-thesis-writing-service-for-college-kids-with-disabilities) this request. Please review the following [specific error](https://www.mindstick.com/forum/160112/how-to-create-custom-exceptions-in-dot-net-core-for-more-specific-error-handling-scenarios) details and modify your [source code](https://www.mindstick.com/forum/33476/pls-send-me-source-code-for-changing-passward-in-asp-dot-net-i-tried-so-much-from-google-but-its-not-workining) appropriately.

[Compiler](https://www.mindstick.com/articles/27/just-in-time-compiler) [Error Message](https://www.mindstick.com/forum/23174/error-message-the-page-you-are-requesting-cannot-be-served-because-of-the-extension-configuration): CS0103: The name 'hour' does not exist in the current [context](https://www.mindstick.com/forum/23245/what-is-context-in-android)

any solution? thanks a lot in advance

## Replies

### Reply by Sumit Kesarwani

Hi jayden,

Action for submit must have parameter which have name like name of control on view or a model have property like name of control.

```
public ActionResult acTest(string hour, string minute){ ... }Orpublic ActionResult acTest(iTime md){ ... }public class iTime{   public string hour{get;set;}   public string minute{get;set;}}
```


---

Original Source: https://www.mindstick.com/forum/2172/keeping-values-on-form-after-submition

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
