I am working on MVC with C#.
I have 2 radio buttons. On selecting first radio button, a textbox will be shown which allows to enter date values.
<%= Html.TextBox("ReceivedDate")%>
on selecting the second radio button, the textbox gets hidden.
For the first time, when i select first radio button and entered date and clicked N...
Trying to debug into ASP.NET MVC 1.0 source, I followed instructions like these, basically remove reference to system.web.mvc from my web project and add the source project I downloaded instead.
Now, I have this problem,
The type 'System.Web.Mvc.FormMethod'
exists in both
'c:\Windows\assembly\GAC_MSIL\System.Web.Mvc\1.0.0.0__31b...
I am wondering if there are any known issues with adding a ViewUserControl at run time (to a ViewPage). It works fine if I add the control declaritively but not if I add the control programmatically (in the code behind file in this case). I don't get an error, it just does not render the control but stepping through the debugger does con...
I am having a minor issue playing with my exported Crystal Report, I can generate the reports just fine on our website, however when I attempt to export them to Word documents I don't quite get a document I can do much with.
i.e.:
I can't position the generated text anywhere in the document, it is almost 'frozen' in place. I would ex...
I have an MVC route like this www.example.com/Find?Key= with the Key being a Base64 string. The problem is that the Base64 string sometimes has a trailing equal sign (=) such as "huhsdfjbsdf2394=".
When that happens, for some reason my route doesn't get hit anymore.
What should I do to resolve this?
My route:
routes.MapRoute(
"...
I am looking for some guidance on how to incorporate business rules into an asp.net mvc application and how they relate to the model.
First a little background so we know what kind of solutions are relative for this question. At work we use WinForms, MVP, BusinessObjects, DataAccessObjects, and DataTransferObjects. The boundaries of...
In our ASP.NET MVC application, we automatically redirect users to a log-on page via the <authentication> section of <system.web> when they attempt to access an authorized-only page. The problem is that one action in the middle of the application, designed to be used by a tool, needs to return a straight-up HTTP 401 response on bad acce...
We are planning to use ASP.NET MVC on a relatively important (to the business) project. The development team comprises 4 developers and a Technical Lead. 2 of the devs and the Tech Lead have worked together before on ASP.NET WebForms project and are confident using that technology.
We cringe a little when we look back at some of the app...
What kind of naming convention is appropriate for ViewModel classes?
Example: for HomeController, Index view? HomeIndexViewData doesn't seem right.
...
How would you push strongly typed information in MVC to the master page? Would you have a ViewModelBase class that contains master page information and inherit from it for every view model, or is there a better approach?
Thanks :)
...
I am trying to reference the jQuery library in my master page like so:
src="<%= ResolveUrl("~/Scripts/jquery-1.2.6.js")%>" type="text/javascript">
The source for the page shows:
<script src="/DocumentManagement/Scripts/jquery-1.2.6.js" type="text/javascript"></script>
which seems to be correct since my site's url is http://servern...
What is the difference between <%# and <%= in ASPX inline code?
...
I see endless examples that involve "Url.Action" in a view to generate a URL dynamically. (See example code below.)
The problem: The type/class "Url" doesn't exist in my views! No IntelliSense, and compiling the site results in a "Type expected" exception. How do I get it in there?
Source Code Snippet (this is from an example):
<form...
I'm building a data entry interface and have successfully bound the columns that have reference tables for their data using DropDownList so the user selects from the pre-configured values.
My problem now is that I don't want the first value to be selected by default, I need to force the user to select a value from the list to avoid erro...
I would like to do the following (Pseudo Code):
[InternalOnly]
public ActionResult InternalMethod()
{ //magic }
The "InternalOnly" attribute is for methods that should check the HttpContext request IP for a known value before doing anything else.
How would I go about creating this "InternalOnly" attribute?
...
I have a nested data object for a set of items within categories. Each category can contain sub categories and there is no set limit to the depth of sub categories. (A file system would have a similar structure.) It looks something like this:
class category
{
public int id;
public string name;
public IQueryable<category> cat...
My opinion is it does and it doesn't.
It does separate logic and data from UI, but it still crams it all together into a single point application.
That's why I think it doesn't really, because Controllers are business logic, Views are UI, Models are DAL. These are now just layers within the same app.
But are layers supposed to be the...
Hello,
I have the following problem:
public Boolean Exists(String userName)
{
IRepository<User> = new UserRepository();
User user = userRepository.First(u => u.Name == userName);
if (user == null) return false;
// Exists!
return true;
}
The problem is now, that I can't check the User object for null. Before I...
I'm trying to route a path like this:
http://www.wikipediamaze.com/wiki/Washington,_D.C.
The routing framework is not picking this up as a valid route and giving me a "Cannot find resource" error. Anyone know how I can get around this? It's not even getting to my controller factory so it's as if it doesn't even recognize it as a route...
I have a simple ASP.NET MVC 1.0 site w/ Home, Upload, and About links based upon the default project template for an ASP.NET MVC Project. The Global.asax.cs has the following route.
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", ...