Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8391387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:14:51+00:00 2026-06-09T19:14:51+00:00

i have the following situation. I am developing a MVC 3 asp.net application. I

  • 0

i have the following situation.

I am developing a MVC 3 asp.net application. I want to make a searh form with datetime range filter. I wan to use a datepicker so the user can select the date range.
I have followed this mvc tutorial

http://www.asp.net/mvc/tutorials/javascript/using-the-html5-and-jquery-ui-datepicker-popup-calendar-with-aspnet-mvc/using-the-html5-and-jquery-ui-datepicker-popup-calendar-with-aspnet-mvc-part-4

My problem is that i can not get to link the editor template to a NON MODEL @editotfor or input or @textbox, i`ll put some code so you get my point.

I have the following EditorTemplate in my Shared folder (file Date.cshtml)

@model DateTime
Using Date Template
@Html.TextBox(“”, String.Format(“{0:d}”, Model.ToShortDateString()),
new { @class = “datefield”, type = “date” })

if I use this line in my view everything works

@Html.EditorFor(m => m.fecha_Modificacion,”Date”)

But i want to use the datepicker in a NON model value just a simpletextbox textbox
I have been trying this :

@Html.TextBox(“fechaInicio”, “”, new { @class = “datefield” })

But not working
I´d apreciate any help

UPDATE

I must explain my problem in more detail
I have a

class Foo{

   private stirng name;
   private DateTime dateOfBirthday;
}

In the Foo view i am editing the list.cshtml so i can searh by dateOfBirthday by from to.
So i want to make two textBoxes so the user can select with a date time picker the from anf to date range.
I´d like to use a template so i can re-use it.
But the list.cshtml view is already typed to @Model Foo
but the two textboxes are not model fields

The EditTemplate i have made work perfectly on model typed @EditorFor filds so i am trying to use on my from to date range textboxes

For what i have read i can create a EditorTemplate but that does not mean that i use everywhere i can use just where i want

Thank you very much

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T19:14:53+00:00Added an answer on June 9, 2026 at 7:14 pm

    De solution proposed by rcdmk did the work.
    I think that polutae a class for search porposes is the right way to do it.
    I think that working with ASP.net MVC we must use string typed views as Display Name pointed.
    Thank you for your help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following situation: I'm developing an address-application to store the details of our
I am developing an ASP.NET MVC 3 web application using Razor and C#. I
I have following situation in a C# Windows Forms (.NET 4.0) application: I have
I have following Situation, Server A sends some data (HTML form) to server B,
I have the following situation. We want an reputation table to evaluate Users And
I have following situation: I use Struts2 as MVC cobtroller I use Spring as
Here's the situation: I'm developing a simple application with the following structure: FormMain (startup
I have the following situation: I built an Access form with a subform (which
I have the following situation: A user will define a certain filter on a
I have the following situation: I am using a third party .net library which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.