CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

MS SQL 2008 on ASP.NET Hosting



Zone: > NEWSGROUP > Asp.Net Forum > visual_studio.visual_studio_2005 Tags:
Item Type: NewsGroup Date Entered: 9/30/2005 11:39:56 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 4 Views: 32 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
5 Items, 1 Pages 1 |< << Go >> >|
eltonho
Asp.Net User
Inline expression9/30/2005 11:39:56 AM

0/0

Hi all,

I am going to the visibility of a panel control based on a viewstate like this <asp:Panel id="Panel1" runat="server" visible='<%= ((String)ViewState["Mode"] == "New") %>' />

 

However, it does not work. Is the problem a syntax error or we cannot refer viewstate variable in inline expression?

 

Thanks,

Elton

alexgav
Asp.Net User
Re: Inline expression9/30/2005 5:35:16 PM

0/0

Hi Elton,

Unfortunately, you cannot have code exressions in attributes of ASP.NET server controls due to the way page is processed and executed.

Your best bet would be probably putting that code inside of Page_Load event handler. Something like

Panel1.Visible = ((String)ViewState["Mode"] == "New")

Thanks,
Alex


This posting is provided "AS IS" with no warranties, and confers no rights.
Luis Abreu
Asp.Net User
Re: Inline expression9/30/2005 7:04:59 PM

0/0

Hello Alex.

can you give me more info on that? I think that the following page is correct and works:

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

protected override void OnLoad( EventArgs args )

{

base.OnLoad( args);

//remove comment to show panel

//ViewState["howdy"] = "JJ";

mypanel.DataBind();

}

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">

<title>Untitled Page</title>

</head>

<body>

<form id="form1" runat="server">

<div>

<asp:Panel runat="server" ID="mypanel" Visible='<%# ViewState["howdy"] != null && (string)(ViewState["howdy"]) == "JJ"%>'>

howdy from panel!

</asp:Panel>

</div>

</form>

</body>

</html>


--
Regards,
Luis Abreu
email: labreu_at_gmail.com
PT blog: http://weblogs.pontonetpt.com/luisabreu
EN blog:http://msmvps.com/blogs/luisabreu
http://www.pontonetpt.com
http://weblogs.pontonetpt.com/
alexgav
Asp.Net User
Re: Inline expression9/30/2005 8:39:07 PM

0/0

Hi Luis,

I was talking about code expressions vs. databinding expressions. I.e., <%= vs. <%#.

While your sample works, I find that it would be simpler to set Panel1.Visible in Page_Load, rather than having code in two places. That will also keep your markup cleaner. Since we have nice object model for server controls, I try to use that when I can, and let the control generate HTML for me.

Hope that makes sense :-)

Thanks,
Alex
This posting is provided "AS IS" with no warranties, and confers no rights.
Luis Abreu
Asp.Net User
Re: Inline expression9/30/2005 9:39:06 PM

0/0

Hello Alex.

i'm just glad that at least one of us is able to see correctly :P (unfortunatelly, it seems like i'm the one that needs to go to the doctor).

yes, you're absolutly right. as you can guess, i read  <%# instead of <%= and yes your approach is the one i'd use if i needed to...
--
Regards,
Luis Abreu
email: labreu_at_gmail.com
PT blog: http://weblogs.pontonetpt.com/luisabreu
EN blog:http://msmvps.com/blogs/luisabreu
http://www.pontonetpt.com
http://weblogs.pontonetpt.com/
5 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
SDL 2001: Meeting UML, 10th International SDL Forum Copenhagen, Denmark, June 27-29, 2001 : Proceedings Authors: Rick Reed, Pages: 437, Published: 2001
UML 2000--the Unified Modeling Language: Advancing the Standard : Third International Conference, York, UK, October 2-6, 2000 : Proceedings Authors: Andy Evans, Stuart John Harding Kent, Bran Selic, Pages: 572, Published: 2000
Expert SQL Server 2005 Development Authors: Adam Machanic, Hugo Kornelis, Lara Rubbelke, Pages: 449, Published: 2007
Microsoft Jscript.Net Programming Authors: Justin Rogers, Pages: 360, Published: 2001
Core Internet Application Development with ASP.NET 2.0 Authors: Randy Connolly, Pages: 1049, Published: 2007
Testing of Communicating Systems: 15th IFIP International Conference, TestCom 2003, Sophia Antipolis, France, May 26-28 2003 : Proceedings Authors: Dieter Hogrefe, Anthony Wiles, Pages: 310, Published: 2003
Software Security: Building Security in Authors: Gary McGraw, Pages: 408, Published: 2006
Build Your Own ASP.NET Website Using C# & VB.NET Authors: Zak Ruvalcaba, Pages: 746, Published: 2004
SDL '97: Time for Testing SDL, MSC and Trends : Proceedings of the Eighth SDL Forum, Evry, France, 23-26 September, 1997 Authors: Ana Cavalli, Amardeo Sarma, Pages: 564, Published: 1997
Telecommunications and Beyond: The Broader Applicability of SDL and MSC : Third International Workshop, SAM 2002, Aberystwyth, UK, June 24-26, 2002 : Revised Papers Authors: Edel Sherratt, Pages: 252, Published: 2002

Web:
Code Render Blocks Code render blocks define inline code or inline expressions that execute when the page is rendered. There are two styles of code render blocks: inline code ...
Code Render Blocks Defines inline code or inline expressions that execute when the page is rendered . There are two styles: inline code and inline expressions. ...
Inline Expression Resolution Talk about Inline Expression Resolution. ... in aspx, the inline expression are evaluated when the page is compiled the first time. ...
Best practice: Using inline expressions for simple equations When you are coding an expression in the visual snippet editor, there are a couple different ways that you can compose the expression.
Inline expression - ASP.NET Forums Inline expression. Last post 09-30-2005 5:39 PM by Luis Abreu. 4 replies. Sort Posts:. Oldest to newest, Newest to oldest ...
Where did the time go? - LINQ: Refactoring Inline Instantiation As we move up the scale the refactored code does consistently outperform the inline expression. This outcome was different from my initial hypothesis. ...
pop11 help inline At this point, every occurrence of one of the parameters in the inline expression will be replaced by the textual items read for that parameter with the ...
Inline expressions in HTML erb files still including newlines ... There are no gaps in the layouts/_mainnavigation.html.erb file between the scriptlet and the inline expression that writes out the s ...
/branches/Couenne/Couenne/src/expression/exprVar.hpp - Bonmin - Trac 99, virtual inline expression *simplify (). 100, {return NULL;}. 101. 102, /// get a measure of "how linear" the expression is (see CouenneTypes.h) ...
MatLab problem - inline function zero finder - Icrontic Forums FZERO cannot continue because user supplied inline object ==> H failed with the error below. Error using ==> inlineeval Error in inline expression ...

Videos:
EXPRESSION CREW "MARIONETTE" PERFORMANCE FREESTYLE KOREA BBOY EXPRESSION CREW "MARIONETTE" PERFORMANCE
Death Appears Behind You - Video Gag - GristleDrip.com Video gag in a supermarket - the Grim Reaper appears behind you in line. Look at the expression on the second guy's face. funny bit.
Show variable values in-line with the code The user looks at the value of a variable by clicking on it. http://codeinvestigator.googlepages.com/main
Show the value of conditions in-line with the code The user looks a the value of a condition by clicking on it. In this case the 'if' and 'else'. The region that is affected by the condition is highli...
"World Extreme Games: Skate Vert" EZTakes Trailer Watch this trailer and then go to www.eztakes.com to download the full movie to a DVD that you can watch on your DVD player and keep forever. The Wo...
Jeff Stockwell - sixwonsix - in code [Inline] In Code - SIXWONSIX Team Video
code 2 trailer hungarian inline skate video trailer
Aaron.TV 2006.04.21 Woking, England Follow Aaron in his daily adventures. Filmed in HD. Entire series available at http://aaron.tv Friday April 21, 2006 Woking, England How exciting...
WP Penal Code Forum - Sylvia Lim 1 In Nov 2006, the government floated a draft Penal Code Amendment Bill and called for public comment. The Penal Code reflects our rights and responsib...
Free Adobe Flex Photo Viewer on Google Code This is a simple Adobe Flex Photo Viewer. It uses a number of techniques that are not found in any one place in the literature - data shorting, tile ...




Search This Site:










huge wait when switching to design view.

mcts self paced training kit: microsoft.net framework 2.0 application development foundation (pro-developer)

when working with vista vs2005 the flickering from administrator poup is anoying

typed data set designer

vsts developer - testing question

building .net solutions via the command line (w/out visual studio installed)

vs2005 deployment

constantly messing up my "nice" html

iis vs built-in webserver problem

order of document tabs in vs 2005

vs with custom resource provider

no asix file in vs2005 ctp-feb ?

how to compile aspx's in vs2005

gacutil question

page doesnt update

version compare help

customize vs2005 toolbox

send email to different domain

customer webeventprovider dll error (cannot load type)

server error in '/' application.

asp.net licensing issue

dataset designer wont work

find (also "find and replace") not working in visual studio

help ! can i reuse dropdownlist in edititemtemplate

style quickly flash then closes...how to resolve that?

how to

problem when deploying web application project over vs2005 web site project

urgent!!! problem with wse 3.0 when invoke a web service in wse 2.0

how to dist between 'web forms' and 'html' controls in vs 2005 ide

unable to connect to the web server.

  Privacy | Contact Us
All Times Are GMT