Hello everyone,
Just curious what would cause an .aspx page to not execute its inline
code. <%# DataBinder.Eval ... %> stuff is working just fine, but
anything else contained by the <% %> tags in the .aspx page just gets
sent literally to the client, including the <% %> tags themselves.
I read something about this being related to AutoEventWireup in the
page directive, but it occurs whether that value is true, false, or not
even present in the page directive.
Any ideas?
Thanks,
Jason 2 1708
Post your code out and let's have look. The problem should be easy.
hehe, been trying to widdle down a managable version to post, and i
think i've got one (if anyone is still reading this thread). so here is
a slightly miniaturized version:
(ASPX)
<%@ Page language="c#" Codebehind="Tes t.aspx.cs"
AutoEventWireup ="False" Inherits="polar is.Test" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD><title>Te st</title></HEAD>
<body>
<form id="Form1" method="post" runat="server">
<asp:datagrid id="DataGrid1" runat="server"
AutoGenerateCol umns="False" ShowFooter="Tru e">
<columns>
<asp:templateco lumn headertext="Nam e">
<itemtemplate >
<asp:label id="Label1" runat="server" text='<%#
DataBinder.Eval (Container.Data Item, "Name") %>' />
</itemtemplate>
<footertemplate >
<asp:textbox id="Textbox1" runat="server" text='<%=
Request["thingy"] %>' />
</footertemplate>
</asp:templatecol umn>
<asp:templateco lumn headertext="Act ion">
<itemtemplate />
<footertemplate >
<asp:linkbutt on commandname="Ad dSchedule" id="Button2"
runat="server" text="Add" />
</footertemplate>
</asp:templatecol umn>
</columns>
</asp:datagrid>
<asp:Label id="Label2" runat="server" /><br />
<asp:Label id="Label3" runat="server" />
</form>
</body>
</HTML>
(CODE BEHIND)
using System;
using System.Collecti ons;
using System.Componen tModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.Sess ionState;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.H tmlControls;
namespace test
{
public class Test : System.Web.UI.P age
{
protected System.Web.UI.W ebControls.Data Grid DataGrid1;
protected System.Web.UI.W ebControls.Labe l Label2;
protected System.Web.UI.W ebControls.Labe l Label3;
DataTable oTable;
private void Page_Load(objec t sender, System.EventArg s e)
{
if (!Page.IsPostBa ck)
{
oTable = new DataTable();
oTable.Columns. Add("Name");
object[] R1 = new object[] { "John" };
object[] R2 = new object[] { "Jane" };
object[] R3 = new object[] { "Jack" };
object[] R4 = new object[] { "Jill" };
oTable.Rows.Add (R1);
oTable.Rows.Add (R2);
oTable.Rows.Add (R3);
oTable.Rows.Add (R4);
DataGrid1.DataS ource = oTable;
DataGrid1.DataB ind();
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArg s e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeCompo nent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeCompo nent()
{
this.Load += new System.EventHan dler(this.Page_ Load);
}
#endregion
}
}
the question primarily resides in the ASPX file. the DataBinder.Eval
statements work just fine, but the inline code to, say, pull a request
querystring variable value, don't work.
thanks for any advice!
jason This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Chris Mantoulidis |
last post by:
I am not clear with the use of the keyword inline... I believe you add
it do a function when you implement the function inside the header
file where the class is stored...
But is that all? What am I missing?
If that's all, then why did Bjarne even bother adding it to the
language?
If that's not all, what else can I do with "inline"?
|
by: RainBow |
last post by:
Greetings!!
I introduced the so-called "thin-template" pattern for controlling the
code bloat caused due to template usage.
However, one of the functions in the template happens to be virtual as
well. To support thin-template, I need to make virtual function as
inline.
Now, I know that compiler would generate an out-of-line copy when it
|
by: Tom Gao |
last post by:
how come something like
NavigateURL = 'foo.aspx?cpid=<%# DataBinder.eval( Container.DataItem,
"DataItem.Foo"%>&nid=<%# DataBinder.eval( Container.DataItem,
"DataItem.Foo2"%>'
forgive me if I made a mistake in typing.. I just typed off the top of my
head.
The problem is when I do something like this (when syntax and typing are
correct)...
|
by: jamihuq |
last post by:
Can someone please tell me what I am doing wrong. I wrote this static
inline function to test another function and I am getting errors which
make no sense to me.
thanks
Jami
/* test2.h */
static inline unsigned int test3(unsigned int aValue)
|
by: chinu |
last post by:
hi all,
i did a small experiment to grasp the advantages of declaring a
function as inline.
inline int fun1();
int main(){
unsigned int start=0,end=0;
asm("rdtsc\n\t"
| |
by: Burt |
last post by:
I'm a stored proc guy, but a lot of people at my company use inline
sql in their apps, sometimes putting the sql in a text file, sometimes
hardcoding it. They don't see much benefit from procs, and say anyway
they're are db specific- what if we change from SQL Server to Oracle
one day?
What say you experts? Is this one of those "no right...
|
by: jg |
last post by:
Does C++ standard require an inline function be generated all the
time ?
For example,
#include <iostream>
using namespace std;
inline int foo()
{
|
by: Nagrik |
last post by:
Dear Group,
The book of Bjarne Stroustrup in chapter 5.4.4 says the following
"The word static is one of the most overused words in C and C++. For
static data members it has both of the common meanings: static as in
"statically allocated" as opposed to on the stack or on the free store
and static as in "with restricted visibility" as...
|
by: Mahesh |
last post by:
Hi,
I need to know if stack frames are generated in case of a
inline function execution or
do they execute just like macros?
if they execute like macros, then what is the need for having
inline function?
where would you use macros and where inlines?
Thanks
Mahesh
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
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...
| |
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. ...
|
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...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |