htmlhelper

Html helper for boolean values in asp.net mvc

Are there any html helper methods for displaying boolean values in a dropdown? ...

How to get Html helper code

After many attemps to get Html.ActionLink<> and Html.Image() methods from different assemblies without any success could you help find the source of these methods so that I can use them in my Web app ? Thanks ...

Using ViewModel Pattern with MVC 2 Strongly Typed HTML Helpers

I am working with ASP.NET MVC2 RC and can't figure out how to get the HTML helper, TextBoxfor to work with a ViewModel pattern. When used on an edit page the data is not saved when UpdateModel() is called in the controller. I have taken the following code examples from the NerdDinner application. Edit.aspx <%@ Language="C#" Inherits=...

MVC2: Is there an Html Helper for raw Html?

Is there an Html helper that simply accepts and returns raw html? Rather than do something ugly like this: <% if (Model.Results.Count > 0) { %><h2>Results</h2><% } %> I'd like to do something like this: <% if (Model.Results.Count > 0) { Html.RawHtml("<h2>Results</h2>") } %> Not a whole lot cleaner, but I think it's a bit of an imp...

Display TIFF image in all web browser

How to handle [TIFF][1] file in HTML pages? I want to display a TIFF file in my HTML page. I have tried using embedded tag, object id, img, etc. But I am unable to display the image (TIFF) in the HTML page. I am not using Java, .NET or any other thing in my project. I am using HTML only. # Hi all, To the above question, yesterday ...

Where can i find list of good HTML Helpers to use with asp.net MVC?

As i am new to asp.net MVC and HTML Helpers.. I really want to know Where can i find list of good HTML Helpers to use with asp.net MVC? Additional Info: I would really love to get the list of HTML Helpers used by StackOverflow... If anyone knows can share... ...

Html.Dropdown list events in MVC

Hi all, Can anyone please tell me about - How can i handle Html.DropDown control's events in MVC View? Can I handle it using scripts? And how to know about the selected item? Thanks, kapil ...

Html Attribute for Html.Dropdown

I am using a dropdown list as follows. <%=Html.DropDownList("ddl", ViewData["Available"] as SelectList, new { CssClass = "input-config", onchange = "this.form.submit();" })%> On its selection change I am invoking post action. After the post the same page is shown on which this drop down is present. I want to know about the HTML a...

Navigate() fails on Vista internet Explorer 8 Protected mode

So far, my understanding on Protected mode Vista is: In vista ,by default any process runs in an Limited user Privileged (Protected mode).To run the exe in admin, we need run explicitely using "run as administrator". Any Process (exe) which is launched by other process should run in a same integritylevel or even lesser int...

Deploying ASP.NET MVC App to Multiple Virtual Directories (Issues with URL references & JS files)

Hi Guys I'm not sure if I have my question named correctly but here's the issue: I have an MVC.NET app that is deployed at multiple virtual directories. The reason for this is because we have different versions under various stages of QA. The problem with this is that in one site the .js references are for /VirtualDir/scripts/fi...

Passing Collection to MVC.NET HtmlHelpers More Efficiently? Suggestions?

Hi all I have a Html helper method with the following signature: public static string MyActionLink(this HtmlHelper html , string linkText , List<KeyValuePair<string, object>> attributePairs , bool adminLink){} I have another utility then that takes all the attribute pairs and merges them to the tag as attribute/value pairs: Extensio...

Sending an anonymous type with RenderPartial

I am trying to send an anonymous type with RenderPartial but this method only allows me to send (string, object , viewDataDictionary) or (string) or (string, object). I am using MVC 1.0. Is there something I am missing here ? Here is what I am trying to get workijng : <% Html.RenderPartial("ProductDisplay", product, new { DisplayAddTo...

ASP.NET MVC 2 Data annotations in a dynamically generated model

Hello everyone, I am creating an asp.net mvc 2 application generating my view model dynamically depending on user input. Simply put, the user is able to choose which fields he wants to see in his View. Since the templated helpers rely heavily on model properties and attributes (data annotations), I would need to somehow add the attribu...

Bug? Client-side validation in ASP.NET MVC 2 causes ValidationSummary message to show even if there is no error

With client-side validation turned on in ASP.NET MVC 2 RC2, the validation summary message is visible even when I first load my Edit.aspx page. It does not show in bold red, however, just plain text. If I submit the form with an error, then the validation summary message turns bold red, and a list of errors appears below. Here is the co...

Rails image_tag not closing image tag

On a rails project I am using the image_tag to generate my image html elements. <%= image_tag("test.jpg", :alt => "test image") %> is generating <img src="test.jpg" alt="test image"> This is happening throughout my entire rails project. Is there a setting somewhere that someone else set that is causing this? How can I get rails ...

ASP.NET MVC 2 - Html.DropDownListFor confusion with ViewModel

I'm getting totally lost and confused on how to use the new strongly typed Html.DropDownListFor helper on ASP.NET MVC 2.0 R2 In the View I'm writting: <%= Html.DropDownListFor(m => m.ParentCategory, new SelectList(Model.Categories, "CategoryId", "Name", Model.ParentCategory), "[ None ]")%> <%= Html.ValidationMessageFor(m => m.ParentCa...

How can I get the post or get state inside the htmlHelper in ASP.NET MVC?

Hi, I am trying to get whether it is a post or get in the htmlhelper as i am building an validationsummary extension and I only want it to run when the form is posted? Any ideas? currently what I've got is this and it works well but it runs every time the page is loaded StringBuilder sb = new StringBuilder(); sb.Append("<scr...

AutoPostback from Html.Listbox in ASP.NET MVC?

Now, i may very well just be being incredibly thick, but I'm struggling to find how to do autopostback with a Html.Listbox in ASP.NET MVC 1. What I'm trying to achieve is just a simple if value of ListBox1 is x then the values in ListBox2 are y, if I change the value in ListBox1 to z then I want the values of ListBox2 to change based of...

ASP.NET MVC: Render checkbox list from MultiSelectList

How do you associate a MultiSelectList with a list of checkboxes? eg. I pass something like this to the model model.Groups = new MultiSelectList(k.Groups, "Id", "Name", selectedGroups) How should I render it? This doesn't work <% foreach (var item in Model.Groups.Items) { %> <input type="checkbox" name="groups" value="<%=item.Va...

Calling Html.ActionLink in a custom HTML helper

I am designing a custom HTML helper and I would like to execute Html.ActionLink to provide dynamic URL generation. namespace MagieMVC.Helpers { public static class HtmlHelperExtension { public static string LinkTable(this HtmlHelper helper, List<Method> items) { string resu...