CodeVerge.Net Beta


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

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 7/28/2005 9:23:16 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 33 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
eltonho
Asp.Net User
Inline databind7/28/2005 9:23:16 AM

0/0

Hi All,

My MasterPage has an image control like this <asp:image id="image1" imageurl=<%= _pageimage %> runat="server">. The parameter is expected to be provided by the webpage using this master layout.

However, I found that those page using this master layout cannot render the image properly. At design mode, there is an error like this:
"Error Rendering Control - Image1 An unhandled exception has occured. Illegal characters in path." What's going wrong?

I have tried to put the binding in Page_Load (i.e. under Page_Load procedure, Image1.imageurl = _pageimage;) then it works. Does it mean inline binding does not work in masterpage?

 

Thanks,

Elton.

BrockAllen
Asp.Net User
Re: Inline databind7/28/2005 2:36:14 PM

0/0

This syntax isn't going to work properly:

<asp:image id="image1" imageurl=<%= _pageimage %> runat="server">

Because the declarative <asp:Image> tag creates an image and assigns all of those properties early in the page processing. The <%=  %> syntax essentially does Response.Write at Rendering time which is much later in the lifecycle of the page. IOW, Response.Write doesn't assign into the ImageUrl property of the Image control. You should create a property on the Master called ImageUrl and when it's set you set the proprty on the Image control. Then from the Page, use <%@ MasterType %> to get a strongly typed reference to the master, then i Page_Load call Master.ImageUrl = "foo.jpg", which will call the set property on the master, which will pass thru to the Image.

-Brock

DevelopMentor
http://staff.develop.com/ballen
eltonho
Asp.Net User
Re: Inline databind7/29/2005 12:25:29 AM

0/0

Hi Brock,

Actually, I think I am doing the same thing you mentioned.

In the master page, I have:
private string _pageimage;

public string PageImage

{
get{return _pageimage;}
set (_pageimage = value;}
}

In the webpage using that master page, I have

Page_Load{
Master.PageImage = "~/images/abc.gif";
}

Is that what you recommended? The error is shown in the Design mode and the above code does not work in runtime.

Thanks in advance.

Regards,
Elton

 

BrockAllen
Asp.Net User
Re: Inline databind7/29/2005 1:36:05 AM

0/0

Not quite -- when you set Master.PageImage it sets the sting. But when does that string get set into the Image?

To make sure, make the property set directly into the Image.

-Brock

 


DevelopMentor
http://staff.develop.com/ballen
4 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Beginning ASP.NET 2.0 Databases: From Novice to Professional Authors: Damien Foggon, Pages: 625, Published: 2006
Beginning ASP.NET 1.1 Databases: From Novice to Professional Authors: Damien Foggon, Daniel Maharry, Pages: 600, Published: 2004
Professional ASP.NET 1.0: Updated and Tested for Final Release of ASP.NET V.1.0 Authors: Richard Anderson, Alex Homer, Dave Sussman, Karli Watson, Pages: 1354, Published: 2002
ASP.NET by Example Authors: Steven A. Smith, Pages: 552, Published: 2002
ASP.NET: Tips, Tutorials, and Code Authors: Scott Mitchell, Pages: 878, Published: 2002
Professional ASP.NET 1.1 Authors: Alex Homer, Dave Sussman, Rob Howard, Brian Francis, Karli Watson, Richard Anderson, Pages: 1337, Published: 2004
Professional ASP.NET 2.0 Authors: Bill Evjen, Scott Hanselman, Farhan Muhammad, Srinivasa Sivakumar, Devin Rader, Pages: 1253, Published: 2005
ASP.NET Web Development with Macromedia Dreamweaver MX 2004 Authors: Costas Hadjisotiriou, Kevin Marshall, Rachel Andrew, Pages: 405, Published: 2004
C# for Programmers: Updated for C# 2.0 Authors: Paul J. Deitel, Pages: 1317, Published: 2005
Visual C# 2005: How to Program Authors: Harvey M. Deitel, Paul J. Deitel, Pages: 1591, Published: 2006

Web:
Mastering ASP.Net DataBinding Inline. While binding its possible to do simple formatting directly in the databinding expression or by calling functions which reside in codebehind. ...
Inline databind - ASP.NET Forums Inline databind. Last post 07-28-2005 9:36 PM by BrockAllen. 3 replies. Sort Posts:. Oldest to newest, Newest to oldest ...
DataBind Inline Function Call - ASP.NET Forums DataBind Inline Function Call. Last post 08-10-2008 11:27 PM by Samu ... I am trying to call a function using inline code when i bind a ...
Microsoft Certified Professional Magazine Online | Feature Article ... Next, switch back to the ASPX file and note that the rename has not changed the inline databinding line. How has this helped, you're wondering? ...
databinding asp label Talk about databinding asp label. ... Reload this Page databinding asp label ... Inline databinding are only for the simple cases. ...
ASP.NET Data Binding with XML Your browser does not support inline frames or is currently configured not to display ... To bind the DataSet to a RadioButtonList control, first create a ...
Inline and List Binding DataBind() method in the Page that filters down to its children. Try It Out: Inline Binding to a DataSet. Inline binding to values stored in a DataSet works ...
DataGrid and Inline Editing - DevX.com Forums DataBind(); "David Sumner" wrote: > >Having a problem using Inline Editing with the DataGrid. I load the data ...
IndexOutOfBounds on databinding DataRow property on a ascx UserControl which is used to perform databinding to some inline <%# .. %> blocks and you perform the databinding in the ...
OnTheFly PostBack Intersoft's OnTheFly-Postback has been designed to support inline script tag supports as well as inline databinding, inline templates and more. ...

Videos:
Napalm Death - The Chains that Bind Us From the 1990 album "Harmony Corruption" Lyrics: Forced exposure to create what is expected (To face) neglection is the price no-one wants to pay ...
Perfect Binding 'IT'S A BIND' A MEDIA FIRST IN TWO ACTS
Mitt 1985 Romney Girl's remake of the song "1985". Here's the lyrics: Rudy just hit the wall He never had it all Dressed in drag one day and gives pro-choice...
How To Make A Cheap Scrapbook I came up with this idea while standing in line at the grocery store. All you need is paper lunch sacks,tape ( to close the top of the bags) hole pun...
How to Make Money Online (Using Youtube) . Click Below! http://ForceMoney.Weebly.com How to make with OnlineCan money your Web site earn more money? Test Google AdSense - learn more. $500...
Derivin' Dirty Sexiness to the max. Calc class of 08. --- Chorus: They see me rolle'n Integratin' Patrolin' and tryin' to catch me derivin' dirty Tryin' to catch me...
Time and Space I think I wrote this for two of my best friends *cough*mygodthatsoundedsappyletusforgetit*cough* and I just forgot about it and never told them *coug...
Angelspit-Infect Perfect ^.^ Lyrics : Angelspit-Infect Teeth nailing Their own tongues Anger rising up in torn lungs Rack, shackled in torture Severed veins reach ...
Charlie Rose - Rep. Tom Davis / Political Roundtable / A Discussion about France Segment 1: Guest Host Cokie Roberts of ABC News talks to Rep. Tom Davis (R-VA) about the upcoming mid-term elections and the state of the Republican ...




Search This Site:










help with content on masterpage

master pages and menu causes problem with styles

wizard and javascript

sqlsitemapprovider works! - eventually

form names and master pages

master pages

error in content page on changing master page label text

css problem with treeview

treeview find selected node

button in content placeholder is not triggering

page loads multiple times

errors after including master pages

master page class type error

menu selected item

how to display certain levels in a treeview menu?

can this be done ?

menu/treview & multilevel xml

menu control disable hover

error on master page

accessing pictures in themes

web.sitemap and url query parameters

how do i 'override' images using themes

detecting fragment identifier / anchor in url ?

how to apply a css file in a particular content page?

asp.net 2.0 menu hides behind dorpdown list

menu control asp.net 2.0

asp 2.0 beta - masterpages and javascript

has anyone solved the font color bug with the menu control?

masterpage and postback

treeview, ondemand and server side check-boxes

  Privacy | Contact Us
All Times Are GMT