Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

Is this a bug? Or is it a setting in ASP.NET 4 (or MVC 2)? -


i started trying out t4mvc , idea of eliminating magic strings.

however, when trying use on master page stylesheets, this:

<link href="<%: links.content.site_css %>" rel="stylesheet" type="text/css" /> 

rending this:

<link href="&lt;%: links.content.site_css %>" rel="stylesheet" type="text/css" /> 

whereas these render correctly:

<link href="<%: url.content("~/content/site.css") %>" rel="stylesheet" type="text/css" /> <link href="<%: links.content.site_css + "" %>" rel="stylesheet" type="text/css" /> 

it appears that, long have double quotes inside of code segment, works. when put else in there, escapes leading "less than".

is can turn off? bug?


edit:

this not happen <script src="..." ... />, nor happen <a href="...">.


edit 2:

minimal case:

<link href="<%: string.empty %>" /> 

vs

<link href="<%: "" %>" /> 


edit 3:

i have workaround, have implemented htmlhelper extension can this:

<%: html.stylesheet(links.content.site_css) %> 

i support intellisens better, i'm going stick that. right now, i'm trying solve bug.

it looks bug me, compiled output is:

private global::system.web.ui.htmlcontrols.htmllink @__buildcontrol__control5() {     global::system.web.ui.htmlcontrols.htmllink @__ctrl;                 @__ctrl = new global::system.web.ui.htmlcontrols.htmllink();     @__ctrl.href = "<%: string.empty %>";     ((system.web.ui.iattributeaccessor)(@__ctrl)).setattribute("rel", "stylesheet");     ((system.web.ui.iattributeaccessor)(@__ctrl)).setattribute("type", "text/css");     return @__ctrl; } 

this seems happen when control inside head runat="server"


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -