Questions tagged [mvchtmlstring]

32 questions
1
vote
3 answers

HtmlTags within Resx displayed in @Html.ValidationMessageFor

I have the following doubt. I am considering the option to have html tags within my resx texts for localization. When I put the resources directly I can resort to: @Html.Raw(@Resources.ResourcesFM.Error_Email) and it works as expected. The problem…
mcartur
  • 325
  • 3
  • 13
0
votes
1 answer

MvcHtmlString equivalent in .Net 3.5 and lower?

Is there an equivalent method to MvcHtmlString in .Net 3.5 and lower? I have googled and have not found an answer. I created a helper for MVC 3/.NET 4 that uses MvcHtmlString. However it only runs on .NET 4. I want to code a version of the helper so…
Ashok Padmanabhan
  • 2,110
  • 1
  • 19
  • 36
0
votes
1 answer

Add an index into mvchtmlstring in mvc

I would like to add an index into mvchtmlstring because I use it in a table. If I need to get the whole list of the data input by user, I need an index so that the system are able to get all the list of data. So this is the example code that I want…
0
votes
2 answers

How to create Alert confrim Yes/No with MvcHtmlString in MVC C#

The following code displays a warninng via MvcHtmlString. in C# public static MvcHtmlString ShowAlert(this HtmlHelper helper, string message) { StringBuilder sb = new StringBuilder(); sb.Append(@"$.confirm({" + …
user11657764
0
votes
0 answers

Passing a MvcHtmlString with code (@if) not working

I am trying to pass a MvcHtmlString to one of my view that contains if statements which are currently being rendered as text rather than running as code. The cshtml below is stored in a database table:

SUPPORTING INFORMATION

@if…
CryoFusion87
  • 796
  • 1
  • 8
  • 28
0
votes
1 answer

display MVCHtmlString base on user role

for example, I have a search form like below form, I want check if your has access see inputs ( a user may have access to see just one of them and the other may have access to see 3 of them ), what is the best method or extension to check…
0
votes
1 answer

Why doesn't html.encode return HtmlString

I've been going through and converting my project to use the <%: instead of the <%= syntax, and have been annoyed that I also have to remove Html.Encode(zoozle) all over the place. If it's left in place, zoozle will get double-encoded. This leaves…
davidtbernal
  • 13,434
  • 9
  • 44
  • 60
0
votes
0 answers

Custom MVC htmlhelper not rendering correctly

I Have a HtmlHelper code like below sskIconsHtml += "
Chitta
  • 185
  • 2
  • 15
0
votes
0 answers

complete html (after javascript execution) in web api

I have a script tag e.g as a string, so I need the full html(when it will load on web browser) as string in web api method For eg public string GetHTML() { string script =…
DSP
  • 78
  • 10
0
votes
0 answers

Not able to get correct boolean value from SelectListItem in custom Radio Button

I'm creating a custom radio button helper using tagbuilder. I'm making use of the steps suggested in the post: Custom helper for generating html tags for radio button and associated label , but have tweaked it a bit to pass the values to the radio…
0
votes
1 answer

Loading a DIV with dynamic MvcHtmlString

I've created a div inside a web page that needs to be filled through the jquery load function.
This is the call that should fill the div (the call is triggered by some other client side event):…
Alex Barac
  • 632
  • 4
  • 12
0
votes
1 answer

MvcHtmlString cuts off apostrophe and everything after

I'm using .NET 4.0 with MVC 4. I have a custom web control pager that returns an MvcHtmlString using MvcHtmlString.Create(...). A sample MvcHtmlString that is returned is:
0
votes
1 answer

Cannot Get Hidden Property for Hyperlink or Button

I have custom HTML Helper method in my MVC4 project and this method returns an html url for WebGrid as below: I use this image as a button for the Actions column on my GridView. On the other hand…
Jack
  • 1
  • 21
  • 118
  • 236
0
votes
2 answers

Displaying Multiple Image Links instead of Text in WebGrid?

I have a WebGrid definition and three links in a single column by using Html.ActionLink. But, when I do not use "LinkText" property, the applicantId property is passed as null value to the Controller. On the other hand, when just using LinkTexts…
Jack
  • 1
  • 21
  • 118
  • 236
0
votes
1 answer

How to call an Action from a helper and avoid the render?

I'm working on ASP.NE MVC4 and I'm using LungoJS library for the development. I'm developing a Helper to render LungoJS controls in the way I need. For the Select inputs, I want to get a JSON that contains the data for each option. I can get the…
rubdottocom
  • 8,110
  • 10
  • 39
  • 59