473,396 Members | 1,743 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,396 software developers and data experts.

How can I do this?

m.a

Hello,

I know that I can do this:

<asp:Label runat="server" ID="test" text='<%# Eval("a_field")%>'
></asp:Label>


but how can I do this:

<asp:Label runat="server" ID="test" text='<%# GetAString()%>' ></asp:Label>

where GetAString() is a C# function returning a string (sample as follow):

public static string GetSString()

{

return "test";

}

when I add the above line to my aspx page, I am not getting any error, but
nothing for label is shown when it should show test.

Any suggestion on what is the problem?

Regards


Sep 15 '08 #1
16 1010
m.a explained on 15-9-2008 :
Hello,

I know that I can do this:

<asp:Label runat="server" ID="test" text='<%# Eval("a_field")%>'
></asp:Label>

but how can I do this:

<asp:Label runat="server" ID="test" text='<%# GetAString()%>' ></asp:Label>

where GetAString() is a C# function returning a string (sample as follow):

public static string GetSString()

{

return "test";

}

when I add the above line to my aspx page, I am not getting any error, but
nothing for label is shown when it should show test.

Any suggestion on what is the problem?

Regards
<asp:Label runat="server" ID="test" text='<%= GetAString()%>' />

use "%=" instead of "%#"

Hans Kesting
Sep 15 '08 #2
m.a

"Hans Kesting" <ne*********@spamgourmet.comwrote in message
news:uR**************@TK2MSFTNGP05.phx.gbl...
m.a explained on 15-9-2008 :
>Hello,

I know that I can do this:

<asp:Label runat="server" ID="test" text='<%# Eval("a_field")%>'
> ></asp:Label>

but how can I do this:

<asp:Label runat="server" ID="test" text='<%# GetAString()%>'
> ></asp:Label>

where GetAString() is a C# function returning a string (sample as
follow):

public static string GetSString()

{

return "test";

}

when I add the above line to my aspx page, I am not getting any error,
but nothing for label is shown when it should show test.

Any suggestion on what is the problem?

Regards

<asp:Label runat="server" ID="test" text='<%= GetAString()%>' />

use "%=" instead of "%#"

Hans Kesting

Thanks, but it doesn't work.

I created a new project in MSVS2008 and the default.aspx is :

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs"
Inherits="WebApplication1._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">

<title></title>

</head>

<body>

<form id="form1" runat="server">

<div>

<asp:Label runat="server" ID="test" text='<%= GetAString()%>' />

</div>

</form>

</body>

</html>

And the default.aspx.cs is as follow:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

namespace WebApplication1

{

public partial class _Default : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

}

protected string GetAString()

{

return "test";

}

}

but when I run the application, the result is a blank page.

any suggestion?

Regards


Sep 15 '08 #3
for a data binding expression to be evaluated, you still need to call
DataBind().

-- bruce (sqlwork.com)
"m.a" wrote:
>
Hello,

I know that I can do this:

<asp:Label runat="server" ID="test" text='<%# Eval("a_field")%>'
></asp:Label>

but how can I do this:

<asp:Label runat="server" ID="test" text='<%# GetAString()%>' ></asp:Label>

where GetAString() is a C# function returning a string (sample as follow):

public static string GetSString()

{

return "test";

}

when I add the above line to my aspx page, I am not getting any error, but
nothing for label is shown when it should show test.

Any suggestion on what is the problem?

Regards


Sep 15 '08 #4
m.a
Thanks,
But it is not a databinding expression. I also add the databind() to the
form_load but no difference, (with the refrence to the codes that I send
with my second post.

Regards

"bruce barker" <br*********@discussions.microsoft.comwrote in message
news:BB**********************************@microsof t.com...
for a data binding expression to be evaluated, you still need to call
DataBind().

-- bruce (sqlwork.com)
"m.a" wrote:
>>
Hello,

I know that I can do this:

<asp:Label runat="server" ID="test" text='<%# Eval("a_field")%>'
> ></asp:Label>

but how can I do this:

<asp:Label runat="server" ID="test" text='<%# GetAString()%>'
> ></asp:Label>

where GetAString() is a C# function returning a string (sample as
follow):

public static string GetSString()

{

return "test";

}

when I add the above line to my aspx page, I am not getting any error,
but
nothing for label is shown when it should show test.

Any suggestion on what is the problem?

Regards



Sep 15 '08 #5
"m.a" <ma.@spamoff.comwrote in message
news:u2*************@TK2MSFTNGP05.phx.gbl...
>><asp:Label runat="server" ID="test" text='<%# GetAString()%>'
></asp:Label>

<asp:Label runat="server" ID="test" text='<%= GetAString()%>' />

use "%=" instead of "%#"

Thanks, but it doesn't work.

I created a new project in MSVS2008 and the default.aspx is :

protected string GetAString()
Are you sure that your code-behind function is being called? Put a
breakpoint in it to check...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 15 '08 #6
m.a

"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:e5**************@TK2MSFTNGP05.phx.gbl...
"m.a" <ma.@spamoff.comwrote in message
news:u2*************@TK2MSFTNGP05.phx.gbl...
>>><asp:Label runat="server" ID="test" text='<%# GetAString()%>'
></asp:Label>
<asp:Label runat="server" ID="test" text='<%= GetAString()%>' />

use "%=" instead of "%#"

Thanks, but it doesn't work.

I created a new project in MSVS2008 and the default.aspx is :

protected string GetAString()

Are you sure that your code-behind function is being called? Put a
breakpoint in it to check...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
No it is not called? But I don't know why? What is wrong in my code?


Sep 15 '08 #7
protected string GetAString()
{
return "test";
}
Try this instead:

protected void GetAString()
{
Response.Write("test");
}

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"m.a" <ma.@spamoff.comwrote in message
news:u2*************@TK2MSFTNGP05.phx.gbl...
>
"Hans Kesting" <ne*********@spamgourmet.comwrote in message
news:uR**************@TK2MSFTNGP05.phx.gbl...
>m.a explained on 15-9-2008 :
>>Hello,

I know that I can do this:

<asp:Label runat="server" ID="test" text='<%# Eval("a_field")%>'
></asp:Label>

but how can I do this:

<asp:Label runat="server" ID="test" text='<%# GetAString()%>'
></asp:Label>

where GetAString() is a C# function returning a string (sample as
follow):

public static string GetSString()

{

return "test";

}

when I add the above line to my aspx page, I am not getting any error,
but nothing for label is shown when it should show test.

Any suggestion on what is the problem?

Regards

<asp:Label runat="server" ID="test" text='<%= GetAString()%>' />

use "%=" instead of "%#"

Hans Kesting


Thanks, but it doesn't work.

I created a new project in MSVS2008 and the default.aspx is :

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs"
Inherits="WebApplication1._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">

<title></title>

</head>

<body>

<form id="form1" runat="server">

<div>

<asp:Label runat="server" ID="test" text='<%= GetAString()%>' />

</div>

</form>

</body>

</html>

And the default.aspx.cs is as follow:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

namespace WebApplication1

{

public partial class _Default : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

}
}

but when I run the application, the result is a blank page.

any suggestion?

Regards

Sep 15 '08 #8
m.a
It is not working since the function never called.

"Jonathan Wood" <jw***@softcircuits.comwrote in message
news:Or*************@TK2MSFTNGP05.phx.gbl...
>protected string GetAString()
{
return "test";
}

Try this instead:

protected void GetAString()
{
Response.Write("test");
}

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"m.a" <ma.@spamoff.comwrote in message
news:u2*************@TK2MSFTNGP05.phx.gbl...
>>
"Hans Kesting" <ne*********@spamgourmet.comwrote in message
news:uR**************@TK2MSFTNGP05.phx.gbl...
>>m.a explained on 15-9-2008 :
Hello,

I know that I can do this:

<asp:Label runat="server" ID="test" text='<%# Eval("a_field")%>'
></asp:Label>

but how can I do this:

<asp:Label runat="server" ID="test" text='<%# GetAString()%>'
></asp:Label>

where GetAString() is a C# function returning a string (sample as
follow):

public static string GetSString()

{

return "test";

}

when I add the above line to my aspx page, I am not getting any error,
but nothing for label is shown when it should show test.

Any suggestion on what is the problem?

Regards

<asp:Label runat="server" ID="test" text='<%= GetAString()%>' />

use "%=" instead of "%#"

Hans Kesting


Thanks, but it doesn't work.

I created a new project in MSVS2008 and the default.aspx is :

<%@ Page Language="C#" AutoEventWireup="true"
CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">

<title></title>

</head>

<body>

<form id="form1" runat="server">

<div>

<asp:Label runat="server" ID="test" text='<%= GetAString()%>' />

</div>

</form>

</body>

</html>

And the default.aspx.cs is as follow:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

namespace WebApplication1

{

public partial class _Default : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

}
}

but when I run the application, the result is a blank page.

any suggestion?

Regards


Sep 15 '08 #9
but it is a databinding expression, even it if does not access the databound
object. call DataBind() on the label, when you wnat the evaluation to take
effect.

Databinding expressions are pretty simple, when the page is compiled, if a
control has a databinding expression (property = "<%# expr() %>") then the
equalivent to following code is generated (actually ondatabinding fires an
event to call a delegate, instead of calling the code direct) :

OnDataBinding(EvaneArg e)
{
property = expr();
}

-- bruce (sqlwork.com)
"m.a" wrote:
Thanks,
But it is not a databinding expression. I also add the databind() to the
form_load but no difference, (with the refrence to the codes that I send
with my second post.

Regards

"bruce barker" <br*********@discussions.microsoft.comwrote in message
news:BB**********************************@microsof t.com...
for a data binding expression to be evaluated, you still need to call
DataBind().

-- bruce (sqlwork.com)
"m.a" wrote:
>
Hello,

I know that I can do this:

<asp:Label runat="server" ID="test" text='<%# Eval("a_field")%>'
></asp:Label>

but how can I do this:

<asp:Label runat="server" ID="test" text='<%# GetAString()%>'
></asp:Label>

where GetAString() is a C# function returning a string (sample as
follow):

public static string GetSString()

{

return "test";

}

when I add the above line to my aspx page, I am not getting any error,
but
nothing for label is shown when it should show test.

Any suggestion on what is the problem?

Regards




Sep 15 '08 #10
I have code like this. But I didn't use a label control. I just did
something like this:

<% GetAString(); %>

It works for me.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"m.a" <ma.@spamoff.comwrote in message
news:uu**************@TK2MSFTNGP04.phx.gbl...
It is not working since the function never called.

"Jonathan Wood" <jw***@softcircuits.comwrote in message
news:Or*************@TK2MSFTNGP05.phx.gbl...
>>protected string GetAString()
{
return "test";
}

Try this instead:

protected void GetAString()
{
Response.Write("test");
}

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"m.a" <ma.@spamoff.comwrote in message
news:u2*************@TK2MSFTNGP05.phx.gbl...
>>>
"Hans Kesting" <ne*********@spamgourmet.comwrote in message
news:uR**************@TK2MSFTNGP05.phx.gbl...
m.a explained on 15-9-2008 :
Hello,
>
I know that I can do this:
>
<asp:Label runat="server" ID="test" text='<%# Eval("a_field")%>'
></asp:Label>
>
>
>
but how can I do this:
>
<asp:Label runat="server" ID="test" text='<%# GetAString()%>'
></asp:Label>
>
>
>
where GetAString() is a C# function returning a string (sample as
follow):
>
>
>
public static string GetSString()
>
{
>
return "test";
>
}
>
when I add the above line to my aspx page, I am not getting any error,
but nothing for label is shown when it should show test.
>
>
>
Any suggestion on what is the problem?
>
Regards

<asp:Label runat="server" ID="test" text='<%= GetAString()%>' />

use "%=" instead of "%#"

Hans Kesting

Thanks, but it doesn't work.

I created a new project in MSVS2008 and the default.aspx is :

<%@ Page Language="C#" AutoEventWireup="true"
CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">

<title></title>

</head>

<body>

<form id="form1" runat="server">

<div>

<asp:Label runat="server" ID="test" text='<%= GetAString()%>' />

</div>

</form>

</body>

</html>

And the default.aspx.cs is as follow:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

namespace WebApplication1

{

public partial class _Default : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

}
}

but when I run the application, the result is a blank page.

any suggestion?

Regards


Sep 15 '08 #11
m.a
Thanks, it is working but what if I want to use it with an asp control? for
example, if I want to hide/show a control based on some calculation?

for example I may want to do:

<asp:Label runat="server" ID="test" Text='test' visible=<%# ShouldShow()%>'
/>

Regards

"Jonathan Wood" <jw***@softcircuits.comwrote in message
news:Ok**************@TK2MSFTNGP05.phx.gbl...
>I have code like this. But I didn't use a label control. I just did
something like this:

<% GetAString(); %>

It works for me.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"m.a" <ma.@spamoff.comwrote in message
news:uu**************@TK2MSFTNGP04.phx.gbl...
>It is not working since the function never called.

"Jonathan Wood" <jw***@softcircuits.comwrote in message
news:Or*************@TK2MSFTNGP05.phx.gbl...
>>>protected string GetAString()
{
return "test";
}

Try this instead:

protected void GetAString()
{
Response.Write("test");
}

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"m.a" <ma.@spamoff.comwrote in message
news:u2*************@TK2MSFTNGP05.phx.gbl...

"Hans Kesting" <ne*********@spamgourmet.comwrote in message
news:uR**************@TK2MSFTNGP05.phx.gbl...
m.a explained on 15-9-2008 :
>Hello,
>>
> I know that I can do this:
>>
><asp:Label runat="server" ID="test" text='<%# Eval("a_field")%>'
> ></asp:Label>
>>
>>
>>
>but how can I do this:
>>
><asp:Label runat="server" ID="test" text='<%# GetAString()%>'
> ></asp:Label>
>>
>>
>>
>where GetAString() is a C# function returning a string (sample as
>follow):
>>
>>
>>
>public static string GetSString()
>>
>{
>>
> return "test";
>>
>}
>>
>when I add the above line to my aspx page, I am not getting any
>error, but nothing for label is shown when it should show test.
>>
>>
>>
>Any suggestion on what is the problem?
>>
>Regards
>
<asp:Label runat="server" ID="test" text='<%= GetAString()%>' />
>
use "%=" instead of "%#"
>
Hans Kesting
>
>

Thanks, but it doesn't work.

I created a new project in MSVS2008 and the default.aspx is :

<%@ Page Language="C#" AutoEventWireup="true"
CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">

<title></title>

</head>

<body>

<form id="form1" runat="server">

<div>

<asp:Label runat="server" ID="test" text='<%= GetAString()%>' />

</div>

</form>

</body>

</html>

And the default.aspx.cs is as follow:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

namespace WebApplication1

{

public partial class _Default : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

}
}

but when I run the application, the result is a blank page.

any suggestion?

Regards




Sep 15 '08 #12
"m.a" <ma.@spamoff.comwrote in message
news:e9**************@TK2MSFTNGP02.phx.gbl...
>>protected string GetAString()

Are you sure that your code-behind function is being called? Put a
breakpoint in it to check...

No it is not called?
Well, there's the problem!
But I don't know why? What is wrong in my code?
Difficult to tell immediately...

If you do this:

<asp:Label runat="server" ID="test" text='<%= zzzzGetAString()%>' />

do you get a runtime error...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 15 '08 #13
Not sure. For me, I'd simply write a little code in the Load event and set
the visibility there.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"m.a" <ma.@spamoff.comwrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...
Thanks, it is working but what if I want to use it with an asp control?
for example, if I want to hide/show a control based on some calculation?

for example I may want to do:

<asp:Label runat="server" ID="test" Text='test' visible=<%#
ShouldShow()%>' />

Regards

"Jonathan Wood" <jw***@softcircuits.comwrote in message
news:Ok**************@TK2MSFTNGP05.phx.gbl...
>>I have code like this. But I didn't use a label control. I just did
something like this:

<% GetAString(); %>

It works for me.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"m.a" <ma.@spamoff.comwrote in message
news:uu**************@TK2MSFTNGP04.phx.gbl...
>>It is not working since the function never called.

"Jonathan Wood" <jw***@softcircuits.comwrote in message
news:Or*************@TK2MSFTNGP05.phx.gbl...
protected string GetAString()
{
return "test";
}

Try this instead:

protected void GetAString()
{
Response.Write("test");
}

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"m.a" <ma.@spamoff.comwrote in message
news:u2*************@TK2MSFTNGP05.phx.gbl...
>
"Hans Kesting" <ne*********@spamgourmet.comwrote in message
news:uR**************@TK2MSFTNGP05.phx.gbl.. .
>m.a explained on 15-9-2008 :
>>Hello,
>>>
>> I know that I can do this:
>>>
>><asp:Label runat="server" ID="test" text='<%# Eval("a_field")%>'
>> ></asp:Label>
>>>
>>>
>>>
>>but how can I do this:
>>>
>><asp:Label runat="server" ID="test" text='<%# GetAString()%>'
>> ></asp:Label>
>>>
>>>
>>>
>>where GetAString() is a C# function returning a string (sample as
>>follow):
>>>
>>>
>>>
>>public static string GetSString()
>>>
>>{
>>>
>> return "test";
>>>
>>}
>>>
>>when I add the above line to my aspx page, I am not getting any
>>error, but nothing for label is shown when it should show test.
>>>
>>>
>>>
>>Any suggestion on what is the problem?
>>>
>>Regards
>>
><asp:Label runat="server" ID="test" text='<%= GetAString()%>' />
>>
>use "%=" instead of "%#"
>>
>Hans Kesting
>>
>>
>
Thanks, but it doesn't work.
>
I created a new project in MSVS2008 and the default.aspx is :
>
>
>
<%@ Page Language="C#" AutoEventWireup="true"
CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>
>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>
<html xmlns="http://www.w3.org/1999/xhtml" >
>
<head runat="server">
>
<title></title>
>
</head>
>
<body>
>
<form id="form1" runat="server">
>
<div>
>
<asp:Label runat="server" ID="test" text='<%= GetAString()%>' />
>
</div>
>
</form>
>
</body>
>
</html>
>
>
>
And the default.aspx.cs is as follow:
>
>
>
using System;
>
using System.Collections.Generic;
>
using System.Linq;
>
using System.Web;
>
using System.Web.UI;
>
using System.Web.UI.WebControls;
>
namespace WebApplication1
>
{
>
public partial class _Default : System.Web.UI.Page
>
{
>
protected void Page_Load(object sender, EventArgs e)
>
{
>
}
>
>
}
>
but when I run the application, the result is a blank page.
>
any suggestion?
>
Regards
>
>
>
>

Sep 15 '08 #14
"m.a" <ma.@spamoff.comwrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...
Thanks, it is working but what if I want to use it with an asp control?
for example, if I want to hide/show a control based on some calculation?

for example I may want to do:

<asp:Label runat="server" ID="test" Text='test' visible=<%#
ShouldShow()%>' />
ShouldShow will need to return 'true' or 'false' as a string...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 15 '08 #15
m.a
No I am not getting any error.
Whatr is the difference between
<%= %and <%# %?

where can I read more about this?

Regards

"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
"m.a" <ma.@spamoff.comwrote in message
news:e9**************@TK2MSFTNGP02.phx.gbl...
>>>protected string GetAString()

Are you sure that your code-behind function is being called? Put a
breakpoint in it to check...

No it is not called?

Well, there's the problem!
>But I don't know why? What is wrong in my code?

Difficult to tell immediately...

If you do this:

<asp:Label runat="server" ID="test" text='<%= zzzzGetAString()%>' />

do you get a runtime error...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 15 '08 #16
"m.a" <ma.@spamoff.comwrote in message
news:eO*************@TK2MSFTNGP05.phx.gbl...

[top-posting corrected]
>>But I don't know why? What is wrong in my code?

Difficult to tell immediately...

If you do this:

<asp:Label runat="server" ID="test" text='<%= zzzzGetAString()%>' />

do you get a runtime error...?

No I am not getting any error.
In which case, you have a much more fundamental problem. The above should
have forced ASP.NET to try to run a code-behind function called
zzzzGetAString() which, I'm assuming, doesn't actually exist. This should
definitely have generated a runtime error.

I'd suggest maybe creating the page from scratch...
Whatr is the difference between
<%= %and <%# %?
The first is shorthand for "Response.Write whatever follows the equals
sign".
The second is databinding syntax, as Bruce has explained.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 15 '08 #17

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

Similar topics

4
by: James | last post by:
I have a from with 2 fields: Company & Name Depening which is completed, one of the following queries will be run: if($Company){ $query = "Select C* From tblsample Where ID = $Company...
5
by: Scott D | last post by:
I am trying to check and see if a field is posted or not, if not posted then assign $location which is a session variable to $location_other. If it is posted then just assign it to...
2
by: Nick | last post by:
Can someone please tell me how to access elements from a multiple selection list? From what ive read on other posts, this is correct. I keep getting an "Undefined variable" error though... Form...
2
by: Alexander Ross | last post by:
I have a variable ($x) that can have 50 different (string) values. I want to check for 7 of those values and do something based on it ... as I see it I have 2 options: 1) if (($x=="one") ||...
0
by: Dan Foley | last post by:
This script runs fine, but I'd like to know why it's so slow.. Thanks for any help out there on how i can make it faster (it might take up to 5 min to write these 3 export files whith 15 records...
5
by: Lee Redeem | last post by:
Hi there I've created abd uploaded this basic PHP script: <html> <head> <title>PHP Test</title> </head> <body> <H1 align="center">
5
by: christopher vogt | last post by:
Hi, i'm wondering if there is something like $this-> to call a method inside another method of the same class without using the classname in front. I actually use class TEST { function...
6
by: Phil Powell | last post by:
Ok guys, here we go again! SELECT s.nnet_produkt_storrelse_navn FROM nnet_produkt_storrelse s, nnet_produkt_varegruppe v, nnet_storrelse_varegruppe_assoc sv, nnet_produkt p WHERE...
1
by: Michel | last post by:
a site like this http://www.dvdzone2.com/dvd Can you make it in PHP and MySQL within 6 weeks? If so, send me your price 2 a r a (at) p a n d o r a . b e
11
by: Maciej Nadolski | last post by:
Hi! I can`t understand what php wants from me:( So: Cannot send session cache limiter - headers already sent (output started at /home/krecik/public_html/silnik.php:208) in...
0
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
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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...
0
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,...
0
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...
0
agi2029
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 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.