Forum Array

MVC :: How To Return Unencoded HTML To A Razor View

 HtmlHelperExtensions in MVC2 return a HTML string, unencoded. In MVC3 this string is encoded! How can I return unencoded HTML to a Razor view in MVC3? 

View Answers

Very Similar Questions

Can Assign HTML Values In MVC View Using HTML Helpers
stackoverflow.com
is this right? i am trying to display value in input box dynamically? can anyone advice me is this corect approach? but still I am getting here only + + in input box?

MVC :: Can't See Model And Html Helpers On View Page
forums.asp.net
i wrote mvc 2 application with target framework asp.net 4.0 but my hosting provider supports asp.net 3.5. then i set my project's target framework to 3.5 and i compiled successfully on localhost but when i run the application it says me: Server Error in '/' application Parser Error Message: Could not load type 'System.Web.Mvc.ViewPage<MvcApplication1.Models.xxx>'. Source Error: Line 1:  <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MvcApplication1.Models.xxx>" %> and visual studio can't see Model and html helpers on view pages.

MVC :: Return A View Of A Different Controller?
forums.asp.net
I came upon this when had problem trying to return a view of a different controller.  In controller1, I have view view1. In Action1 of controller2, I wanted to do something like: public ViewResult Action1() { return View("/Controller1/View1"); } but, found out, I couldn't do it.  So I searched and found this:[URL] One guy there responded and said that, for my case, it is possible to do things like below: return View("~/Views/Controller1/View1.aspx"); this is considered an acceptable MVC practice.  Is it OK, good, perfect to do so in the asp.net MVC realm? 

MVC :: "System.Web.Mvc.Html.MvcForm" In The Top Of Page / How To Remove This
forums.asp.net
on my MVC webforms there is a text in the top of the form as "System.Web.Mvc.Html.MvcForm". how can i remove this?

MVC 3 RC Html.Actionlink Not Generating Link
stackoverflow.com
I have a route (the first one listed) which looks like this: routes.MapRoute( "TopicRoute", // Route name "forums/{forumSlug}/{topicSlug}", // URL with parameters new { controller = "Forums", action = "Topic"} // Parameter defaults ); I can browse to: /forums/my-forum/my-topic and the page loads fine. Yet I have a Html.ActionLink that looks like: @Html.ActionLink(item.Title, "Topic", new { forumSlug ="my-forum", topicSlug = "my-topic" }) And it won't generate the correct link syntax for me? It generates: <a href="">My Topic</a>

MVC :: Simple Html Link To Another Page?
forums.asp.net
I have created a new ASP.Net MVC 2.0 project.When I open the Site.Master and look at the navigation you have the following: [Code].... When clicking the link, it gives me a 404 file not found and my URL is the following: http://localhost:2053/Services.aspxHow can I create 4 simple html link that has the href property pointing to my 4 files inside my

MVC :: Html.action Link Cant Find Page?
forums.asp.net
Ive been moving my site using forms over to MVC and have 2 html.action links in the default.master to MVC pages in the in the home folder that work just fine but when i add another mvc page in the home folder named links.aspx the application cant find the page from the html actionlink [Code].... there are no differences i can see in the pages that do show up and the one that cant be found (links.aspx). there is no difference in the way ive written the link in the master.   I need about 6 or 7 of these links on the master to pages in the home folder.

Shared Hosting And Model-View-Controller (MVC) Support
www.webhostingtalk.com
if anyone knows of any shared hosting company that supports the out-of-the-box Model-View-Controller (MVC) asp.net template and which version (the latest at the moment is Preview 5). Moreover, does it support .net 3.5 with sp1, IIS7, SQL 2005 and ajax control tookit?

MVC :: How To Disable The Html.ActionLink() After Clicking On It
forums.asp.net
I need to disable the Html.ActionLink() after clicking on it. Means i want to populate all the records from database after clicking on link but after populating hat link should be disabled.

Web Forms :: Is Possible To Use The Mvc HTML Helpers
forums.asp.net
I have been using web forms and I have been let down by them. I hate the way it mangles my element id's and names. I want to have full control over my html and have the ability to have multiple forms on one page.  I do not use view state or post backs. All my server communication is done using JQuery ajax and sometimes page methods.  My pages do not make use of any runat=server controls other than occasionally using the repeater.  For now I have been using inline code like the following but I like the mvc html helpers. EXAMPLE: [Code].... At the moment, using the asp.net mvc framework is not an option but I would like to use the HTML helpers in my asp.net application. Is this possible to use the mvc html helpers or do I have to create my ow helpers?

MVC :: Using HTML Helpers To Render?
forums.asp.net
I created an HTML helper that renders the <tr> tag, with special attributes depending on some view logic. The problem is, my HTML complains in design-time because "td cannot be nested within table." Obviously, the HTML can't see that, at run time, the proper <tr> tags will be there. This isn't a real problem, so much as an annoyance. I was just wondering if there's standards for dealing with this. I see a few options: Use HtmlHelpers to render my <table> and <td> tags also.Keep the actual <tr> tag in HTML, and change my helper so it just returns the part of the <tr> that might change (the attributes).Don't worry about it, because the HTML ends up looking fine at run-time.Move the entire table structure, including the foreach statement that loops through my model and creates the table rows, all inside a much larger HtmlHelper. This would basically be re-creating the ASP datagrid control. I know that any of these would work, but I'm wondering if theres a best practice for this in MVC, or a general standard for how view should be implemented, and how to decide how much logic to put in the HtmlHelper verses the View itself. Obviously option 4 would lead to the cleanest looking View, but you'd end up with something that looks very similar to a WebForms .aspx page, where you have to look at another file to see what HTML will actually be output when the page renders.

MVC :: HTML Helpers Does Not Render ID?
forums.asp.net
I just upgraded my mvc 1.0 project to 2.0 using the wizard. My project builds fine however, my html helpers that I have used, does not render the input's ID tag. For some reason, only some controls render and some do not. For example: [code].... I thought it had to do with the fact that the value is empty, but from the two examples, they are nearly identical. Is this a bug? All was working before I upgraded.

MVC :: Applying CSS / Styles To HTML Helpers?
forums.asp.net
So, most of the MVC examples I find are C#,  so I seem to have trouble finding samples ....(bear with me, I'm a newbie)  with that said, if anyone can point me in the right direction, I simply want to be able to apply htmlattributes / styles to my select box [Code]....

MVC :: 2 Strongly Typed Html Helpers Css?
forums.asp.net
How can I use css and other attributes such max length with the strongly typed views  ?

MVC :: Finding Websites That Have Custom HTML Helpers
forums.asp.net
I am wondering if there are any sites out there that list custom html helpers people have currently made to extend on to the ones that MVC already providers. I tried to do a google search but I just keep getting tutorials about how to make them.

MVC :: Access Html Helpers TextBox And Attributes?
forums.asp.net
i used Html Helpers TextBox like this <%= Html.TextBoxFor(model => model.Password)%> now have can i access to attributes i need to enable=false that control.

MVC :: How To Create Custom HTML Helpers And Templates
forums.asp.net
If I wanted to create a custom HTML helper and take advantage of the new in-built templating feature, how would I do that?  It appears the templating features are internal?

MVC :: Razor: Referencing Declarative Html Helpers?
forums.asp.net
I'm trying to write a simple declarative html helper: [Code].... The helper works fine if I embed it into the page I want to use it on. But if I move it to a separate .cshtml file and place that file in the ~/Views/Helpers directory, my view can't be compiled anymore because the helper is not found.According to Scott Gu's blog article on Razor it should work. The only workaround I have found so far is placing the Html helper in App_Code and Referencing it as @[MYHTMLHELPERFILENAME].Echo(...) . This works but is a bit messy since I don't want to repeat the name of my extension method (Echo.Echo("inputstring"), nor do I want to put all of my html helpers into one single file (something like MyHtmlHelpers.cshtml).It certainly isn't what Scott announced either, so I guess I must be doing something wrong.

MVC :: Creating HTML Helpers With Extension Methods?
forums.asp.net
namespace MvcLogin_Validation.Helpers { public static class LabelExtensions [code]...

MVC :: RouteValueDictionary For HtmlAttributes In HTML Helpers - Finding Alternative
forums.asp.net
 MVC 1.0 source has code like [Code].... Was RouteValueDictionary intended for use with htmlAttributes? Is there an alternative? The only 'feature' RouteValueDictionary looks like its got is it has a constructor which accepts an object. What should I be using in custom helpers?

MVC :: Html Helpers / User Controls Dependency Injection?
forums.asp.net
I've just started wokring with Asp.Net mvc and i relay love it. One thing I don't know how to do it yet is: If I want to develope a new user control (e. g. PeoplePicker) how I get the data? I don't want to use allways ajax requests, some controls should be initialized when the page is loaded. So I could use the Html Helpers and create own extension. So far this is exactly what i want and it's working. But now to the real problem. I can't use dependency injection in extension methods (I'm using spring.net, but the problem should be in all di frameworks). So which approche is the most common to use this problem? Must I realy pass in the data from my controller? But then the controller must know how my user controls works, I don't want that!

MVC :: Customize Razor Scaffolding Template Or HTML Helpers?
forums.asp.net
I don't know if this is possible but I would like to customize some of the HTML helpers autogenerated in the template. For example, I would like to replace the  LabelFor with something that will allow me to specify an image with the label and also a ToolTip property so when you hover over the label you get the tool tip.

MVC :: Do 2 Strongly Typed Html Helpers Ignore The DisplayFormat Attribute
forums.asp.net
I am using the MetaDataType DataAnnotation to validate my models in an MVC2 application. I also apply the DisplayFormat annotation so that currencies and dates are formatted the way I want. This method works for the original Html Helpers such as : [Code].... When I used the new strongly typed helpers: [Code].... the formatting never gets applied. Is there a way around this?

MVC :: System.EntryPointNotFoundException: Entry Point Was Not Found / Unit Testing Html Helpers
forums.asp.net
I'm trying to unit test a very simple html helper but keep getting the following exception: System.EntryPointNotFoundException: Entry point was not found. public static string AdditionalUsersDropDownList( this HtmlHelper helper, int additionalUsers ) { Dictionary<int, string> items = new Dictionary<int, string>( ); items.Add( 0, "None" ); for ( int i = 1; i <= 30; i++ ) { items.Add( i, i.ToString( ) ); } SelectList list =  new SelectList( items, "Key", "Value", additionalUsers ); return helper.DropDownList( "AdditionalUsers", list ); } public static string AdditionalUsersDropDownList( this HtmlHelper helper, int additionalUsers )

MVC :: Passing Model Back From View To Controller?
forums.asp.net
I really need your advice on this. User will upload a list of students information from a CSV file.  After the upload has completed, the Controller will pass the Student model to a View.  The View will display the list of uploaded Students.  On the View, there is also a checkbox "Create Logon Account" and a submit button.  If the checkbox is checked, and the submit button is clicked, logon accounts will be created for the list of Students. The problem is after displaying the list of Students on the View with the model, how can I pass the same model back to the Controller for creation of logon accounts? I have managed to do it using FormCollection but I am wondering is there a better way.

Integrate HTML / Design With C# Code In MVC?
stackoverflow.com
We're working on a new ASP.Net site. The last major site we did was in classic ASP--the procedure we used there was to have the HTML completed first, then "bring it to life" with the ASP code. In the ASP.Net world, how does this work? I.e. how do the designers do their work if much of the mark-up is actually being generated by the server controls? We are also looking at ASP.Net MVC as a potential lightweight alternative. Would be very interested to know what was worked best for people in both scenarios in terms of working with the designers and integrating their work with the code. UPDATE: I refined what I was asking here, not exactly the same question but similar enough so this one could probably be merged with it.

MVC :: Partial Log On View Not Working?
forums.asp.net
1) I have a "user control" (partial view) called LogIn where my users log in. It has the usual textbox/password/validators/etc. 2) I have one view called Account/LogOn.aspx that has the following code: <% Html.RenderPartial("LogIn"); %> 3) I have another view called Home/Index.aspx that also has the following code: <% Html.RenderPartial("LogIn"); %> This renders a partial view inside my main views. When a user logs on, he/she is redirected to Home/Index.aspx The problem: I can log on from Account/LogOn.aspx, but I can't log on from called Home/Index.aspx. Why?

MVC :: MSChart In Partial View?
forums.asp.net
Got the MSChart working fine in a standard view,  but I'm trying to put them on partial views that I'm then loading using jQuery tabs. Problem is if you try to put the Chart on a partial, it moans about System.Web.UI.DataVisualization, saying it can't find it, no problem on a standard view though.

MVC :: Use A Partial View From Another Project?
forums.asp.net
i have a partial view( user control) in a project and i want it to be used on other projects.What is the best way to do it?

MVC :: Add A Partial View On Click?
forums.asp.net
I have a partial view which I would like to add to some other view when some link is clicked.

MVC :: Sending Whole Object From View To Controller
forums.asp.net
I have a controller that gets data from a service and then displays it in the view. I want to be able to delete that object, which requires me to pass the entire object back to the service. Assume that said object is the Model. Then my delete link look like [Code].... The purpose of this, is to send it to the Delete action of the controller to make the service call to delete the object. This works fine to a point. If the Model has string properties, then those are transferred with no problem. But if the properties are object that also have needed properties, then those are not sent. How do I make this work.

MVC :: Passing Data From Controller To View
forums.asp.net
I have setup an httppost that sends a string into my controller, searches for some results using linq, and then sends the results to a view. In debug stepping through the code I can see the data that I am looking for being passed into the return view statement, but the page just appears to refresh (it doesn't render the view as expected with the result). why my controller fails to redender the view? (note: I didn't include the view because I can send a ToList() to it without an issue. For example, return View(_entities.Persons.ToList()); [HttpPost] public ActionResult RenderSearch(string usersearchtext) { if (usersearchtext != null) { var search_results = from s in _entities.Persons where s.Description.Contains(usersearchtext) select s; return View("SearchResult", search_results.ToList()); } else { throw new NotImplementedException(); } }

MVC :: Passing Data From View To The Controller With Dropdownlist
forums.asp.net
I have a table with a ID, CodeID,LibelleID field. I am using  oracle connection. i want to display in a drop downlist  (textfield) CodeID+LibelleID for exemple "100-SalaryBase" where CodeID=100 and LibelleID="SalaryBase" is it possible to obtain it if the user selects an element  from the dropdownlist how to post both the codeID and ID to the controller

MVC :: Passing Data From View Back To Controller
forums.asp.net
I have following situation - I am pasing user info object from Controller to View. It contains GUID UserID,  which i dont want to be seen on page. So I  removed every   Html.LabelFor(model => model.UserID), Html.TextBoxFor(model => model.UserID) etc... from generated View source. And because of this when Html.BeginForm() returns that object back to Controller  all values is there but UserID is lost?? If I leave Html.LabelFor(model => model.UserID), Html.TextBoxFor(model => model.UserID) etc.. in View everything is fine. But I dont want to show UserID? Where is the problem here? <%= Html.LabelFor(model => model.C__User_Id) %>

MVC :: Passing ViewModel With Data From View To Controller
forums.asp.net
I am trying to pass a view model of mine, which has multiple list in it, to my view.  Then in my view i need to edit the different list.  Then on my post i need to save the edits.  Although, when i pass my viewmodel back to my post, it is empty! Can somebody explain what i am doing wrong? Controller [Code].... here is my View    [Code].... NewsViewModel    [Code]....

MVC :: How To Show / Hide Html.Textbox
forums.asp.net
I'm new to MVC, I have a simple form showing Title (Mr, Mrs, Ms, Miss, Dr, Other) - (HTML.DropDownList) Title Other (Html.Textbox) Firstname (Html.Textbox) Surname (Html.Textbox) I want to be able to hide the "TitleOther" textbox and change it if "Title = Other", How do I do this? [code]....

MVC :: 'Instance' Is Not A Member Of 'Html?
forums.asp.net
I'm using MVC 2 application and it works well back then, but after I restart VWD2010 these errors comes up. [:(] (1) BC30456: 'RenderPartial' is not a member of 'Html'. <asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="server">     <%Html.RenderPartial("/Views/Shared/EditEmployee.ascx")%> 'DropDownListFor' is not a member of 'Html'    <li>* Choose Country <%= Html.DropDownListFor(Function(model) model.country, Nothing, New With {.class = "highlight"})%> It's odd because all instance of 'Html' at Views are getting such errors. I did build/rebuild/clean the project but still the same errors.

Starting View For Deployed MVC Site - Don't Want Login By Default
forums.asp.net
Everything works as expected in VS under development (of course), but when deployed (local IIS) the log in view (sans css) comes up rather than the home index view. I've tried this with several test apps, including NerdDinner with the same results. I want to allow unauthenticated users to browse most of the site, but I do have views that require authentication (fomrs). I don't want to see the login view by default, only when the user explicitly wants to log in, or trys to see a view that requires authentication. What settings need to be made to not default to the login view?

MVC :: View The Modelstate Errors In Action Method?
forums.asp.net
for debugging purposes, how do I see the ModelState errors from code in the action method?  ModelState.IsValid returns false. I want to copy the error messages to a variable so I can display them in the debugger.

MVC :: Return SelectList From Action?
forums.asp.net
Is it valid for a controller action to give the view a strongly-typed object holding a bunch of SelectList objects? Or is better to return a bunch of IEnumerables and separate SelectedItem properties? SelectLists are MVC specific which has me doubting it but so are views and controllers...

MVC :: Delete View - Object Reference Not Set To An Instance Of An Object
forums.asp.net
I'm walking through the ASP.NET MVC "Contacts Manager" tutorial. [URL] I've followed exactly what's said in the tutorial, but I keep getting the following exception from the "Delete View". Object reference not set to an instance of an object.Line 10: Line 11: Are you sure that you want to delete the entry for Line 12: <% = Model.FirstName %> <% = Model.LastName %> ? Line 13: Line 14: <% using (Html.BeginForm(new { Id = Model.Contact_Id })) When i suprress line 12, I still get this Line 12: Line 13: Line 14: <% using (Html.BeginForm(new { Id = Model.Contact_Id })) Line 15: { %> Line 16: <p> I just don't know. Maybe the POST DELETE method is not communicating with the datacontext... The important question is why the only the "Delete View" is not working???

C# - Return Different Views In A Controller?
stackoverflow.com
If I have a controller and I want to return a view based on what my conditional logic goes to, is that possible? I have different types of models that i want to insert into a view DEPENDING on my conditional logic (if statements) Can i do this? and how would I do this

MVC :: Http POSTing From Controller Return Result?
forums.asp.net
I have a controller action that creates records and then needs to print labels for those records.I will also have a whole bunch of other controller actions that will do the same,so what I want to do is to have a single "Print" controller action that can take the references that are passed to it,print the labels and then offer the user different exit links/options passed in from the calling controller action.As this list of labels to print could get quite large,and the exit options also, I thought it would be easiest to send these in as a POST formcollection,but reading up on it,it seems that RedirectToAction only performs http GETs.Is there either a way I can get it to send a POST,or is there a different command that I can use as the return parameter for the controller action to send a post to the "Print" action?

MVC :: Implement A Controller Method That Does Not Have A View
forums.asp.net
i have created a controller method that just update a record in the database. and i call this method using the following code <% : Html.ActionLink("Perform Calculation", "Calculate")%> but the problem is that when i click on the Perform Link an error will be raised indicating that it can not find the Calculate view. so how i can enforce my application to call the Calculate controller method to perform the update and to keep the user in the current page .(the index page).

MVC :: Passing Parameters From View To Controller?
forums.asp.net
How do you pass values from a View to a Controller?  I have an Html.DropDownList in a view, and need to get the selected value/text back to the controller. [Code]....   [Code]....

MVC :: Complex View/user Interaction?
forums.asp.net
Basically I have a page where a user can select up to 3 vehicles by make and model. I have 3 divs on the page that is generated with a basic foreach loop.  When the user selects a make and model from respective dropdown lists I am firing a javascript function that returns a JSonResult that loads a dynamic partial view into a seperate div.  This partial view displays a div with a grid whereby the user can select one of n-number of services using a checkbox.Next what I would like to do is if the user selects a servce for the one of the vehicle selections, I would like to add this selection to a list of "ServiceSelection" that is part of my viewmodel. Ultimately the user would click a button that would redirect to the next step in the process and pass the entire updated viewmodel to this new page.

MVC :: Implement A Cascading Dropdownlist Inside A Partial View
forums.asp.net
i'm trying to implement a cascading dropdownlist inside a partial view. this is the code: [code]....

How To Controller Determine Which View To Use In Mvc
stackoverflow.com
i just strated with asp.net mvc. My doubt is in a controller we use public ActionResult Index() { return View(); } so how a relevent view is returned for a particular controller.

MVC :: No Connecttion Between View And Controller?
forums.asp.net
"The model item passed into the dictionary is of type 'NerdDinner.Controllers.DinnerFormViewModel', but this dictionary requires a model item of type 'NerdDinner.Models.Dinner'" There are similiar problem error but not the same context problem. I believe that the problem is located in the edit.aspx and still i can't solve it. I'm using VS 2010 and ASP.net MVC 2 // Fullmetalboy [Code]....

MVC :: Receiving Data In Controller From VIEW
forums.asp.net
I know that in ASP.NET MVC I can pass data from controller action to view using ViewData - text about that is here: [URL] I know that also I can receive data in controller from VIEW using parameters in url or object. I need write about that and in ASP.NET MVC tutorials there are only examples. Could somebody write something about that or give me a link ? It must be concret information which I could write.

MVC :: Passing Objects Between View And Controller?
forums.asp.net
 I would like to pass List<SelectListItem> (not selected item but the whole "List" object) back to controller. for example in my GET controller i would have this ViewData["list"] = some select list from repository; then on post I would like to get the list back from view..pretty much i'm trying to use ViewData["list"] as storage..this way I would use ajax to remove or add items to/from the list.

MVC :: Binding Controller & View Without ViewData?
forums.asp.net
I like ASP.NET MVC, because I like to have direct access to my web site's structure. However there's 1 thing that I don't like. In Ruby on Rails to send data from Controller to View is really easy: # Get a user in controller @user = User.first(:id => 1) # Display him in a view <%= @user.id %> In ASP.NET MVC it's much harder // Controller User user = new User(1); ViewData["user"] = user; // View <% User user = (MyNamespace.User)ViewData["user"]; %> <%= user.Id %> With this ViewData thing all benefits of static languages go away, and we waste time boxing/unboxing objects. P.S. Don't tell me to use Model object, because this is also true for other variables like integer. And another question: I'm trying to implement a comfrtable access to data. Since I can't use LINQ to SQL as I use Postrgresql, I have to do it on my own. I'm tired of direct SQL queries, so I'm trying to implement something like this: User user = User.Find("first_name" => "Bob");

Accessing Static MVC Controller Method From View
stackoverflow.com
I've got an .aspx page with this in it: <%@ Import Namespace="System.Web.Mvc" %> <%= AssetController.ScriptTag("/js/Community/CommunityWizard.js")%> And I have an AssetController class: Imports System.Web.Mvc Public Class AssetController Inherits Controller Public Shared Function ScriptTag(ByVal src As String) As String Return String.Format( "<script type='text/javascript' src='/js.mvc?src={0}&{1}'></script>", System.Web.HttpContext.Current.Server.UrlEncode(src), New BuildVersion().ToString() ) End Function End Class The project has a reference added to the 3.0.0.0 version of System.Web.Mvc assembly. When I try to view the page in a browser, I get a HTTP 500 with this message: BC30007: Reference required to assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' containing the base class 'System.Web.Mvc.Controller'. Add one to your project. What gives? I don't understand why I can use this controller everywhere in our ASP.NET Forms/MVC hybrid application, but not in a view. EDIT: In fact, when I type <% System.Web. into the .aspx view, Mvc doesn't even appear in Intellisense!

MVC ViewData Not Rendering In View
stackoverflow.com
I have the following code in my post action method for Edit. JobCardService.Update(viewData.JobCard); var js = new JavaScriptSerializer(); ViewData["Notifications"] = js.Serialize(new {NoteificationType = "Success", Message = "The installtion was successfully updated"}); return RedirectToAction("Index"); However, on the client, ViewData is null/empty, i.e. this client code var notifications = eval("<%= ViewData["Notifications"]%>"); renders as var notifications = eval(""); I'm sure I'm doing something small wrong.

MVC :: Does [HandleError] Attribute In MVC Replaces The Traditional Try Catch Exception Handling
forums.asp.net
Does [HandleError] attribute in MVC replaces the traditional try catch exception handling? As I have seen codes in controllers where the top line of code is [HandleError] also I have not seen much of try catch in the code of the application I am working on.

HTML Codes In Strongly Typed HTML Helpers
stackoverflow.com
So, I am having a hard time getting this to work. I am trying to add some typographic HTML codes to some labels I have strongly typed to my model. <%: Html.LabelFor(m => m.Name) %> I am using data annotations to customize the DisplayName of the property: [DisplayName("Your friend’s name")] public string Name { get; set; } However the actual code is being displayed for the label: Your friend’s name I have also tried just using the old write method: <%= Html.LabelFor(m => m.Name) %>

Web Forms :: How To Create A New HTML Control Which Contain Multiple HTML Control
forums.asp.net
I am realizing a table with multiple rows for a Sharepoint webpart. In this project, I would like to have a new html control which contain a LinkHtml in one column and another label in another column. Essentially this html control would be a row used for my html table. At the moment i am doing a row like this in the main class : [Code]....

MVC :: HTML Helpers - Passing Id And Name To Views?
forums.asp.net
I´m learning mvc and I found a problem. I have a product table that stores currencies in integers. On the other hand I have a table name currency that stores each int id with the currency name. On html.dropdownlist I followed the pattern: The name of the form field (ArtistId) The list of values for the dropdown, passed as a SelectList The Data Value field which should be posted back with the form The Data Text field which should be displayed in the dropdown list The Selected Value which is used to set the dropdown list value when the form is displayed This was great for Forms in order to display selections. Right know I´m finishing my details views and I need to use the int id on product table but display the name on currency table associated to that int id. Does anyone knows if it exist an html helper that renders the Data Text Field that should be dsiplayed on the View taking into consideration the int number? Something like @html.display("Name", model.product.currencyid) where name is pulled from db.currency?.

Spark View Engine And MVC 2 Strongly Typed Html Helpers?
stackoverflow.com
I try to use HtmlHelper.TextBoxFor with spark view engine but view crashed with exception "Dynamic view compilation failed. 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'TextBoxFor' and no extension method 'TextBoxFor' accepting a first argument of type 'System.Web.Mvc.HtmlHelper' could be found(are you missing a using directive or an assembly reference?)". It is my _global.spark: <use namespace="System"/> <use namespace="System.Linq"/> <use namespace="System.Text" /> <use namespace="System.Web.Mvc"/> <use namespace="System.Web.Mvc.Html"/> <use namespace="System.Web.Routing"/> <use namespace="System.Linq.Expressions" /> <use namespace="MyModels" /> In spark-view using: ${Html.TextBoxFor(m => m.UserName)}

Custom ViewModel With MVC 2 Strongly Typed HTML Helpers Return Null Object On Create?
stackoverflow.com
I am having a trouble while trying to create an entity with a custom view modeled create form. Below is my custom view model for Category Creation form. [code].... When i click on save button, it doesnt bind the category for me because of i am using custom view model and strongly typed html helpers like that <%=Html.TextBoxFor(model => Model.Category.OrderNo) %> My html source looks like this [code].... How can i fix this?

View HTML Dynamically In My Page / What Controls Do I Need And How To Pass The HTML Inside It
forums.asp.net
I have some html code in a string variable in the code behind. How can i display the HTML in my page?! what controls do i need and how to pass the HTML inside it?

Forms Data Controls :: Printing Html Code Instead Of Printing Html View In PDF?
forums.asp.net
I am using formview control to generate invoice. But instead of printing html view it is printing html code in PDF. I am doing like this: [Code]....                 

MVC :: How To Redirect To New Page After Jquery Ajax Call
forums.asp.net
1- I have an Ajax link that call an action and that action returns a view , that view open in a specific Div (consider it as a menu that update the div with the corresponding view) 2- if session timeout the returned my logon view so if i click on the link and session is timeout , the log on view open in the div not in the whole page what i should do so if the session timeout it return logon view in new page in on my div?

Cannot View My Command Button In My First Web Application
www.vbcity.com
Really need help on this matter.. I am really new with VB.net.. I've installed VS.Net.. Try to create my first web application. In my web form form, I've added a label, text box and command button for testing.. In my Label property, I've set the Label's text and text box's text to "Testing" (for example").. When I build and browse my web form, I could only see my label text and my text box text (Testing). However, I've couldn't see my text box border and command button... Anybody.. pls help me...

VB PROGRAM To View A Cgi Website
www.vbcity.com
I have a private network which included a cctv video server (CGI base) and 2 computersthe video server can be acces by webbrowserthe video server have 4 camera the video server does not support multi logoni developed a simple vb program that cantain a webbrowser object that browse one of the 4 camerabut a program rise when the operator try to view 2 camera at the same timewhen the operator open 2 camera, one of the camera would logout or terminated abnormally i cannot figure out the error and could anyone help?Edited by - zincal on 10/14/2004 8:21:05 AM

HTC Desire :: Facebook Contacts Disappear From View On Sync
androidforums.com
I'm signed into FB on my Desire using Friendstream, not the FB program.Every time the phone does an automatic sync, or I do it manually, the FB contacts are unselected from view and I have to add them again.

Android :: Web View - How To Click Web Link And Display In WebView App
groups.google.com
I am trying to add a webview in my app to display a web page. However, every time I click link on the web page, Browser will be launched to display content in that link. I understand it is something about intent but I am still wondering is there any simpler method to ask webview to display link content within its View ?

Android :: How To Implement Link View?
groups.google.com
Just like the html a tag, I want dispaly a link text, when user click the linkView then trigger some evnet( link: open a new page). when user click the google text ,then open the google home page: www.google.com. I saw the TextView and the Linkify class, but is can only display the url to a underline link text.

Sprint HTC Hero :: Contacts From AT&T Sim Card Not Showing In People / Way To View
androidforums.com
I just bought a Hero yesterday and had the Sprint store transfer my contacts from my AT&T sim card. Everything seemed to work fine except when he looked in the "people" icon, nothing was there. So after a few more tries I left. When I got home, I noticed that all my sim card contacts, including my Facebook contacts, were visible when I hit the "phone" icon. My question is, how do I get my contacts in the "people" icon? I want them on the first tab "all". I was able to get one of my contacts in the "favorites" tab but it takes too long to get there. I want to hit "people" and see all my contacts right away.

Professional :: View A PDF Within A Flash Projector?
forums.adobe.com
I would like to know if it is possible to view a PDF document WITHIN an offline Flash Projector.exe? Just like when you have the ability to access the Acrobat toolbar within a web browser.   I have 45 PDF booklets that I can already open from a Flash Projector into Acrobat Reader for printing, but I would prefer not to leave the Flash Projector at all.

MVC :: Adding A Record To The DB When Clicking On A Link In A View?
forums.asp.net
I want to add a link on one of the views , and when the user clicks on the link i want to insert a record in on of the a database table. The link will not take the user to another view or controller it just execute and insert statement to the database. I am using MVC and LINQ

Create Tab Using Only Html And CSS To View In Outlook Mail?
forums.asp.net
I want to create an html file to send as an outlook mail in which i want to show 4-5 reports. In whicn if i click on first tab i can see report 1 and if i click on tab2, i can see the report 2 in same frame. I created same using javascript but that is not working in outlook mail. I tried CSS but I am able to view them using hover effect only not on onclick.

Web Forms :: Upload An Jpg Image To A Form And View It On The Html Embedded E-mail
forums.asp.net
! I have a working form on http://www.tugberkugurlu.com/wat/app/wandt.aspx I can get this form as html embeded e-mail to my e-mail. I am doing it with this function; [Code].... It contnues but I think this one is enough. also my html page which I can get as e-mail is on http://www.tugberkugurlu.com/wat/app/htmlpage.htm  I would like to add a section to my form in order to get the sender's image. I won't apply any validation on this but there will be some restrictions for the image.it needs to be jpeg file. It wont allow any other files It needs to be max. 170x218.

C# - Create Html Helpers In Webforms Project Like In Mvc?
stackoverflow.com
Can i create html helpers in Webforms project like in asp.net mvc?

Web Forms :: Get Any String From View Source?
forums.asp.net
i need to convert currency into other country value( ie.  USD To INR) .  if I open  any site to get a value of  that perticular currency value.  Is it possible to get value from view source . if yes then How And Simply  i want to get  full string from view source  where 'UDS' string found. then How i can search a string from ViewSource(which we get  right click of mouse---- View Source) which belong to other site, i have only url that site.

Forms Data Controls :: Resize Parent Width On GridView Edit Event?
forums.asp.net
Has anyone found a solution to gridview edit views busting out of the side of the gridview's parent html element?

Forms Data Controls :: Formview Default Insert - Need ReadOnly View
forums.asp.net
I'm using a formview in Insert mode with an AccessDataSource. I want to switch to readonly mode upon insertion to let the user confirm the input worked, then give them the option to insert a new record. If I set the DefaultMode to Insert, then after the first record is inserted, I get a new blank insertion form (no confirmation). If I set the DefaultMode to ReadOnly, after insertion, I get a blank form (presumably because I am not on the record just inserted).  How do I get the just inserted record to display? If I need to set the ID of the formview to the just inserted record OnInserted, how do I get that given I'm using an AccessDataSource?

Caching - View The Contents Of The OutputCache?
stackoverflow.com
Is there any way that I can list the pages which are currently stored in the OutputCache? Just a list of paths would do, but if there's a way to get more information about each item (expiry etc), then all the better.

Passing A List Of Object From A View To The Controller In Mvc?
stackoverflow.com
ss a list of objects as a paramter in an actionlinkAt the moment when I try to do this the list is always empty by the time it reaches the controller! <%= Url.Action("ActionName", new { list = Model.ListOfObjects}) %> public ActionResult ActionName(List<Object> list) { //Do stuff }

MVC :: Send And Use Linq To Sql Object From Controller To View?
forums.asp.net
I want to show books and their authors from 3. tables using linq to sql. I have in controller: [Code].... And in view: [Code].... But I have error: Error    1    foreach statement cannot operate on variables of type 'object' because 'object' does not contain a public definition for 'GetEnumerator'

How To Get Value From View To Controller
stackoverflow.com
I have a View: <div class="editor-field" id = "nick">Nick <%: Html.TextBoxFor(model => model.Nick)%><img src="/Content/Images/loading.gif" alt = "loading...."/> <%: Ajax.ActionLink("Check", "Check", new AjaxOptions { UpdateTargetId = "check-valid", LoadingElementId = "loading"})%> </div> I used: Nick = ViewData.Model.Nick in ActionLink as below, but I cannot get value of Nick from View. <%: Ajax.ActionLink("Check", "Check", new {Nick = ViewData.Model.Nick}, new AjaxOptions { UpdateTargetId = "check-valid", LoadingElementId = "loading"})%>

Passing Data From A View To A Controller In MVC?
stackoverflow.com
I have a dictionary I'm passing to a View. I want to be able to pass the values of that dictionary back to a Controller action from this same View. Is there anyway this can be accomplished without using a form? The situation is that I need to be able to pass these back to a controller action that is called when a user clicks an ActionLink from the View, and in my experience an ActionLink cannot be used to submit a values of a form, i.e. I've only been able to submit values of a form using the form's submit button. Unless there's a way to use an ActionLink to submit values in a form.Controller Action passes Dictionary to Controller in ViewData: public ActionResult ModifyNewCrossListing(FormCollection form) { Dictionary<int, string> prefixlist = new Dictionary<int, String>(); [code]...

Winform Versus MVC
forums.asp.net
I want to know when to use winform and MVC asp.net

How To Upload A .docx File And View It On The Website
forums.asp.net
I was doing a project involving posting a new job site. How do you upload a .docx file to the server, and then allow viewer to view it later on the web.

Mvc File Upload Is Passed As Null To View Model?
stackoverflow.com
I have a form which uploads a photo to my database, and I use a view model to aid in this process. View Model: public class GalleryViewModel { //Members: public Gallery _photo { get; set; } public string _title { get; set; }[code]... When I debug the code, I see that the in the post method in my controller, all the information from the form is updated in the view model except for the uploadFile which is null.In the form I use enctype = "multipart/form-data". When I use my master page the uploadFile is null but when I use the default MVC master page everything works fine. Here is my master page: <%@ Master Language="C#" MasterPageFile="~/views/Shared/GeneralMaster.master" Inherits="System.Web.Mvc.ViewMasterPage" %> [code]....

Landscape View Of A Webform?
forums.asp.net
 I am building a system which requires a table to be displayed on a webform; this webform will be shown on large screens such as those found in malls. Since the webform is set to display as a Portrait by default, I was wondering if it would be possible to change this to Landscape since this would help me to size and style the table more easily. I've noticed a whole lot of 'Printing in Landscape' posts, but this is not what I want. The webform must simply be oriented to be displayed in Landscape.

Forms Data Controls :: How To Get The Selected Row Index In Grid View
forums.asp.net
I have a gridview with dynamic buttons for edit and save.Save button is disable by default. In the edit button command argument i bind the id of the record. now when i click edit button i want my save button to get enable and edit button will disable for that particular row. I dont kow how to get the selected row index through dynamic button.

Web Forms :: Compatibility View IE8?
forums.asp.net
in my application i got this error.i got it when i do postback in iframe in this pagewhat can be the reason for this error. and how can i slove this problemanother important point.this error  not append all times.this error append in the first proccess , but the other run ok with no errors!

How Display Data In A Gallery View Mode
stackoverflow.com
Is there a way to display gridview as "gallery view" instead of plain "list view". For example like ebay(you can toggle the view 1.list view, 2.gallery view, 3. side by side view). Any asp.net controls or jQuery controls will do the job for me.

How To Specify A Default Value For A Field In A .NET Details View Insert Mode
stackoverflow.com
.NET newbie. I know there has to be a way to do this.I have a details view with it's default mode set to Insert. This is to be used as a form for users to enter records into a database. For two of the fields, I want to pre-populate the field with information. Specifically, I have a vb script with a few functions to query Active Directory to return the user's name based upon their user id. This script works fine.I call the functions for the user name like this: <InsertItemTemplate> <asp:TextBox ID="txtUserID" runat="server" Text='<%#CurrentUID() %>'></asp:TextBox> </InsertItemTemplate> <InsertItemTemplate> <asp:TextBox ID="txtUserName" runat="server" Text='<%# GetUserName(CurrentUID()) %>'></asp:TextBox> </InsertItemTemplate> When the page loads, this populates the text boxes with the user id and the user name.But when the form is submitted, the values in the text boxes are not inserted in to the database.How can I set default values for the fields when the values come from functions?

MVC :: Passing A Collection Of Objects To The View?
forums.asp.net
I'm trying to pass a list of items from a LINQ query to a View, but I'm having trouble figuring out how to resolve a type issue.  Here's the error: The model item passed into the dictionary is of type 'System.Data.Linq.DataQuery`1[Project.Models.Diagnostic]' but this dictionary requires a model item of type 'Project.Models.Diagnostic'. The issue seems to originate with this code from my Controller: [Code].... I tried changing the IQueryable<Diagnostic> to var and got the same error. Also played around with something like: [Code].... But then VS2008 says that diagnostics could never be null, and that's may not the best (or even valid) way to do it.

Possible To Obtain A List/collection Of All Pages A User Is Authorized To View
stackoverflow.com
I'm using forms authentication in my C# based web site, with the authentication defined in web.config files in the various folders/sub-folders. I want to write a generic administration menu system, that lists all of the admin pages that the use is authorized to open. As I add pages, I want them to automatically show up in the menu. I need to obtain a list/collection of all pages that the active user is authorized to open. Is this possible in ASP.Net 3.5?

MVC :: To Pass More Than One ViewModel To The View?
forums.asp.net
In my page there is a Login form. It looks like [Code].... But at the same time in this page I need to render some info from another ViewModel. Is it possible to write in action something like return View(Model1, Model2); ?And how could I get access to these ViewModels in this case?

How To Send Id From View To Controller
stackoverflow.com
I have a view that receives a Model and displays info of that model. I have a submit button and when it is clicked i want it to send the id to the method to process it and delete a row that has such id. How can I do this? I want to use a button not an html link like @Html.ActionLink("Delete", "Delete", new { id = Model.Id }) |

MVC :: Getting The Value Of Text Box From View To Controller?
forums.asp.net
I want to stop a windows service by clicking a button, but my boss is asking me to do this in MVC. I know the code of stopping and restarting the window service, but when I am trying to do this in MVC, I get an error. I created two buttons on my View page [Code].... In my controller, I defined the methods for each button [Code].... I have a class [Code].... when I run the web site and I enter something on the tesxt box and press the restart service button, I get the error resource is not found Requested URL: /Post/Action and the URL changes too. How can I configure so that I can get the name that I typed in my text box to my controller.

MVC :: Use The Same View To Access The Different Controller?
forums.asp.net
I am new to MVC. Now I have an application needs to be built using MVC. I want to show all the information in one view(or form), but the data are coming from different controllers. how the system knows the data in textbox1 goes to controller1 and the data from database in controller2 returns to textbox2 in the same view(or form)?

MVC :: Update Controls In The View From The Controller?
forums.asp.net
I have a text box in my page and i want from the controller to change the value for this text box. how can i do that ?

Jquery :: MVC: Pass An List Or Array Of Strings From Controller To View?
stackoverflow.com
I need to populate an object in the script section of my mvc page, currently the object looks like this: <script> var disabledDays = ["9-30-2011","2-24-2010","2-27-2010","2-28-2010","3-3-2010","3-17-2010","4-2-2010","4-3-2010","4-4-2010","4-5-2010"]; Now I am trying to pass an array of DateTime objects to the view from the controller, but converting it to strings before I do that. Something like this: <Controller> var blockedDates = new List<string>(); foreach (DateTime closeDate in dealershipInfo.ClosedDates) blockedDates.Add(closeDate.ToString()); ViewBag.BlockedDates = blockedDates; But definitely it is not working for me. What will be the proper way to achieve this kind of a result.

Which Framework/library To Use To Manage Views/screens In An HTML Application?
stackoverflow.com
I am developing an rich Javascript application, using jQuery and some plugins. The application I am developing is becoming rather large and unwieldy. My main problem is managing views: I need to switch between views, some of which share the same components (like embedded views or partials). Currently my "screens" are all contained in various divs, and I am switching between them by hiding one and showing another. This makes navigation quite complex.My question is: Is there a lightweight Javascript library that can help? Following requirements:No generation; I want to change the code on the deployment server, so frameworks requiring some special compilation are out of the question (like Sproutcore or GWT)Model binding is not a necessity; I am getting the values from various forms and submitting them via Ajax requests .Want everything loaded upfront (i.e. not fetching screens with AJAX).Must work with IE7