.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

inline expression or binding expression in the server head section

Posted By:      Posted Date: August 29, 2010    Points: 0   Category :ASP.Net
Hello, I write inline expression and binding expression in the server head section:<head runat="server"> <link rel="stylesheet" type="text/css" href="<%= Request.ApplicationPath %>themes/style1.css" /> <link rel="stylesheet" type="text/css" href="<%# Request.ApplicationPath %>themes/style2.css" /> <link rel="stylesheet" type="text/css" href="<%= ResolveUrl("~") %>themes/style3.css" /> <script type="text/javascript" src="<%= Request.ApplicationPath %>js/jwork.js"></script> </head> protected void Page_Load(object sender, EventArgs e) { Page.Header.DataBind(); }  But both kinds of expression aren't parsed or executed except the  ResovleUrl menthod. The html renders like this: <head><link rel="stylesheet" type="text/css" href="&lt;%= Request.ApplicationPath  %>themes/style1.css" /><link rel="stylesheet" type="text/css" href="&lt;%# Request.ApplicationPath  %>themes/style2.css" />    <link rel="stylesheet" type="text/css" href="/themes/style3.css"  /> 

View Complete Post

More Related Resource Links

Can the default member for the sql server analysis filter web part be a mdx expression or not

I have designed a dashboard , some parametrized reports ( on date and time) in my case with a cube as datasource, added an analysis services 2005 filter, connected it to the reports. The issue concerns the default value for the filter . I f I choose [Date Local].[Calendar Hierarchy].[All] it works well. But the business requirement is to use the last day where there have been registered a measurement which in my case looks like the following mdx expression: Tail( Filter ([Date Local].[Date Key].[Date Key].Members , ( ( [Advisor Organisation].[Advisor organisation].[Contact Center].&[Denmark]&[Kundelinjen], [Measures].[Calls Offered] , [Date Local].[DK Holiday].&[False] , [Date Local].[Week Day].&[True] ) > 0 ) ), 1).Item(0).Item(0) The expression is all right as I use it in my report as an mdx filter expression. But when I use apply it I get an invalid dafault member value. So the question is : Does the filter support an mdx expression ? If yes, is there another syntax or change in order to make it work ? Thank you a lot for your answer.

Looking for a way to use a DynamicResource as the source of a binding expression


This is what I've found:

- The DynamicResource MarkupExtension returns a ResourceReferenceExpression which, when assigned to a dependency property of a dependency object that is part of the visual or logical tree, will be invalidated and updated when a resource with the matching key is added to the tree.

- A binding expressions Source property is not a dependency property

- A binding expression is not part of the visual or logical tree when used as a markup extension (or even assigned via property syntax)


My goal is to have something like the following:
<TextBlock Text="{MyBinding Key=SomeResource, Path=Some.Resource.Path}" />

The resource wouldn't be assigned until after the XAML is loaded.

Wouldn't it be reasonable to have my custom markup extension return a derived type of ResourceReferenceExpression, which could do the dirty work. I see a few possibilities, perhaps even something with a custom value converter that could be leveraged to create a binding expression to the value that gets returned when the expression is evaluated?

Any plans to allow this kind of extensibility (or if anyone knows if deferred binding to property paths will be added)?

Can't seem to get into or extend the classes that make this stuff tick. Any ideas? (yeah.. I'm probably jumping all over the place,

VB.Net Late binding operations cannot be converted to an expression tree.


Hi I get this error
"Late binding operations cannot be converted to an expression tree."

At all my x.NAME) lines !?

Im new to this so can anyone say me why i get this error..
Hvorfor gør den det !?


        <div>Navn: <%: Html.EditorFor(Function(x) x.Name)%></div>
        <div>Linje 1: <%: Html.EditorFor(Function(x) x.Line1)%></div>
        <div>Linje 2: <%: Html.EditorFor(Function(x) x.Line2)%></div>
        <div>Linje 3: <%: Html.EditorFor(Function(x) x.Line3)%></div>
        <div>Postnr: <%: Html.EditorFor(Function(x) x.Zip)%></div>
        <div>By: <%: Html.EditorFor(Function(x) x.City)%></div>
        <div>Landsdel: <%: Html.EditorFor(Function(x) x.Country)%></div>
            <%: Html.EditorFor(Function(x) x.GiftWrap)%>
            Disse vare skal i Gaveindpakning.

Problem Excluding Section In Quotes From Regular Expression Match


Hi There,

Currently I have the string:

"WHERE Column_1_Name = 1 AND Column_2_Name = 'Test Column Criteria'"

& my desired matches are as follows:




However, so far, I can only achieve

'Test Column Criteria'

via: (([a-z][\w]+)|('[\w ]+'))(?!('[\w ]+'))




via (('[\w ]+')|([a-z][\w]+))(?<=\3)


All help appreciated much appreciated.

(I'm using the .net engine, case insensitive)

How to pass control reference to its property in data binding expression


Here is data binding expression (dropdown list is nested in gridview)

<asp:DropDownList ID="ddlEmployees" 
         DataSource='<%# PayCheckBO.GetEmployeesNameIdPair() %>' 
         SelectedIndex='<%# GetSelectedIndex(HOW TO PASS REF of ddlemployee HERE)%>'/>

Code Behind has function which looks like

public int GetSelectedIndex(DropDownList ddl)
        //loop through the item in the dropdownlist
        //return index based on xyz checks

The whole reason for passing the reference is to save round trip to database and not to use SESSION

Pointer Properties expression SQL Server 2008R2/BIDS


There is probably a better way to do this but I need to capture all of these conditions, for example, if scope was .12 and costVariance was 0 and ScheduleVariance .011 I would divide by 2 to get the average, or just use the Avg function for the two with values <>0.  Or if all 3 had values >0 I would just add them and divide by three and so on.

I am gettig the right results in the query i have pasted at the bottom of this post

Scope =0


Schedulevariance=0 or

[How??] Lamda expression with ByRef parameter


How to write lamda expression with ByRef/ref parameter in c# ??

The code below causing syntax error:

item.OnAction = (p1, p2, ref p3) => {
   return true;

item.OnAction = (p1, p2, & p3) => {
   return true;

Express Yourself: Encoding Videos Using Microsoft Expression Encoder 3 SDK


Video on the Web involves huge amounts of data. Learn the best way to manage and move that data with the help of Microsoft Expression Encoder 3.

Adam Miller

MSDN Magazine June 2010

Security Briefs: Regular Expression Denial of Service Attacks and Defenses


Microsoft security expert Bryan Sullivan believes denial-of-service blackmail attacks will become more common as privilege escalation attacks become more difficult to execute. He demonstrates how to protect your apps against regular expression DoS threats.

Bryan Sullivan

MSDN Magazine May 2010

Silverlight: Create Animations with XAML and Expression Blend


In this excerpt from his upcoming book, Laurence Moroney explains the basics of Silverlight animation and the animation tools available in Expression Blend.

Lawrence Moroney

MSDN Magazine August 2008

Silverlight: Create a Custom Expression Encoder Publishing Plug-In


Laurence Moroney demonstrates how to employ the Expression Encoder plug-in APIs by building and debugging a simple FTP upload plug-in.

Laurence Moroney

MSDN Magazine February 2008

Hanselminutes Podcast 227 - Inside Expression SuperPreview with developer Mike Calvo

Scott talks to Mike Calvo, a Microsoft Lead Developer based out of Minnesota (!) about Expression SuperPreview. SuperPreview helps developers and designers with cross-browser CSS and HTML issues. How'd they build it and with what? What's inside? How does the cloud fit in and how do they support Safari? I played with SuperPreview a bit last year, but started looking at it again last month when I noticed that version 4 has introduced support for Safari on Mac via a Cloud-based Remote Service. I fired up Expression SuperPreview 4, and saw this: Then I signed up: Which enabled Mac Safari for this initial beta. I assume they'll add a pile of other browsers. If I don't see immediate browser support for ALynx, the Amiga port of Unix...(read more)

Help with regular expression


I am using this regular expression: /.*-lyrics-.*$

and I need the expression find urls like this:

and it do really does that!

The problem is that it finds also this URL:

Whar regular expression should I use to exclude urls that end with /lyrics ?

Thanks :]



Regular Expression to Match


Here is the kind of text I want to match via a regular Expression

The id="dgSchedule" is always present in the TAG but its location may differ

The table is span over multiple line/contains white spaces/tabs...

I have the regular expression to match the start and end tag respectively over a single line

\<table .*\>


The problem is to match the whole table span over multiple lines

<table cellspacing="0" rules="all" border="1" id="dgSchedule" style="border-style:None;height:100%;width:100%;border-collapse:collapse;">
	<tr class="blackbar" align="center" style="background-color:#7FB4DE;font-family:Verdana;font-weight:bold;height:20px;">
		<td>From Place</td><td>To Place</td><td>Time</td><td>Bus Type</td>

	</tr><tr style="background-color:#DEECF5;">
	</tr><tr style="background-color:#EFF5FA;">
	</tr><tr style="background-color:#DEECF5;">

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend