I have run into a major road block with my page development projects. I am
trying to add a literal control to my asp.net page and I got an error
stating that the control could not be added because of code blocks (<% %>)
on the page. Most of these blocks can be handled by adding a label control
to the form so it is not that big of deal, but one of the things being
posted is the page title. I am not sure how I can access that from the code
behind page. I also call a function that creates a css style sheet as well
as a function that creates my navigation bar for the web site. Is there a
way for me to get around the error without moving the code blocks? If not,
how can I implement the changes for the three problem areas? 5 1667
Try adding a panel and then adding the control to the panel. As I have not
worked with <% %> blocks, this is just a guess, but the panel makes a better
container for controls than Page, IMO.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
************************************************** ********************
Think Outside the Box!
************************************************** ********************
"Jeremy Ames" <yo******@here.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl... I have run into a major road block with my page development projects. I am trying to add a literal control to my asp.net page and I got an error stating that the control could not be added because of code blocks (<% %>) on the page. Most of these blocks can be handled by adding a label control to the form so it is not that big of deal, but one of the things being posted is the page title. I am not sure how I can access that from the
code behind page. I also call a function that creates a css style sheet as well as a function that creates my navigation bar for the web site. Is there a way for me to get around the error without moving the code blocks? If not, how can I implement the changes for the three problem areas?
if you are framework 1.1,
<title id=title runat=server>
will showup on the codebehind as a generic html control, which you can set
attributes or innerhtml.
-- bruce (sqlwork.com)
"Jeremy Ames" <yo******@here.com> wrote in message
news:#A**************@TK2MSFTNGP11.phx.gbl... I have run into a major road block with my page development projects. I am trying to add a literal control to my asp.net page and I got an error stating that the control could not be added because of code blocks (<% %>) on the page. Most of these blocks can be handled by adding a label control to the form so it is not that big of deal, but one of the things being posted is the page title. I am not sure how I can access that from the
code behind page. I also call a function that creates a css style sheet as well as a function that creates my navigation bar for the web site. Is there a way for me to get around the error without moving the code blocks? If not, how can I implement the changes for the three problem areas?
The literal that I am loading is Javascript. Will that work in a panel?
"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamM> wrote in
message news:uE**************@TK2MSFTNGP11.phx.gbl...
Try adding a panel and then adding the control to the panel. As I have not
worked with <% %> blocks, this is just a guess, but the panel makes a better
container for controls than Page, IMO.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
************************************************** ********************
Think Outside the Box!
************************************************** ********************
"Jeremy Ames" <yo******@here.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl... I have run into a major road block with my page development projects. I am trying to add a literal control to my asp.net page and I got an error stating that the control could not be added because of code blocks (<% %>) on the page. Most of these blocks can be handled by adding a label control to the form so it is not that big of deal, but one of the things being posted is the page title. I am not sure how I can access that from the
code behind page. I also call a function that creates a css style sheet as well as a function that creates my navigation bar for the web site. Is there a way for me to get around the error without moving the code blocks? If not, how can I implement the changes for the three problem areas?
What about the CSS? That is supposed to go into the head section of the
page.
"bruce barker" <no***********@safeco.com> wrote in message
news:u4**************@TK2MSFTNGP12.phx.gbl...
if you are framework 1.1,
<title id=title runat=server>
will showup on the codebehind as a generic html control, which you can set
attributes or innerhtml.
-- bruce (sqlwork.com)
"Jeremy Ames" <yo******@here.com> wrote in message
news:#A**************@TK2MSFTNGP11.phx.gbl... I have run into a major road block with my page development projects. I am trying to add a literal control to my asp.net page and I got an error stating that the control could not be added because of code blocks (<% %>) on the page. Most of these blocks can be handled by adding a label control to the form so it is not that big of deal, but one of the things being posted is the page title. I am not sure how I can access that from the
code behind page. I also call a function that creates a css style sheet as well as a function that creates my navigation bar for the web site. Is there a way for me to get around the error without moving the code blocks? If not, how can I implement the changes for the three problem areas?
When outputting javascript, Microsoft has supplied several methods on the
Page object to properly place the code and avoid getting called multiple
times. Look up RegisterStartupScript, RegisterClientScriptBlock,
IsClientScriptBlockRegistered and IsStartupScriptRegistered on the Page
class.
I don't recommend using a Panel as a place to drop any controls unless you
want its <div> wrapper. Microsoft provided the PlaceHolder control as a
place to add other controls without getting any additional HTML.
--- Peter Blum www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at http://www.peterblum.com/vam/home.aspx
"Jeremy Ames" <yo******@here.com> wrote in message
news:Or**************@tk2msftngp13.phx.gbl... The literal that I am loading is Javascript. Will that work in a panel?
"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamM> wrote in message news:uE**************@TK2MSFTNGP11.phx.gbl... Try adding a panel and then adding the control to the panel. As I have not worked with <% %> blocks, this is just a guess, but the panel makes a
better container for controls than Page, IMO.
-- Gregory A. Beamer MVP; MCP: +I, SE, SD, DBA
************************************************** ******************** Think Outside the Box! ************************************************** ******************** "Jeremy Ames" <yo******@here.com> wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl... I have run into a major road block with my page development projects. I
am trying to add a literal control to my asp.net page and I got an error stating that the control could not be added because of code blocks (<%
%>) on the page. Most of these blocks can be handled by adding a label
control to the form so it is not that big of deal, but one of the things being posted is the page title. I am not sure how I can access that from the code behind page. I also call a function that creates a css style sheet as
well as a function that creates my navigation bar for the web site. Is there
a way for me to get around the error without moving the code blocks? If
not, how can I implement the changes for the three problem areas?
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Clayton Hamilton |
last post by:
I have a DataGrid on a webform bound to a Datasource and can
successfully use <ItemTemplate> to create edit/update/cancel
functionality for user maintenance of data. I use separate logic to
delete...
|
by: DotNetJunky |
last post by:
I have built a control that runs an on-line help system. Depending on the
category you selected via dropdownlist, it goes out and gets the child
subcategories, and if there are any, adds a new...
|
by: Jim Heavey |
last post by:
Trying to figure out the technique which should be used
to add rows to a datagrid. I am thinking that I would
want an "Add" button on the footer, but I am not quite
sure how to do that. Is that...
|
by: Jiho Han |
last post by:
In CreateChildControls method of my Page, I am trying to see if a hidden
input field is present (by id) and if not, add it to a predefined form (by
id).
protected override void...
|
by: Bas Groeneveld |
last post by:
I am developing an ASP.NET application part of which consists of a data
entry wizard defined by entries in a data table - ie the controls on each
page of the wizard are determined by definitions in...
|
by: Totto |
last post by:
Hi,
Anyone know the best solution to dynamically add buttons to a asp 2.0 page
using data from Sql server?
Are there any contols suitable for this or is it best to iterate the dataset
and...
|
by: sonic |
last post by:
I am trying to dynamically load a validator and must be missing
something elementary here.
I extended TextBox control to add some functionality to it. One new
feature it contains is IsRequired...
|
by: John Dalberg |
last post by:
I am looking at a problem which is preventing my code to get a reference to
any asp control inside a div section which has a runat=server attribute.
This can be reproduced in a simple test:...
|
by: Nunzio |
last post by:
I am trying to add specific form controls to a VBA collection, so that
I can pass the entire collection to another function, and access the
individual controls later. I have tried several...
|
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: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: 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: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |