.NETGURU
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 doesn&#B4;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 doesn&#B4;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




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification