Hi,
Within the HTML if I try to put an if statement, I get an error:
BC30201: Expression expected
This is a simplified example:
<%# If StoreNumber = "1" Then %>
<b>Store1</b>
<%# EndIf %>
Thanks
--
Message posted via http://www.dotnetmonster.com 12 1353
Use <% for code. <%# is for databidning.
As a side note this is a bit old style. I would recommend doing this in code
behing rather than mixing code and HTML as in the pre ASP.NET days...
Patrice
--
"Joe via DotNetMonster.com" <fo***@DotNetMonster.com> a écrit dans le
message de news:21******************************@DotNetMonste r.com... Hi,
Within the HTML if I try to put an if statement, I get an error: BC30201: Expression expected
This is a simplified example:
<%# If StoreNumber = "1" Then %>
<b>Store1</b>
<%# EndIf %>
Thanks
-- Message posted via http://www.dotnetmonster.com
"Patrice" <no****@nowhere.com> wrote in message
news:uZ**************@TK2MSFTNGP10.phx.gbl... Use <% for code. <%# is for databidning.
As a side note this is a bit old style. I would recommend doing this in
code behing rather than mixing code and HTML as in the pre ASP.NET days...
how do you control where the outputted html will show up on the aspx page if
you do this in your code behind? if, for instance, i have a search form and
a search button that executes some sql statements, and all this is handled
in the code behind, how would i go about response.writing the search results
to the bottom of the search page? Patrice
--
"Joe via DotNetMonster.com" <fo***@DotNetMonster.com> a écrit dans le message de news:21******************************@DotNetMonste r.com... Hi,
Within the HTML if I try to put an if statement, I get an error: BC30201: Expression expected
This is a simplified example:
<%# If StoreNumber = "1" Then %>
<b>Store1</b>
<%# EndIf %>
Thanks
-- Message posted via http://www.dotnetmonster.com
use a server control and write to that.
a label is rendered as a <span> tag I think, maybe a <div>, but either way,
that is one way to control where the output goes...
"Dica" <ge*****@hotmail.com> wrote in message
news:Uq********************@rogers.com... "Patrice" <no****@nowhere.com> wrote in message news:uZ**************@TK2MSFTNGP10.phx.gbl... Use <% for code. <%# is for databidning.
As a side note this is a bit old style. I would recommend doing this in code behing rather than mixing code and HTML as in the pre ASP.NET days...
how do you control where the outputted html will show up on the aspx page
if you do this in your code behind? if, for instance, i have a search form
and a search button that executes some sql statements, and all this is handled in the code behind, how would i go about response.writing the search
results to the bottom of the search page?
Patrice
--
"Joe via DotNetMonster.com" <fo***@DotNetMonster.com> a écrit dans le message de news:21******************************@DotNetMonste r.com... Hi,
Within the HTML if I try to put an if statement, I get an error: BC30201: Expression expected
This is a simplified example:
<%# If StoreNumber = "1" Then %>
<b>Store1</b>
<%# EndIf %>
Thanks
-- Message posted via http://www.dotnetmonster.com
"Steve" <ss*@sss.com> wrote in message
news:uU**************@tk2msftngp13.phx.gbl... use a server control and write to that. a label is rendered as a <span> tag I think, maybe a <div>, but either
way, that is one way to control where the output goes...
thanks
"Dica" <ge*****@hotmail.com> wrote in message news:Uq********************@rogers.com... "Patrice" <no****@nowhere.com> wrote in message news:uZ**************@TK2MSFTNGP10.phx.gbl... Use <% for code. <%# is for databidning.
As a side note this is a bit old style. I would recommend doing this
in code behing rather than mixing code and HTML as in the pre ASP.NET days... how do you control where the outputted html will show up on the aspx
page if you do this in your code behind? if, for instance, i have a search form and a search button that executes some sql statements, and all this is
handled in the code behind, how would i go about response.writing the search results to the bottom of the search page?
Patrice
--
"Joe via DotNetMonster.com" <fo***@DotNetMonster.com> a écrit dans le message de news:21******************************@DotNetMonste r.com... > Hi, > > Within the HTML if I try to put an if statement, I get an error: > BC30201: Expression expected > > This is a simplified example: > > <%# If StoreNumber = "1" Then %> > > <b>Store1</b> > > <%# EndIf %> > > Thanks > > -- > Message posted via http://www.dotnetmonster.com
Another way is to use the Literal control. It doesn't put any HTML tags
automatically - you can use it to inject HTML (or text or whatever) directly
into a specific location on your page.
HTH
"Dica" <ge*****@hotmail.com> wrote in message
news:xZ********************@rogers.com... "Steve" <ss*@sss.com> wrote in message news:uU**************@tk2msftngp13.phx.gbl... use a server control and write to that. a label is rendered as a <span> tag I think, maybe a <div>, but either way, that is one way to control where the output goes...
thanks
"Dica" <ge*****@hotmail.com> wrote in message news:Uq********************@rogers.com... > "Patrice" <no****@nowhere.com> wrote in message > news:uZ**************@TK2MSFTNGP10.phx.gbl... > > Use <% for code. <%# is for databidning. > > > > As a side note this is a bit old style. I would recommend doing this in > code > > behing rather than mixing code and HTML as in the pre ASP.NET days... > > how do you control where the outputted html will show up on the aspx page if > you do this in your code behind? if, for instance, i have a search form and > a search button that executes some sql statements, and all this is handled > in the code behind, how would i go about response.writing the search results > to the bottom of the search page? > > > > > Patrice > > > > -- > > > > "Joe via DotNetMonster.com" <fo***@DotNetMonster.com> a écrit dans le > > message de news:21******************************@DotNetMonste r.com... > > > Hi, > > > > > > Within the HTML if I try to put an if statement, I get an error: > > > BC30201: Expression expected > > > > > > This is a simplified example: > > > > > > <%# If StoreNumber = "1" Then %> > > > > > > <b>Store1</b> > > > > > > <%# EndIf %> > > > > > > Thanks > > > > > > -- > > > Message posted via http://www.dotnetmonster.com > > > > > >
Actually you probabaly want a LiteralControl control not a Literal control.
:)
-Brock
DevelopMentor http://staff.develop.com/ballen Another way is to use the Literal control. It doesn't put any HTML tags automatically - you can use it to inject HTML (or text or whatever) directly into a specific location on your page.
HTH
"Dica" <ge*****@hotmail.com> wrote in message news:xZ********************@rogers.com...
"Steve" <ss*@sss.com> wrote in message news:uU**************@tk2msftngp13.phx.gbl... use a server control and write to that. a label is rendered as a <span> tag I think, maybe a <div>, but either way,
that is one way to control where the output goes... thanks
"Dica" <ge*****@hotmail.com> wrote in message news:Uq********************@rogers.com... "Patrice" <no****@nowhere.com> wrote in message news:uZ**************@TK2MSFTNGP10.phx.gbl... > Use <% for code. <%# is for databidning. > > As a side note this is a bit old style. I would recommend doing > this > in
code
> behing rather than mixing code and HTML as in the pre ASP.NET > days... > how do you control where the outputted html will show up on the aspx page
if
you do this in your code behind? if, for instance, i have a search form
and
a search button that executes some sql statements, and all this is handled
in the code behind, how would i go about response.writing the search
results
to the bottom of the search page?
> Patrice > > -- > > "Joe via DotNetMonster.com" <fo***@DotNetMonster.com> a écrit dans > le message de > news:21******************************@DotNetMonste r.com... > >> Hi, >> >> Within the HTML if I try to put an if statement, I get an error: >> BC30201: Expression expected >> >> This is a simplified example: >> >> <%# If StoreNumber = "1" Then %> >> >> <b>Store1</b> >> >> <%# EndIf %> >> >> Thanks >> >> -- Message posted via http://www.dotnetmonster.com >>
I didn't know you would take me literally!
"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:13**********************@msnews.microsoft.com ... Actually you probabaly want a LiteralControl control not a Literal control. :)
-Brock DevelopMentor http://staff.develop.com/ballen Another way is to use the Literal control. It doesn't put any HTML tags automatically - you can use it to inject HTML (or text or whatever) directly into a specific location on your page.
HTH
"Dica" <ge*****@hotmail.com> wrote in message news:xZ********************@rogers.com...
"Steve" <ss*@sss.com> wrote in message news:uU**************@tk2msftngp13.phx.gbl... use a server control and write to that. a label is rendered as a <span> tag I think, maybe a <div>, but either way,
that is one way to control where the output goes...
thanks
"Dica" <ge*****@hotmail.com> wrote in message news:Uq********************@rogers.com... > "Patrice" <no****@nowhere.com> wrote in message > news:uZ**************@TK2MSFTNGP10.phx.gbl... >> Use <% for code. <%# is for databidning. >> >> As a side note this is a bit old style. I would recommend doing >> this >> in
> code > >> behing rather than mixing code and HTML as in the pre ASP.NET >> days... >> > how do you control where the outputted html will show up on the > aspx > page
if
> you do this in your code behind? if, for instance, i have a search > form > and
> a search button that executes some sql statements, and all this is > handled
> in the code behind, how would i go about response.writing the > search > results
> to the bottom of the search page? > >> Patrice >> >> -- >> >> "Joe via DotNetMonster.com" <fo***@DotNetMonster.com> a écrit dans >> le message de >> news:21******************************@DotNetMonste r.com... >> >>> Hi, >>> >>> Within the HTML if I try to put an if statement, I get an error: >>> BC30201: Expression expected >>> >>> This is a simplified example: >>> >>> <%# If StoreNumber = "1" Then %> >>> >>> <b>Store1</b> >>> >>> <%# EndIf %> >>> >>> Thanks >>> >>> -- Message posted via http://www.dotnetmonster.com >>>
Well, the reason it's important is that the Literal holds view state and
for static HTML you don't want this unnecessary overhead.
-Brock
DevelopMentor http://staff.develop.com/ballen I didn't know you would take me literally!
"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message news:13**********************@msnews.microsoft.com ...
Actually you probabaly want a LiteralControl control not a Literal control. :)
-Brock DevelopMentor http://staff.develop.com/ballen Another way is to use the Literal control. It doesn't put any HTML tags automatically - you can use it to inject HTML (or text or whatever) directly into a specific location on your page.
HTH
"Dica" <ge*****@hotmail.com> wrote in message news:xZ********************@rogers.com... "Steve" <ss*@sss.com> wrote in message news:uU**************@tk2msftngp13.phx.gbl... > use a server control and write to that. > a label is rendered as a <span> tag I think, maybe a <div>, but > either way,
> that is one way to control where the output goes... > thanks
> "Dica" <ge*****@hotmail.com> wrote in message > news:Uq********************@rogers.com... >> "Patrice" <no****@nowhere.com> wrote in message >> news:uZ**************@TK2MSFTNGP10.phx.gbl... >>> Use <% for code. <%# is for databidning. >>> >>> As a side note this is a bit old style. I would recommend doing >>> this >>> in
>> code >> >>> behing rather than mixing code and HTML as in the pre ASP.NET >>> days... >>> >> how do you control where the outputted html will show up on the >> aspx >> page
> if > >> you do this in your code behind? if, for instance, i have a >> search form >> > and > >> a search button that executes some sql statements, and all this >> is >> handled
>> in the code behind, how would i go about response.writing the >> search >> > results > >> to the bottom of the search page? >> >>> Patrice >>> >>> -- >>> >>> "Joe via DotNetMonster.com" <fo***@DotNetMonster.com> a écrit >>> dans le message de >>> news:21******************************@DotNetMonste r.com... >>> >>>> Hi, >>>> >>>> Within the HTML if I try to put an if statement, I get an >>>> error: BC30201: Expression expected >>>> >>>> This is a simplified example: >>>> >>>> <%# If StoreNumber = "1" Then %> >>>> >>>> <b>Store1</b> >>>> >>>> <%# EndIf %> >>>> >>>> Thanks >>>> >>>> -- Message posted via http://www.dotnetmonster.com >>>>
A LiteralControl holds ViewState?
A LiteralControl inherits System.Web.UI.Control, which means that it HAS
ViewState, but a LiteralControl doesn't HOLD ViewState. Note that the
ViewState property is protected.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:13**********************@msnews.microsoft.com ... Well, the reason it's important is that the Literal holds view state and for static HTML you don't want this unnecessary overhead.
-Brock DevelopMentor http://staff.develop.com/ballen I didn't know you would take me literally!
"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message news:13**********************@msnews.microsoft.com ...
Actually you probabaly want a LiteralControl control not a Literal control. :)
-Brock DevelopMentor http://staff.develop.com/ballen Another way is to use the Literal control. It doesn't put any HTML tags automatically - you can use it to inject HTML (or text or whatever) directly into a specific location on your page.
HTH
"Dica" <ge*****@hotmail.com> wrote in message news:xZ********************@rogers.com... > "Steve" <ss*@sss.com> wrote in message > news:uU**************@tk2msftngp13.phx.gbl... >> use a server control and write to that. >> a label is rendered as a <span> tag I think, maybe a <div>, but >> either > way, > >> that is one way to control where the output goes... >> > thanks > >> "Dica" <ge*****@hotmail.com> wrote in message >> news:Uq********************@rogers.com... >>> "Patrice" <no****@nowhere.com> wrote in message >>> news:uZ**************@TK2MSFTNGP10.phx.gbl... >>>> Use <% for code. <%# is for databidning. >>>> >>>> As a side note this is a bit old style. I would recommend doing >>>> this >>>> > in > >>> code >>> >>>> behing rather than mixing code and HTML as in the pre ASP.NET >>>> days... >>>> >>> how do you control where the outputted html will show up on the >>> aspx >>> > page > >> if >> >>> you do this in your code behind? if, for instance, i have a >>> search form >>> >> and >> >>> a search button that executes some sql statements, and all this >>> is >>> > handled > >>> in the code behind, how would i go about response.writing the >>> search >>> >> results >> >>> to the bottom of the search page? >>> >>>> Patrice >>>> >>>> -- >>>> >>>> "Joe via DotNetMonster.com" <fo***@DotNetMonster.com> a écrit >>>> dans le message de >>>> news:21******************************@DotNetMonste r.com... >>>> >>>>> Hi, >>>>> >>>>> Within the HTML if I try to put an if statement, I get an >>>>> error: BC30201: Expression expected >>>>> >>>>> This is a simplified example: >>>>> >>>>> <%# If StoreNumber = "1" Then %> >>>>> >>>>> <b>Store1</b> >>>>> >>>>> <%# EndIf %> >>>>> >>>>> Thanks >>>>> >>>>> -- Message posted via http://www.dotnetmonster.com >>>>>
No, a Literal control holds viewstate. A LiteralControl control doesn't.
-Brock
DevelopMentor http://staff.develop.com/ballen A LiteralControl holds ViewState?
A LiteralControl inherits System.Web.UI.Control, which means that it HAS ViewState, but a LiteralControl doesn't HOLD ViewState. Note that the ViewState property is protected.
Kevin Spencer Microsoft MVP .Net Developer What You Seek Is What You Get. "Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message news:13**********************@msnews.microsoft.com ...
Well, the reason it's important is that the Literal holds view state and for static HTML you don't want this unnecessary overhead.
-Brock DevelopMentor http://staff.develop.com/ballen I didn't know you would take me literally!
"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message news:13**********************@msnews.microsoft.com ...
Actually you probabaly want a LiteralControl control not a Literal control. :)
-Brock DevelopMentor http://staff.develop.com/ballen > Another way is to use the Literal control. It doesn't put any HTML > tags automatically - you can use it to inject HTML (or text or > whatever) directly into a specific location on your page. > > HTH > > "Dica" <ge*****@hotmail.com> wrote in message > news:xZ********************@rogers.com... >> "Steve" <ss*@sss.com> wrote in message >> news:uU**************@tk2msftngp13.phx.gbl... >>> use a server control and write to that. >>> a label is rendered as a <span> tag I think, maybe a <div>, but >>> either >> way, >> >>> that is one way to control where the output goes... >>> >> thanks >> >>> "Dica" <ge*****@hotmail.com> wrote in message >>> news:Uq********************@rogers.com... >>>> "Patrice" <no****@nowhere.com> wrote in message >>>> news:uZ**************@TK2MSFTNGP10.phx.gbl... >>>>> Use <% for code. <%# is for databidning. >>>>> >>>>> As a side note this is a bit old style. I would recommend >>>>> doing this >>>>> >> in >> >>>> code >>>> >>>>> behing rather than mixing code and HTML as in the pre ASP.NET >>>>> days... >>>>> >>>> how do you control where the outputted html will show up on the >>>> aspx >>>> >> page >> >>> if >>> >>>> you do this in your code behind? if, for instance, i have a >>>> search form >>>> >>> and >>> >>>> a search button that executes some sql statements, and all this >>>> is >>>> >> handled >> >>>> in the code behind, how would i go about response.writing the >>>> search >>>> >>> results >>> >>>> to the bottom of the search page? >>>> >>>>> Patrice >>>>> >>>>> -- >>>>> >>>>> "Joe via DotNetMonster.com" <fo***@DotNetMonster.com> a écrit >>>>> dans le message de >>>>> news:21******************************@DotNetMonste r.com... >>>>> >>>>>> Hi, >>>>>> >>>>>> Within the HTML if I try to put an if statement, I get an >>>>>> error: BC30201: Expression expected >>>>>> >>>>>> This is a simplified example: >>>>>> >>>>>> <%# If StoreNumber = "1" Then %> >>>>>> >>>>>> <b>Store1</b> >>>>>> >>>>>> <%# EndIf %> >>>>>> >>>>>> Thanks >>>>>> >>>>>> -- Message posted via http://www.dotnetmonster.com >>>>>>
Aha! Thanks for the clarification.
--
Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:13**********************@msnews.microsoft.com ... No, a Literal control holds viewstate. A LiteralControl control doesn't.
-Brock DevelopMentor http://staff.develop.com/ballen A LiteralControl holds ViewState?
A LiteralControl inherits System.Web.UI.Control, which means that it HAS ViewState, but a LiteralControl doesn't HOLD ViewState. Note that the ViewState property is protected.
Kevin Spencer Microsoft MVP .Net Developer What You Seek Is What You Get. "Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message news:13**********************@msnews.microsoft.com ...
Well, the reason it's important is that the Literal holds view state and for static HTML you don't want this unnecessary overhead.
-Brock DevelopMentor http://staff.develop.com/ballen I didn't know you would take me literally!
"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message news:13**********************@msnews.microsoft.com ...
> Actually you probabaly want a LiteralControl control not a Literal > control. :) > > -Brock > DevelopMentor > http://staff.develop.com/ballen >> Another way is to use the Literal control. It doesn't put any HTML >> tags automatically - you can use it to inject HTML (or text or >> whatever) directly into a specific location on your page. >> >> HTH >> >> "Dica" <ge*****@hotmail.com> wrote in message >> news:xZ********************@rogers.com... >>> "Steve" <ss*@sss.com> wrote in message >>> news:uU**************@tk2msftngp13.phx.gbl... >>>> use a server control and write to that. >>>> a label is rendered as a <span> tag I think, maybe a <div>, but >>>> either >>> way, >>> >>>> that is one way to control where the output goes... >>>> >>> thanks >>> >>>> "Dica" <ge*****@hotmail.com> wrote in message >>>> news:Uq********************@rogers.com... >>>>> "Patrice" <no****@nowhere.com> wrote in message >>>>> news:uZ**************@TK2MSFTNGP10.phx.gbl... >>>>>> Use <% for code. <%# is for databidning. >>>>>> >>>>>> As a side note this is a bit old style. I would recommend >>>>>> doing this >>>>>> >>> in >>> >>>>> code >>>>> >>>>>> behing rather than mixing code and HTML as in the pre ASP.NET >>>>>> days... >>>>>> >>>>> how do you control where the outputted html will show up on the >>>>> aspx >>>>> >>> page >>> >>>> if >>>> >>>>> you do this in your code behind? if, for instance, i have a >>>>> search form >>>>> >>>> and >>>> >>>>> a search button that executes some sql statements, and all this >>>>> is >>>>> >>> handled >>> >>>>> in the code behind, how would i go about response.writing the >>>>> search >>>>> >>>> results >>>> >>>>> to the bottom of the search page? >>>>> >>>>>> Patrice >>>>>> >>>>>> -- >>>>>> >>>>>> "Joe via DotNetMonster.com" <fo***@DotNetMonster.com> a écrit >>>>>> dans le message de >>>>>> news:21******************************@DotNetMonste r.com... >>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> Within the HTML if I try to put an if statement, I get an >>>>>>> error: BC30201: Expression expected >>>>>>> >>>>>>> This is a simplified example: >>>>>>> >>>>>>> <%# If StoreNumber = "1" Then %> >>>>>>> >>>>>>> <b>Store1</b> >>>>>>> >>>>>>> <%# EndIf %> >>>>>>> >>>>>>> Thanks >>>>>>> >>>>>>> -- Message posted via http://www.dotnetmonster.com >>>>>>> This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Akbar |
last post by:
Hey there,
Big-time curiosity issue here...
Here's the test code (it's not that long)... it's to display a large
number of image links with captions, ideally pulled in from an
external file...
|
by: Andrew Thompson |
last post by:
It seems most people get there JS off web sites, which is
entirely logical. But it is also a great pity since most
of that code is of such poor quality.
I was looking through the JS FAQ for any...
|
by: Paolo Pignatelli |
last post by:
I have an aspx code behind page that goes something like this in the HTML
view:
<asp:HyperLink id=HyperLink1 runat="server"
NavigateUrl='<%#"mailto:" &...
|
by: tshad |
last post by:
Many (if not most) have said that code-behind is best if working in teams -
which does seem logical.
How do you deal with the flow of the work?
I have someone who is good at designing, but...
|
by: webrod |
last post by:
Hi,
I have some php pages with a lot of HTML code.
I am looking for a HTML validator tool (like TIDY).
TIDY is not good enough with PHP tags (it removes a lot of php code).
Do you have any...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |