Search:
Namespaces
Discussions
.NET v1.1
Feedback
accessing to binding-values in my aspx-page
Messages
Related Types
This message was discovered on
ASPFriends.com 'aspngvs' list
.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Dietmar Hollenstein
I have a problem to solve something like that in aps.net:
Asp:
<%If RS("cNewsKurzText")<>"" then%>
<tr>
<td> </td>
<td width="100%" valign="top"
colspan="3"><%=RS("cNewsKurzText")%></td>
</tr>
<%End if%>
I tried something like that asp.net
<%
if (<%#DataBinder.Eval(
Container
.DataItem," cNewsKurzText ") %> != "" )
{
%>
<tr>
<td> </td>
<td width="100%" valign="top" colspan="3"><%#
DataBinder
.Eval(
Container
.DataItem," cNewsKurzText ") %></td>
</tr>
<%
}
%>
but that doesnB4;t work.
Does anyone have an idea ?
Any help would greatly be appreciated.
Reply to this message...
Paul D. Murphy
Write a function like this that returns your string:
protected string GetRow ( strine TEXT )
{
string returnValue;
try
{
returnString += "<tr><td> </td><td width=\"100%\" valign=\"top\""
returnString += "colspan=\"3\">"
returnString += TEXT.ToString();
returnString += "</td></tr>";
return returnString;
}
catch
{
return "";
}
}
On your aspx page do this
<% GetRow(
DataBinder
.Eval(
Container
.DataItem," cNewsKurzText "))
%>
Paul
-----Original Message-----
From: Dietmar Hollenstein [mailto:
Click here to reveal e-mail address
]
Sent: Tuesday, September 04, 2001 7:05 PM
To: aspngvs
Subject: [aspngvs] accessing to binding-values in my aspx-page
I have a problem to solve something like that in aps.net:
Asp:
<%If RS("cNewsKurzText")<>"" then%>
<tr>
<td> </td>
<td width="100%" valign="top"
colspan="3"><%=RS("cNewsKurzText")%></td>
</tr>
<%End if%>
I tried something like that asp.net
<%
if (<%#DataBinder.Eval(
Container
.DataItem," cNewsKurzText ") %> != "" )
{
%>
<tr>
<td> </td>
<td width="100%" valign="top" colspan="3"><%#
DataBinder
.Eval(
Container
.DataItem," cNewsKurzText ") %></td>
</tr>
<%
}
%>
but that doesnB4;t work.
Does anyone have an idea ?
Any help would greatly be appreciated.
| [aspngvs] member
Click here to reveal e-mail address
= YOUR ID
|
http://www.asplists.com/asplists/aspngvs.asp
= JOIN/QUIT
|
http://www.asplists.com/search
= SEARCH Archives
Reply to this message...
(VIP)
I have a problem to solve something like that in aps.net:
=20
Asp:
<%If RS("cNewsKurzText")<>"" then%>
<tr>
<td> </td>
<td width=3D"100%" valign=3D"top"
colspan=3D"3"><%=3DRS("cNewsKurzText")%></td>
</tr>
<%End if%>
=20
I tried something like that asp.net
<%
if (<%#DataBinder.Eval(
Container
.DataItem," cNewsKurzText ") %> !=3D "" )
{
%>
<tr>
<td> </td>
<td width=3D"100%" valign=3D"top" colspan=3D"3"><%#
DataBinder
.Eval(
Container
.DataItem," cNewsKurzText ") %></td>
</tr>
<%
}
%>
=20
but that doesn=B4t work.
Does anyone have an idea ?
=20
Any help would greatly be appreciated.
=20
Reply to this message...
ali faraz
Paul i have checked your mention solution but it is not working correctly. Then i use another technique which is working perfect. check it
Firstly i store binder value in a session and because preprocessor directive it displays value on the page i assign it to a hidden field. then we can use this value anywhere. i use this in my project likewise
<input type=hidden value=<%# ((String)(
DataBinder
.Eval(
Container
.DataItem, "ContactType"))) == "Electrician" ? Session["ScontactType"] = (String)
DataBinder
.Eval(
Container
.DataItem,"ContactType") : ""%>>
<%
String cTypeName= (String) Session["ScontactType"];
Session["ScontactType"] = null;
if(cTypeName == "Electrician")
{
%>
<img id="btnSurveyRequest" alt="Survey Request" src="Images/Icons/email_img.gif" onclick="document.location='<%# BrioPower.Common.BrioPowerConfiguration.BaseUrl + "/Default.aspx?rid=UnderConstruction"%>'" style="cursor:hand">
<%
}
%>
Ali Faraz
--------------------------------
From: ali faraz
Reply to this message...
System.ComponentModel.Container
System.Web.UI.DataBinder
System.Web.UI.DataBinding
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com