473,585 Members | 2,496 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Programmatic production of HTML...


Hi folks,

Just wondering how I can call a function in a code behind file from within
the body of the ASPX file.

The old ASP way was to use <%= MyFunction() %>, but that doesn't seem to
work anymore...Thus :

<body MS_POSITIONING= "GridLayout ">
<form id="frmAssessme ntPrint" method="post" runat="server">
</form>
<% MyFunction() %>
</body>

I've tried a straight FunctionCall(), classname.Funct ionCall() and
parent.Function Call().

I'm pretty certain that I've seen it somewhere in the help system or the
MSDN docs, but can't recall where. Is it possible at all from a code that's
in a seperate .VB code behind file??

To give you some background I'm writing a report where I'm parsing my data
into HTML. At the moment I'm feeding the output through the page_load event
using the reponse.write method, but it's putting the HTML before the <HTML>
tag. I've tried other events, but with no success. It's working OK like
this, but I suspect browsers other than IE will have problems with it.
Also, it's just generally useful to know...

Thanks in advance....Paul
Nov 18 '05 #1
4 1354
Hi, Paul Mason,

How about adding a System.Web.UI.W ebControls.Lite ral inside the form and
setting its Text property in the Page_Load handler? Is it limited that the
html you want to output should be outside the form?

Also, you can do it like this:

<body MS_POSITIONING= "GridLayout ">
<form id="frmAssessme ntPrint" method="post" runat="server">
</form>
<%
Response.Write( MyFunction())
%>
</body>

Just add a semicolon (;) at the end of the line if you are using C#.
MyFunction() should be member of the class for the page. It can be also
static (in VB shared).

Greetings
Martin
"Paul Mason" <ma****@trials. bham.ac.uk> wrote in message
news:#u******** ******@tk2msftn gp13.phx.gbl...

Hi folks,

Just wondering how I can call a function in a code behind file from within
the body of the ASPX file.

The old ASP way was to use <%= MyFunction() %>, but that doesn't seem to
work anymore...Thus :

<body MS_POSITIONING= "GridLayout ">
<form id="frmAssessme ntPrint" method="post" runat="server">
</form>
<% MyFunction() %>
</body>

I've tried a straight FunctionCall(), classname.Funct ionCall() and
parent.Function Call().

I'm pretty certain that I've seen it somewhere in the help system or the
MSDN docs, but can't recall where. Is it possible at all from a code that's in a seperate .VB code behind file??

To give you some background I'm writing a report where I'm parsing my data
into HTML. At the moment I'm feeding the output through the page_load event using the reponse.write method, but it's putting the HTML before the <HTML> tag. I've tried other events, but with no success. It's working OK like
this, but I suspect browsers other than IE will have problems with it.
Also, it's just generally useful to know...

Thanks in advance....Paul


Nov 18 '05 #2
You can still do this - <%= MyFunction%>, but you have to declare the
function in the codebehind as "Protected" in order to see it from the page.

"Paul Mason" <ma****@trials. bham.ac.uk> wrote in message
news:%2******** ************@tk 2msftngp13.phx. gbl...

Hi folks,

Just wondering how I can call a function in a code behind file from within
the body of the ASPX file.

The old ASP way was to use <%= MyFunction() %>, but that doesn't seem to
work anymore...Thus :

<body MS_POSITIONING= "GridLayout ">
<form id="frmAssessme ntPrint" method="post" runat="server">
</form>
<% MyFunction() %>
</body>

I've tried a straight FunctionCall(), classname.Funct ionCall() and
parent.Function Call().

I'm pretty certain that I've seen it somewhere in the help system or the
MSDN docs, but can't recall where. Is it possible at all from a code that's in a seperate .VB code behind file??

To give you some background I'm writing a report where I'm parsing my data
into HTML. At the moment I'm feeding the output through the page_load event using the reponse.write method, but it's putting the HTML before the <HTML> tag. I've tried other events, but with no success. It's working OK like
this, but I suspect browsers other than IE will have problems with it.
Also, it's just generally useful to know...

Thanks in advance....Paul

Nov 18 '05 #3

Thanks. I didn't realise what the literal control was.

Thanks also to Rick for letting me know it had to be protected..

P

"Martin Dechev" <de*******@hotm ail.com> wrote in message
news:Ox******** ******@tk2msftn gp13.phx.gbl...
Hi, Paul Mason,

How about adding a System.Web.UI.W ebControls.Lite ral inside the form and
setting its Text property in the Page_Load handler? Is it limited that the
html you want to output should be outside the form?

Also, you can do it like this:

<body MS_POSITIONING= "GridLayout ">
<form id="frmAssessme ntPrint" method="post" runat="server">
</form>
<%
Response.Write( MyFunction())
%>
</body>

Just add a semicolon (;) at the end of the line if you are using C#.
MyFunction() should be member of the class for the page. It can be also
static (in VB shared).

Greetings
Martin
"Paul Mason" <ma****@trials. bham.ac.uk> wrote in message
news:#u******** ******@tk2msftn gp13.phx.gbl...

Hi folks,

Just wondering how I can call a function in a code behind file from within the body of the ASPX file.

The old ASP way was to use <%= MyFunction() %>, but that doesn't seem to
work anymore...Thus :

<body MS_POSITIONING= "GridLayout ">
<form id="frmAssessme ntPrint" method="post" runat="server">
</form>
<% MyFunction() %>
</body>

I've tried a straight FunctionCall(), classname.Funct ionCall() and
parent.Function Call().

I'm pretty certain that I've seen it somewhere in the help system or the
MSDN docs, but can't recall where. Is it possible at all from a code

that's
in a seperate .VB code behind file??

To give you some background I'm writing a report where I'm parsing my data into HTML. At the moment I'm feeding the output through the page_load

event
using the reponse.write method, but it's putting the HTML before the

<HTML>
tag. I've tried other events, but with no success. It's working OK like this, but I suspect browsers other than IE will have problems with it.
Also, it's just generally useful to know...

Thanks in advance....Paul

Nov 18 '05 #4
you can use dataBinding
int aspx file :
CustomerID :<%# CustomerID %>

in aspx.cs code file:
page_load()
{
this.DataBind() ;
}

"Paul Mason" <ma****@trials. bham.ac.uk> дÈëÏûÏ¢
news:#u******** ******@tk2msftn gp13.phx.gbl...

Hi folks,

Just wondering how I can call a function in a code behind file from within
the body of the ASPX file.

The old ASP way was to use <%= MyFunction() %>, but that doesn't seem to
work anymore...Thus :

<body MS_POSITIONING= "GridLayout ">
<form id="frmAssessme ntPrint" method="post" runat="server">
</form>
<% MyFunction() %>
</body>

I've tried a straight FunctionCall(), classname.Funct ionCall() and
parent.Function Call().

I'm pretty certain that I've seen it somewhere in the help system or the
MSDN docs, but can't recall where. Is it possible at all from a code that's in a seperate .VB code behind file??

To give you some background I'm writing a report where I'm parsing my data
into HTML. At the moment I'm feeding the output through the page_load event using the reponse.write method, but it's putting the HTML before the <HTML> tag. I've tried other events, but with no success. It's working OK like
this, but I suspect browsers other than IE will have problems with it.
Also, it's just generally useful to know...

Thanks in advance....Paul

Nov 18 '05 #5

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

Similar topics

5
2284
by: Theodore Feldman | last post by:
Hi, Our DBA group is debating production release methodology. We always perfect our deployment package (typically a script) against the database in a Staging environment, before executing the package against Production. One side argues that the safest approach is to create a script containing all schema changes, data changes, stored...
8
8100
by: Mike | last post by:
I have a page with the following code (just the essentials...) Anyway, the style sheet loads and formats perfectly locally on all my test browsers (IE 6, NS 7.1, K-Meleon, Phoenix/Mozilla, Opera), but when I upload it to production and view it on my server the style sheets apparently do not load in any browser but IE. I know IE tends to be...
6
2440
by: Dave Boyd | last post by:
Are there arguments for the built-in commands called via RunCommand such as acCmdNewObjectReport or do they always require interactive input? Is the code behind the built-in commands exposed anywhere? At one time there was some code available for wizards, is this all hidden now? Thanks!
4
1561
by: ATS | last post by:
BUG/PRODUCTION-DOWN: UserControl running from HTML not working. Someone please help, I have a production down situation. For whatever reason, UserControls are not owkring from HTML/IE. When script tries to run a UserControl's method or use a property, IE gives an error "Object doesn't support this property or method". Example:
3
5257
by: MikeM | last post by:
I've been trying to locate some property or method that will allow programmatic access to the "loginUrl" attribute in the web.config file in the <system.web> -> <authentication> element when the config file is set up for Forms Authentication. I know certain system.web settings get mapped to various properties/methods during runtime (e.g....
6
4159
by: Blaine Manyluk | last post by:
I have a very unusual request. I need to be able to generate reports and save them as TIF files, with full programmatic control. The application will provide the filenames. Each page of the report will be saved as a seperate file. All the user should have to do is press a button to generate the TIFs, without having to "touch the meat" of...
1
1186
by: bay_dar | last post by:
We are wondering what is the best way to go about managing production and development versions of our ASP.NET applications. We often publish a production version of a .NET application but then we may need to make longer term upgrades to the application that may take several weeks. Of course in the mean time, we might have to make a quick...
4
2734
by: RedHair | last post by:
Development: Windows 2003 Production :Windows 2003 ASP.NET 2.0 + C# I want to disable the cache feature of all pages in dev but enable it in production environments. What's the solution? If uses cacheProfiles in web.config then I need to deploy different web.config files from dev to production sites.
9
1828
by: sara | last post by:
Hi - I have code (below) that ran as recently as Monday. We decided to change the location for the output reports, and now the code errors (13 Type Mismatch) on the query. The query runs fine on its own. The code still runs fine from the .mde. If I undo the change (single line) I STILL get the error. The .mdb compiles fine.
0
7836
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8199
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8336
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7950
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8212
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5710
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3863
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2343
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1447
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.