473,320 Members | 1,953 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

2.0 Processiing Model Seriously Flawed?

Simply a postulation but consider the following...

// breaks when declared in content page that uses a MasterPage
<img src="App_Themes/SmokeAndGlass/Images/smoke_METRO184x26.gif" />

// must run as a web server control
<img src="App_Themes/SmokeAndGlass/Images/smoke_METRO184x26.gif"
runat="server" />

However... When we want to change themes dynamically how do we modify the
value of the path for the src attribute at runtime? In ASP we used
Response.Write code blocks <%= %> the .NET equivalent of which are not
allowed in web server control declarations hence the postulation as we are
apparently missing the functional construct.

What I thought I need is the following in my HTML...

<img src="App_Themes/<%= Request.Cookies["themeName"].Value; %>/Images/<%=
Request.Cookies["themePrefix"].Value; %>METRO184x26.gif" />
runat="server" />

I've tried different quoting types but I'm not getting it right.
I've tried a binding syntax <%# %> and am not getting it right.

Surely this is me as I can't imagine the design of 2.0 is this seriously
flawed that the entire img element would have to be built in code when using
MasterPages that require dynamic Theme selections.

<%= Clinton Gallagher


Nov 19 '05 #1
9 1279
Excuse me but one of my statements needs to be corrected.

Wrong:
// breaks when declared in content page that uses a MasterPage

Right:
// breaks content page display when declared in the MasterPage

<%= Clinton Gallagher

"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com> wrote in message
news:e$**************@TK2MSFTNGP14.phx.gbl...
Simply a postulation but consider the following...

// breaks when declared in content page that uses a MasterPage
<img src="App_Themes/SmokeAndGlass/Images/smoke_METRO184x26.gif" />

// must run as a web server control
<img src="App_Themes/SmokeAndGlass/Images/smoke_METRO184x26.gif"
runat="server" />

However... When we want to change themes dynamically how do we modify the
value of the path for the src attribute at runtime? In ASP we used
Response.Write code blocks <%= %> the .NET equivalent of which are not
allowed in web server control declarations hence the postulation as we are
apparently missing the functional construct.

What I thought I need is the following in my HTML...

<img src="App_Themes/<%= Request.Cookies["themeName"].Value; %>/Images/<%=
Request.Cookies["themePrefix"].Value; %>METRO184x26.gif" />
runat="server" />

I've tried different quoting types but I'm not getting it right.
I've tried a binding syntax <%# %> and am not getting it right.

Surely this is me as I can't imagine the design of 2.0 is this seriously
flawed that the entire img element would have to be built in code when
using MasterPages that require dynamic Theme selections.

<%= Clinton Gallagher


Nov 19 '05 #2
Hello,

Try give your image control an Id then use it to change the src in the
code.

Now suppose you want to change an image:
In HTML:
<img id="img_1"
src="App_Themes/SmokeAndGlass/Images/smoke_METRO184x26.gif" runat="server"/>

At codebehind:
img_1.Src = "App_Themes/" & Request.Cookies["themeName"].Value &
"/Images/" & _
Request.Cookies["themePrefix"].Value & "METRO184x26.gif"

Since .NET framework is Object-Oriented in nature, for good coding style
use <%= %> as few as possible.

Regards,
Lau Lei Cheong

"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com> ¼¶¼g©ó¶l¥ó·s»D:e$**************@TK2MSFTNGP14.phx.g bl...
Simply a postulation but consider the following...

// breaks when declared in content page that uses a MasterPage
<img src="App_Themes/SmokeAndGlass/Images/smoke_METRO184x26.gif" />

// must run as a web server control
<img src="App_Themes/SmokeAndGlass/Images/smoke_METRO184x26.gif"
runat="server" />

However... When we want to change themes dynamically how do we modify the
value of the path for the src attribute at runtime? In ASP we used
Response.Write code blocks <%= %> the .NET equivalent of which are not
allowed in web server control declarations hence the postulation as we are
apparently missing the functional construct.

What I thought I need is the following in my HTML...

<img src="App_Themes/<%= Request.Cookies["themeName"].Value; %>/Images/<%=
Request.Cookies["themePrefix"].Value; %>METRO184x26.gif" />
runat="server" />

I've tried different quoting types but I'm not getting it right.
I've tried a binding syntax <%# %> and am not getting it right.

Surely this is me as I can't imagine the design of 2.0 is this seriously
flawed that the entire img element would have to be built in code when
using MasterPages that require dynamic Theme selections.

<%= Clinton Gallagher


Nov 19 '05 #3
Thanks for responding. I knew I could change the src attributes in code but
I'm still not ready to give up on what is supposed to be the new declarative
model. For example, I just looked up the new expression syntax [1].

That may allow me to use <%$ expression %> for the purpose I am interested
in but I don't understand how it can be used yet because I am still getting
server control not well formed errors...

<%= Clinton Gallagher

[1]
http://beta.asp.net/QUICKSTARTV20/as...px#expressions
"Lau Lei Cheong" <le****@yehoo.com.hk> wrote in message
news:ez**************@TK2MSFTNGP14.phx.gbl...
Hello,

Try give your image control an Id then use it to change the src in the
code.

Now suppose you want to change an image:
In HTML:
<img id="img_1"
src="App_Themes/SmokeAndGlass/Images/smoke_METRO184x26.gif"
runat="server"/>

At codebehind:
img_1.Src = "App_Themes/" & Request.Cookies["themeName"].Value &
"/Images/" & _
Request.Cookies["themePrefix"].Value & "METRO184x26.gif"

Since .NET framework is Object-Oriented in nature, for good coding
style use <%= %> as few as possible.

Regards,
Lau Lei Cheong

"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com>
¼¶¼g©ó¶l¥ó·s»D:e$**************@TK2MSFTNGP14.phx.g bl...
Simply a postulation but consider the following...

// breaks when declared in content page that uses a MasterPage
<img src="App_Themes/SmokeAndGlass/Images/smoke_METRO184x26.gif" />

// must run as a web server control
<img src="App_Themes/SmokeAndGlass/Images/smoke_METRO184x26.gif"
runat="server" />

However... When we want to change themes dynamically how do we modify the
value of the path for the src attribute at runtime? In ASP we used
Response.Write code blocks <%= %> the .NET equivalent of which are not
allowed in web server control declarations hence the postulation as we
are apparently missing the functional construct.

What I thought I need is the following in my HTML...

<img src="App_Themes/<%= Request.Cookies["themeName"].Value;
%>/Images/<%= Request.Cookies["themePrefix"].Value; %>METRO184x26.gif" />
runat="server" />

I've tried different quoting types but I'm not getting it right.
I've tried a binding syntax <%# %> and am not getting it right.

Surely this is me as I can't imagine the design of 2.0 is this seriously
flawed that the entire img element would have to be built in code when
using MasterPages that require dynamic Theme selections.

<%= Clinton Gallagher



Nov 19 '05 #4
Clinton,

I see your point, yet I my brain still find it difficult to debug in
some case. (e.g.: one of my site keep getting viewstate related exceptions
on clients running IE5 in MacPPC, and still can't figure out why.) :)

Back to the question, I think you may try to add Id to the webcontrol as
it's anyway essential for further control of the object in server-side. And
I suggest you check the Request.Cookies["themeName"].Value and
Request.Cookies["themePrefix"].Value is initialized when the page is
rendering. I have no idea how .NET will deal with it if .NET see it's a
"nothing" value.

Regards,
Lau Lei Cheong

"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com> ¼¶¼g©ó¶l¥ó·s»D:uj**************@TK2MSFTNGP15.phx.g bl...
Thanks for responding. I knew I could change the src attributes in code
but I'm still not ready to give up on what is supposed to be the new
declarative model. For example, I just looked up the new expression syntax
[1].

That may allow me to use <%$ expression %> for the purpose I am
interested in but I don't understand how it can be used yet because I am
still getting server control not well formed errors...

<%= Clinton Gallagher

[1]
http://beta.asp.net/QUICKSTARTV20/as...px#expressions
"Lau Lei Cheong" <le****@yehoo.com.hk> wrote in message
news:ez**************@TK2MSFTNGP14.phx.gbl...
Hello,

Try give your image control an Id then use it to change the src in the
code.

Now suppose you want to change an image:
In HTML:
<img id="img_1"
src="App_Themes/SmokeAndGlass/Images/smoke_METRO184x26.gif"
runat="server"/>

At codebehind:
img_1.Src = "App_Themes/" & Request.Cookies["themeName"].Value &
"/Images/" & _
Request.Cookies["themePrefix"].Value & "METRO184x26.gif"

Since .NET framework is Object-Oriented in nature, for good coding
style use <%= %> as few as possible.

Regards,
Lau Lei Cheong

"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com> ¼¶¼g©ó¶l¥ó·s»D:e$**************@TK2MSFTNGP14.phx.g bl...
Simply a postulation but consider the following...

// breaks when declared in content page that uses a MasterPage
<img src="App_Themes/SmokeAndGlass/Images/smoke_METRO184x26.gif" />

// must run as a web server control
<img src="App_Themes/SmokeAndGlass/Images/smoke_METRO184x26.gif"
runat="server" />

However... When we want to change themes dynamically how do we modify
the value of the path for the src attribute at runtime? In ASP we used
Response.Write code blocks <%= %> the .NET equivalent of which are not
allowed in web server control declarations hence the postulation as we
are apparently missing the functional construct.

What I thought I need is the following in my HTML...

<img src="App_Themes/<%= Request.Cookies["themeName"].Value;
%>/Images/<%= Request.Cookies["themePrefix"].Value; %>METRO184x26.gif"
/>
runat="server" />

I've tried different quoting types but I'm not getting it right.
I've tried a binding syntax <%# %> and am not getting it right.

Surely this is me as I can't imagine the design of 2.0 is this seriously
flawed that the entire img element would have to be built in code when
using MasterPages that require dynamic Theme selections.

<%= Clinton Gallagher




Nov 19 '05 #5


Most of ASP.NET is conceptually flawed architecture and implementation.
Which is a shame because almost everything else .NET is excellent.

When I read good specifications I feel happy :)
When I saw the flawed approach to ASP.NET I felt sad :(
clintonG wrote:
Simply a postulation but consider the following...

// breaks when declared in content page that uses a MasterPage
<img src="App_Themes/SmokeAndGlass/Images/smoke_METRO184x26.gif" />

// must run as a web server control
<img src="App_Themes/SmokeAndGlass/Images/smoke_METRO184x26.gif"
runat="server" />

However... When we want to change themes dynamically how do we modify the
value of the path for the src attribute at runtime? In ASP we used
Response.Write code blocks <%= %> the .NET equivalent of which are not
allowed in web server control declarations hence the postulation as we are
apparently missing the functional construct.

What I thought I need is the following in my HTML...

<img src="App_Themes/<%= Request.Cookies["themeName"].Value; %>/Images/<%=
Request.Cookies["themePrefix"].Value; %>METRO184x26.gif" />
runat="server" />

I've tried different quoting types but I'm not getting it right.
I've tried a binding syntax <%# %> and am not getting it right.

Surely this is me as I can't imagine the design of 2.0 is this seriously
flawed that the entire img element would have to be built in code when using
MasterPages that require dynamic Theme selections.

<%= Clinton Gallagher


Nov 19 '05 #6
We are all on a bummer ;-)

<%= Clinton Gallagher

"John Rivers" <fi*****@btinternet.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...


Most of ASP.NET is conceptually flawed architecture and implementation.
Which is a shame because almost everything else .NET is excellent.

When I read good specifications I feel happy :)
When I saw the flawed approach to ASP.NET I felt sad :(
clintonG wrote:
Simply a postulation but consider the following...

// breaks when declared in content page that uses a MasterPage
<img src="App_Themes/SmokeAndGlass/Images/smoke_METRO184x26.gif" />

// must run as a web server control
<img src="App_Themes/SmokeAndGlass/Images/smoke_METRO184x26.gif"
runat="server" />

However... When we want to change themes dynamically how do we modify the
value of the path for the src attribute at runtime? In ASP we used
Response.Write code blocks <%= %> the .NET equivalent of which are not
allowed in web server control declarations hence the postulation as we
are
apparently missing the functional construct.

What I thought I need is the following in my HTML...

<img src="App_Themes/<%= Request.Cookies["themeName"].Value;
%>/Images/<%=
Request.Cookies["themePrefix"].Value; %>METRO184x26.gif" />
runat="server" />

I've tried different quoting types but I'm not getting it right.
I've tried a binding syntax <%# %> and am not getting it right.

Surely this is me as I can't imagine the design of 2.0 is this seriously
flawed that the entire img element would have to be built in code when
using
MasterPages that require dynamic Theme selections.

<%= Clinton Gallagher

Nov 19 '05 #7
When the HTML img control has no id defined the compiler or the designer
(who knows which one) creates an id and modifies the HTML naming the
id="image1" for example (as I recall).

I understand I need to id my controls if I intend to get or set properties
in code. Many times the same image needs to be used more than once in the
same page. That will require writing code that creatres a control hierarchy
for a given control type and all of the code required to manage that
process. I have other plans for the rest of my life.

<%= Clinton Gallagher

"Lau Lei Cheong" <le****@yehoo.com.hk> wrote in message
news:eT**************@TK2MSFTNGP10.phx.gbl...
Clinton,

I see your point, yet I my brain still find it difficult to debug in
some case. (e.g.: one of my site keep getting viewstate related exceptions
on clients running IE5 in MacPPC, and still can't figure out why.) :)

Back to the question, I think you may try to add Id to the webcontrol
as it's anyway essential for further control of the object in server-side.
And I suggest you check the Request.Cookies["themeName"].Value and
Request.Cookies["themePrefix"].Value is initialized when the page is
rendering. I have no idea how .NET will deal with it if .NET see it's a
"nothing" value.

Regards,
Lau Lei Cheong

"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com>
¼¶¼g©ó¶l¥ó·s»D:uj**************@TK2MSFTNGP15.phx.g bl...
Thanks for responding. I knew I could change the src attributes in code
but I'm still not ready to give up on what is supposed to be the new
declarative model. For example, I just looked up the new expression
syntax [1].

That may allow me to use <%$ expression %> for the purpose I am
interested in but I don't understand how it can be used yet because I am
still getting server control not well formed errors...

<%= Clinton Gallagher

[1]
http://beta.asp.net/QUICKSTARTV20/as...px#expressions
"Lau Lei Cheong" <le****@yehoo.com.hk> wrote in message
news:ez**************@TK2MSFTNGP14.phx.gbl...
Hello,

Try give your image control an Id then use it to change the src in
the code.

Now suppose you want to change an image:
In HTML:
<img id="img_1"
src="App_Themes/SmokeAndGlass/Images/smoke_METRO184x26.gif"
runat="server"/>

At codebehind:
img_1.Src = "App_Themes/" & Request.Cookies["themeName"].Value &
"/Images/" & _
Request.Cookies["themePrefix"].Value & "METRO184x26.gif"

Since .NET framework is Object-Oriented in nature, for good coding
style use <%= %> as few as possible.

Regards,
Lau Lei Cheong

"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com>
¼¶¼g©ó¶l¥ó·s»D:e$**************@TK2MSFTNGP14.phx.g bl...
Simply a postulation but consider the following...

// breaks when declared in content page that uses a MasterPage
<img src="App_Themes/SmokeAndGlass/Images/smoke_METRO184x26.gif" />

// must run as a web server control
<img src="App_Themes/SmokeAndGlass/Images/smoke_METRO184x26.gif"
runat="server" />

However... When we want to change themes dynamically how do we modify
the value of the path for the src attribute at runtime? In ASP we used
Response.Write code blocks <%= %> the .NET equivalent of which are not
allowed in web server control declarations hence the postulation as we
are apparently missing the functional construct.

What I thought I need is the following in my HTML...

<img src="App_Themes/<%= Request.Cookies["themeName"].Value;
%>/Images/<%= Request.Cookies["themePrefix"].Value; %>METRO184x26.gif"
/>
runat="server" />

I've tried different quoting types but I'm not getting it right.
I've tried a binding syntax <%# %> and am not getting it right.

Surely this is me as I can't imagine the design of 2.0 is this
seriously flawed that the entire img element would have to be built in
code when using MasterPages that require dynamic Theme selections.

<%= Clinton Gallagher





Nov 19 '05 #8

What I would do is get rid of the hard coded src and use the SkinID
feature, e.g, use the following in ASPX:

<asp:Image ID="Image1" runat="server" SkinID="metroimage"/>

and use the following in a skin file for each theme:

<asp:image runat="server"
Imageurl="Images/smoke_METRO184x26.gif"
skinid="metroimage" />
The theming and skinning infrastructure takes care of all the details
for you.

Themes In ASP.NET 2.0
http://odetocode.com/Articles/423.aspx

--
Scott
http://www.OdeToCode.com/blogs/scott/
On Wed, 24 Aug 2005 20:20:31 -0500, "clintonG"
<cs*********@REMOVETHISTEXTmetromilwaukee.com> wrote:
Simply a postulation but consider the following...

// breaks when declared in content page that uses a MasterPage
<img src="App_Themes/SmokeAndGlass/Images/smoke_METRO184x26.gif" />

// must run as a web server control
<img src="App_Themes/SmokeAndGlass/Images/smoke_METRO184x26.gif"
runat="server" />

However... When we want to change themes dynamically how do we modify the
value of the path for the src attribute at runtime? In ASP we used
Response.Write code blocks <%= %> the .NET equivalent of which are not
allowed in web server control declarations hence the postulation as we are
apparently missing the functional construct.

What I thought I need is the following in my HTML...

<img src="App_Themes/<%= Request.Cookies["themeName"].Value; %>/Images/<%=
Request.Cookies["themePrefix"].Value; %>METRO184x26.gif" />
runat="server" />

I've tried different quoting types but I'm not getting it right.
I've tried a binding syntax <%# %> and am not getting it right.

Surely this is me as I can't imagine the design of 2.0 is this seriously
flawed that the entire img element would have to be built in code when using
MasterPages that require dynamic Theme selections.

<%= Clinton Gallagher



Nov 19 '05 #9
You were correct Scott and I've reverted to the use of server controls and
SkinID as a tactic for managing images used in Themes.

<%= Clinton Gallagher
"Scott Allen" <sc***@nospam.odetocode.com> wrote in message
news:4h********************************@4ax.com...

What I would do is get rid of the hard coded src and use the SkinID
feature, e.g, use the following in ASPX:

<asp:Image ID="Image1" runat="server" SkinID="metroimage"/>

and use the following in a skin file for each theme:

<asp:image runat="server"
Imageurl="Images/smoke_METRO184x26.gif"
skinid="metroimage" />
The theming and skinning infrastructure takes care of all the details
for you.

Themes In ASP.NET 2.0
http://odetocode.com/Articles/423.aspx

--
Scott
http://www.OdeToCode.com/blogs/scott/
On Wed, 24 Aug 2005 20:20:31 -0500, "clintonG"
<cs*********@REMOVETHISTEXTmetromilwaukee.com> wrote:
Simply a postulation but consider the following...

// breaks when declared in content page that uses a MasterPage
<img src="App_Themes/SmokeAndGlass/Images/smoke_METRO184x26.gif" />

// must run as a web server control
<img src="App_Themes/SmokeAndGlass/Images/smoke_METRO184x26.gif"
runat="server" />

However... When we want to change themes dynamically how do we modify the
value of the path for the src attribute at runtime? In ASP we used
Response.Write code blocks <%= %> the .NET equivalent of which are not
allowed in web server control declarations hence the postulation as we are
apparently missing the functional construct.

What I thought I need is the following in my HTML...

<img src="App_Themes/<%= Request.Cookies["themeName"].Value; %>/Images/<%=
Request.Cookies["themePrefix"].Value; %>METRO184x26.gif" />
runat="server" />

I've tried different quoting types but I'm not getting it right.
I've tried a binding syntax <%# %> and am not getting it right.

Surely this is me as I can't imagine the design of 2.0 is this seriously
flawed that the entire img element would have to be built in code when
using
MasterPages that require dynamic Theme selections.

<%= Clinton Gallagher


Nov 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: democratix | last post by:
1 - Open Source Software Development (OSSD) is inherently a meritocracy. Bigger, better contributions earn you more power and status. 2 - OSSD accepts the individuality of individual...
7
by: pysim | last post by:
Hi, I have a couple of general requests for pointers to python examples and design advice. I'm looking for examples of MVC-based GUI controls done in python (model-view-controller). Also,...
12
by: Steven T. Hatton | last post by:
This is the kind of question that is hard to answer for everybody. Different people think differently. I often stumble where others don't. And I often stroll through what others find hard. I am...
5
by: clintonG | last post by:
I'm looking for documentation and would not turn my nose up to any code from anybody who thinks they are good at the design of an algorythm that can be used to generated a hierarchical relational...
3
by: MrNobody | last post by:
I am developing an application that has several multi threaded tasks where one thread is doing IO and another thread is grabbing data from the first thread to process it further. I've been...
50
by: Shadow Lynx | last post by:
Consider this simple HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 STRICT//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head>...
122
by: Edward Diener No Spam | last post by:
The definition of a component model I use below is a class which allows properties, methods, and events in a structured way which can be recognized, usually through some form of introspection...
97
by: Master Programmer | last post by:
An friend insider told me that VB is to be killled off within 18 months. I guess this makes sence now that C# is here. I believe it and am actualy surprised they ever even included it in VS 2003 in...
11
by: Weston Weems | last post by:
I've got the need to have user information for logged in user in a readily avaliable page context (a lot like how Profile is) except not suck. Before we jump to any conclusions, from what I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.