Hiding a field in a repeater

I want to hide the Pin field below in my repeater. How do I do this?

<asp:Repeater ID="Repeater1" runat="server"
DataSourceID="SqlDataSource1">

<ItemTemplate>
<tr>
<td><font color="#330099">Claim SSN: </font><b><%#
Eval("ClaimSSN") %></b></td>
<td colspan="2"></td>
<td><font color="#330099">BIC: </font><b><%# Eval("BIC") %></
b></td>

<td colspan="2"></td>

<td colspan="2"><font color="#330099">BIC SSN: </font><b><%#
Eval("BICSSN") %></b></td>

<tr></tr>
<td colspan="7"></td>

<td colspan="7"><font color="#330099">Status Code: </font><b><
%# Eval("StatusCode")%></b></td>

<td><label runat="server" id="lbl"><font color="#330099">Pin:
</font><b><%#Eval("Pin")%></label></b></tr>
</ItemTemplate>
<SeparatorTemplate>
<tr>
<td colspan="100%"><hr size="1" color=#330099 />


</td>
</tr>
</SeparatorTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
JJ297 [ Mo, 31 März 2008 20:48 ] [ ID #1931381 ]

Re: Hiding a field in a repeater

By hiding what exactly you mean???

Do it like <!--<%#Eval("Pin")%>--> and it will be hidden in a browser....

Or how about not to have <%#Eval("Pin")%> at all? It will be really hidden
then :)

George.


"JJ297" <nc297 [at] yahoo.com> wrote in message
news:244d20da-4bd3-4701-9d16-a1d9f9cc5046 [at] p25g2000hsf.google groups.com...
>I want to hide the Pin field below in my repeater. How do I do this?
>
> <asp:Repeater ID="Repeater1" runat="server"
> DataSourceID="SqlDataSource1">
>
> <ItemTemplate>
> <tr>
> <td><font color="#330099">Claim SSN: </font><b><%#
> Eval("ClaimSSN") %></b></td>
> <td colspan="2"></td>
> <td><font color="#330099">BIC: </font><b><%# Eval("BIC") %></
> b></td>
>
> <td colspan="2"></td>
>
> <td colspan="2"><font color="#330099">BIC SSN: </font><b><%#
> Eval("BICSSN") %></b></td>
>
> <tr></tr>
> <td colspan="7"></td>
>
> <td colspan="7"><font color="#330099">Status Code: </font><b><
> %# Eval("StatusCode")%></b></td>
>
> <td><label runat="server" id="lbl"><font color="#330099">Pin:
> </font><b><%#Eval("Pin")%></label></b></tr>
> </ItemTemplate>
> <SeparatorTemplate>
> <tr>
> <td colspan="100%"><hr size="1" color=#330099 />

>
> </td>
> </tr>
> </SeparatorTemplate>
> <FooterTemplate>
> </table>
> </FooterTemplate>
> </asp:Repeater>
George Ter-Saakov [ Mo, 31 März 2008 20:52 ] [ ID #1931385 ]

Re: Hiding a field in a repeater

On Mar 31, 2:52=A0pm, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
> By hiding what exactly you mean???
>
> Do it like <!--<%#Eval("Pin")%>--> and it will be hidden in a browser....
>
> Or how about not to have <%#Eval("Pin")%> at all? It will be really hidden=

> then :)
>
> George.
>
> "JJ297" <nc... [at] yahoo.com> wrote in message
>
> news:244d20da-4bd3-4701-9d16-a1d9f9cc5046 [at] p25g2000hsf.google groups.com...
>
>
>
> >I want to hide the Pin field below in my repeater. =A0How do I do this?
>
> > <asp:Repeater ID=3D"Repeater1" runat=3D"server"
> > DataSourceID=3D"SqlDataSource1">
>
> > =A0 =A0 =A0 =A0 =A0 <ItemTemplate>
> > =A0 =A0 =A0 =A0<tr>
> > =A0 =A0 =A0 =A0<td><font color=3D"#330099">Claim SSN: </font><b><%#
> > Eval("ClaimSSN") %></b></td>
> > =A0 =A0 =A0 =A0 <td colspan=3D"2"></td>
> > =A0 =A0 =A0 =A0 <td><font color=3D"#330099">BIC: </font><b><%# Eval("BIC=
") %></
> > b></td>
>
> > =A0 =A0 =A0 =A0 <td colspan=3D"2"></td>
>
> > =A0 =A0 =A0 =A0 <td colspan=3D"2"><font color=3D"#330099">BIC SSN: </fon=
t><b><%#
> > Eval("BICSSN") %></b></td>
>
> > =A0 =A0 =A0 =A0 <tr></tr>
> > =A0 =A0 =A0 =A0 <td colspan=3D"7"></td>
>
> > =A0 =A0 =A0 =A0 <td colspan=3D"7"><font color=3D"#330099">Status Code: <=
/font><b><
> > %# Eval("StatusCode")%></b></td>
>
> > =A0 =A0 =A0 =A0<td><label runat=3D"server" id=3D"lbl"><font color=3D"#33=
0099">Pin:
> > </font><b><%#Eval("Pin")%></label></b></tr>
> > =A0 =A0 =A0 =A0</ItemTemplate>
> > =A0 =A0 =A0<SeparatorTemplate>
> > =A0 =A0 =A0 =A0<tr>
> > =A0 =A0 =A0 =A0<td colspan=3D"100%"><hr size=3D"1" color=3D#330099 /><br=
/>
>
> > =A0 =A0 =A0 =A0</td>
> > =A0 =A0 =A0 =A0</tr>
> > =A0 =A0 =A0 =A0</SeparatorTemplate>
> > =A0 =A0 =A0 =A0<FooterTemplate>
> > =A0 =A0 =A0 =A0</table>
> > =A0 =A0 =A0 =A0</FooterTemplate>
> > =A0 =A0 =A0 =A0</asp:Repeater>- Hide quoted text -
>
> - Show quoted text -

I want to put security on the page if the person has manager rights
they will have the Pin field visible.

So I will put something like:

If Session(CSI) =3D true then

the pin field is visible

else

the pin field in not visible

I hope that makes sense
I want the Pin field
JJ297 [ Mo, 31 März 2008 21:13 ] [ ID #1931389 ]

Re: Hiding a field in a repeater

I see it now....
The best way to do is following....
in your code on the page make a function (C# example, but you should not
have a problem to convert it to VB.NET)

protected string GetPin(string sPin)
{
if( _iLevel > 1 )
return sPin;
else
return "******";
}


in your aspx page instead of
<%#Eval("Pin")%>
have something like
<%# GetPin((string)DataBinder.Eval(Container.DataItem, "Pin"))%>


Remember, Eval is the function and you always can create your own
version.....


George.








"JJ297" <nc297 [at] yahoo.com> wrote in message
news:5f38834d-46c7-45bf-9fb9-8d5c354bf0cf [at] 8g2000hse.googlegr oups.com...
On Mar 31, 2:52 pm, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
> By hiding what exactly you mean???
>
> Do it like <!--<%#Eval("Pin")%>--> and it will be hidden in a browser....
>
> Or how about not to have <%#Eval("Pin")%> at all? It will be really hidden
> then :)
>
> George.
>
> "JJ297" <nc... [at] yahoo.com> wrote in message
>
> news:244d20da-4bd3-4701-9d16-a1d9f9cc5046 [at] p25g2000hsf.google groups.com...
>
>
>
> >I want to hide the Pin field below in my repeater. How do I do this?
>
> > <asp:Repeater ID="Repeater1" runat="server"
> > DataSourceID="SqlDataSource1">
>
> > <ItemTemplate>
> > <tr>
> > <td><font color="#330099">Claim SSN: </font><b><%#
> > Eval("ClaimSSN") %></b></td>
> > <td colspan="2"></td>
> > <td><font color="#330099">BIC: </font><b><%# Eval("BIC") %></
> > b></td>
>
> > <td colspan="2"></td>
>
> > <td colspan="2"><font color="#330099">BIC SSN: </font><b><%#
> > Eval("BICSSN") %></b></td>
>
> > <tr></tr>
> > <td colspan="7"></td>
>
> > <td colspan="7"><font color="#330099">Status Code: </font><b><
> > %# Eval("StatusCode")%></b></td>
>
> > <td><label runat="server" id="lbl"><font color="#330099">Pin:
> > </font><b><%#Eval("Pin")%></label></b></tr>
> > </ItemTemplate>
> > <SeparatorTemplate>
> > <tr>
> > <td colspan="100%"><hr size="1" color=#330099 />

>
> > </td>
> > </tr>
> > </SeparatorTemplate>
> > <FooterTemplate>
> > </table>
> > </FooterTemplate>
> > </asp:Repeater>- Hide quoted text -
>
> - Show quoted text -

I want to put security on the page if the person has manager rights
they will have the Pin field visible.

So I will put something like:

If Session(CSI) = true then

the pin field is visible

else

the pin field in not visible

I hope that makes sense
I want the Pin field
George Ter-Saakov [ Mo, 31 März 2008 21:33 ] [ ID #1931396 ]

Re: Hiding a field in a repeater

On Mar 31, 3:33=A0pm, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
> I see it now....
> The best way to do is following....
> in your code on the page make a function (C# example, but you should not
> have a problem to convert it to VB.NET)
>
> protected string GetPin(string sPin)
> {
> =A0 =A0 if( _iLevel > 1 )
> =A0 =A0 =A0 =A0 return sPin;
> =A0 =A0 else
> =A0 =A0 =A0 =A0 return "******";
>
> }
>
> in your aspx page instead of
> <%#Eval("Pin")%>
> have something like
> <%# GetPin((string)DataBinder.Eval(Container.DataItem, "Pin"))%>
>
> Remember, =A0Eval is the function and you always can create your own
> version.....
>
> George.
>
> "JJ297" <nc... [at] yahoo.com> wrote in message
>
> news:5f38834d-46c7-45bf-9fb9-8d5c354bf0cf [at] 8g2000hse.googlegr oups.com...
> On Mar 31, 2:52 pm, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
>
>
>
>
>
> > By hiding what exactly you mean???
>
> > Do it like <!--<%#Eval("Pin")%>--> and it will be hidden in a browser...=
..
>
> > Or how about not to have <%#Eval("Pin")%> at all? It will be really hidd=
en
> > then :)
>
> > George.
>
> > "JJ297" <nc... [at] yahoo.com> wrote in message
>
> >news:244d20da-4bd3-4701-9d16-a1d9f9cc5046 [at] p25g2000hsf.googl egroups.com...=

>
> > >I want to hide the Pin field below in my repeater. How do I do this?
>
> > > <asp:Repeater ID=3D"Repeater1" runat=3D"server"
> > > DataSourceID=3D"SqlDataSource1">
>
> > > <ItemTemplate>
> > > <tr>
> > > <td><font color=3D"#330099">Claim SSN: </font><b><%#
> > > Eval("ClaimSSN") %></b></td>
> > > <td colspan=3D"2"></td>
> > > <td><font color=3D"#330099">BIC: </font><b><%# Eval("BIC") %></
> > > b></td>
>
> > > <td colspan=3D"2"></td>
>
> > > <td colspan=3D"2"><font color=3D"#330099">BIC SSN: </font><b><%#
> > > Eval("BICSSN") %></b></td>
>
> > > <tr></tr>
> > > <td colspan=3D"7"></td>
>
> > > <td colspan=3D"7"><font color=3D"#330099">Status Code: </font><b><
> > > %# Eval("StatusCode")%></b></td>
>
> > > <td><label runat=3D"server" id=3D"lbl"><font color=3D"#330099">Pin:
> > > </font><b><%#Eval("Pin")%></label></b></tr>
> > > </ItemTemplate>
> > > <SeparatorTemplate>
> > > <tr>
> > > <td colspan=3D"100%"><hr size=3D"1" color=3D#330099 />

>
> > > </td>
> > > </tr>
> > > </SeparatorTemplate>
> > > <FooterTemplate>
> > > </table>
> > > </FooterTemplate>
> > > </asp:Repeater>- Hide quoted text -
>
> > - Show quoted text -
>
> I want to put security on the page if the person has manager rights
> they will have the Pin field visible.
>
> So I will put something like:
>
> If Session(CSI) =3D true then
>
> the pin field is visible
>
> else
>
> the pin field in not visible
>
> I hope that makes sense
> I want the Pin field- Hide quoted text -
>
> - Show quoted text -

A little confused... like this:

Function getPin(ByVal sPin)


If Session(CSI) =3D True Then
Return sPin.visible =3D False

End If
End Function
JJ297 [ Mo, 31 März 2008 21:58 ] [ ID #1931398 ]

Re: Hiding a field in a repeater

The idea to output to browser Pin or nothing to the user if he does not have
permissions. It's a little different aproach than just hiding this column
which is in HTML word might be prefered way.

so in C# code it will be
protected string GetPin(string sPin)
{
if (Session("CSI") == true)
return sPin
else
return " " //or anything you want
}


And on your page you have

<%# GetPin((string)DataBinder.Eval(Container.DataItem, "Pin"))%>

This line will call your GetPin for every row and output sPin or  
depends on what is in Session("CSI")




George.

"JJ297" <nc297 [at] yahoo.com> wrote in message
news:912b6291-f5bf-4f98-b54e-f62a70b91706 [at] m73g2000hsh.google groups.com...
On Mar 31, 3:33 pm, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
> I see it now....
> The best way to do is following....
> in your code on the page make a function (C# example, but you should not
> have a problem to convert it to VB.NET)
>
> protected string GetPin(string sPin)
> {
> if( _iLevel > 1 )
> return sPin;
> else
> return "******";
>
> }
>
> in your aspx page instead of
> <%#Eval("Pin")%>
> have something like
> <%# GetPin((string)DataBinder.Eval(Container.DataItem, "Pin"))%>
>
> Remember, Eval is the function and you always can create your own
> version.....
>
> George.
>
> "JJ297" <nc... [at] yahoo.com> wrote in message
>
> news:5f38834d-46c7-45bf-9fb9-8d5c354bf0cf [at] 8g2000hse.googlegr oups.com...
> On Mar 31, 2:52 pm, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
>
>
>
>
>
> > By hiding what exactly you mean???
>
> > Do it like <!--<%#Eval("Pin")%>--> and it will be hidden in a
> > browser....
>
> > Or how about not to have <%#Eval("Pin")%> at all? It will be really
> > hidden
> > then :)
>
> > George.
>
> > "JJ297" <nc... [at] yahoo.com> wrote in message
>
> >news:244d20da-4bd3-4701-9d16-a1d9f9cc5046 [at] p25g2000hsf.googl egroups.com...
>
> > >I want to hide the Pin field below in my repeater. How do I do this?
>
> > > <asp:Repeater ID="Repeater1" runat="server"
> > > DataSourceID="SqlDataSource1">
>
> > > <ItemTemplate>
> > > <tr>
> > > <td><font color="#330099">Claim SSN: </font><b><%#
> > > Eval("ClaimSSN") %></b></td>
> > > <td colspan="2"></td>
> > > <td><font color="#330099">BIC: </font><b><%# Eval("BIC") %></
> > > b></td>
>
> > > <td colspan="2"></td>
>
> > > <td colspan="2"><font color="#330099">BIC SSN: </font><b><%#
> > > Eval("BICSSN") %></b></td>
>
> > > <tr></tr>
> > > <td colspan="7"></td>
>
> > > <td colspan="7"><font color="#330099">Status Code: </font><b><
> > > %# Eval("StatusCode")%></b></td>
>
> > > <td><label runat="server" id="lbl"><font color="#330099">Pin:
> > > </font><b><%#Eval("Pin")%></label></b></tr>
> > > </ItemTemplate>
> > > <SeparatorTemplate>
> > > <tr>
> > > <td colspan="100%"><hr size="1" color=#330099 />

>
> > > </td>
> > > </tr>
> > > </SeparatorTemplate>
> > > <FooterTemplate>
> > > </table>
> > > </FooterTemplate>
> > > </asp:Repeater>- Hide quoted text -
>
> > - Show quoted text -
>
> I want to put security on the page if the person has manager rights
> they will have the Pin field visible.
>
> So I will put something like:
>
> If Session(CSI) = true then
>
> the pin field is visible
>
> else
>
> the pin field in not visible
>
> I hope that makes sense
> I want the Pin field- Hide quoted text -
>
> - Show quoted text -

A little confused... like this:

Function getPin(ByVal sPin)


If Session(CSI) = True Then
Return sPin.visible = False

End If
End Function
George Ter-Saakov [ Di, 01 April 2008 13:57 ] [ ID #1932645 ]

Re: Hiding a field in a repeater

On Apr 1, 7:57=A0am, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
> The idea to output to browser Pin or nothing to the user if he does not ha=
ve
> permissions. It's a little different aproach than just hiding this column
> which is in HTML word might be prefered way.
>
> so in C# code it will be
> protected string GetPin(string sPin)
> {
> =A0 =A0 =A0 =A0 if (Session("CSI") =3D=3D true)
> =A0 =A0 =A0 =A0 =A0 =A0 return sPin
> =A0 =A0 =A0 =A0 else
> =A0 =A0 =A0 =A0 =A0 =A0 return " " //or anything you want
>
> }
>
> And on your page you have
>
> <%# GetPin((string)DataBinder.Eval(Container.DataItem, "Pin"))%>
>
> This line will call your GetPin for every row and output sPin or  
> depends on what is in Session("CSI")
>
> George.
>
> "JJ297" <nc... [at] yahoo.com> wrote in message
>
> news:912b6291-f5bf-4f98-b54e-f62a70b91706 [at] m73g2000hsh.google groups.com...
> On Mar 31, 3:33 pm, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
>
>
>
>
>
> > I see it now....
> > The best way to do is following....
> > in your code on the page make a function (C# example, but you should not=

> > have a problem to convert it to VB.NET)
>
> > protected string GetPin(string sPin)
> > {
> > if( _iLevel > 1 )
> > return sPin;
> > else
> > return "******";
>
> > }
>
> > in your aspx page instead of
> > <%#Eval("Pin")%>
> > have something like
> > <%# GetPin((string)DataBinder.Eval(Container.DataItem, "Pin"))%>
>
> > Remember, Eval is the function and you always can create your own
> > version.....
>
> > George.
>
> > "JJ297" <nc... [at] yahoo.com> wrote in message
>
> >news:5f38834d-46c7-45bf-9fb9-8d5c354bf0cf [at] 8g2000hse.googleg roups.com...
> > On Mar 31, 2:52 pm, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
>
> > > By hiding what exactly you mean???
>
> > > Do it like <!--<%#Eval("Pin")%>--> and it will be hidden in a
> > > browser....
>
> > > Or how about not to have <%#Eval("Pin")%> at all? It will be really
> > > hidden
> > > then :)
>
> > > George.
>
> > > "JJ297" <nc... [at] yahoo.com> wrote in message
>
> > >news:244d20da-4bd3-4701-9d16-a1d9f9cc5046 [at] p25g2000hsf.googl egroups.com.=
...
>
> > > >I want to hide the Pin field below in my repeater. How do I do this?
>
> > > > <asp:Repeater ID=3D"Repeater1" runat=3D"server"
> > > > DataSourceID=3D"SqlDataSource1">
>
> > > > <ItemTemplate>
> > > > <tr>
> > > > <td><font color=3D"#330099">Claim SSN: </font><b><%#
> > > > Eval("ClaimSSN") %></b></td>
> > > > <td colspan=3D"2"></td>
> > > > <td><font color=3D"#330099">BIC: </font><b><%# Eval("BIC") %></
> > > > b></td>
>
> > > > <td colspan=3D"2"></td>
>
> > > > <td colspan=3D"2"><font color=3D"#330099">BIC SSN: </font><b><%#
> > > > Eval("BICSSN") %></b></td>
>
> > > > <tr></tr>
> > > > <td colspan=3D"7"></td>
>
> > > > <td colspan=3D"7"><font color=3D"#330099">Status Code: </font><b><
> > > > %# Eval("StatusCode")%></b></td>
>
> > > > <td><label runat=3D"server" id=3D"lbl"><font color=3D"#330099">Pin:
> > > > </font><b><%#Eval("Pin")%></label></b></tr>
> > > > </ItemTemplate>
> > > > <SeparatorTemplate>
> > > > <tr>
> > > > <td colspan=3D"100%"><hr size=3D"1" color=3D#330099 />

>
> > > > </td>
> > > > </tr>
> > > > </SeparatorTemplate>
> > > > <FooterTemplate>
> > > > </table>
> > > > </FooterTemplate>
> > > > </asp:Repeater>- Hide quoted text -
>
> > > - Show quoted text -
>
> > I want to put security on the page if the person has manager rights
> > they will have the Pin field visible.
>
> > So I will put something like:
>
> > If Session(CSI) =3D true then
>
> > the pin field is visible
>
> > else
>
> > the pin field in not visible
>
> > I hope that makes sense
> > I want the Pin field- Hide quoted text -
>
> > - Show quoted text -
>
> A little confused... like this:
>
> Function getPin(ByVal sPin)
>
> =A0 =A0 =A0 =A0 If Session(CSI) =3D True Then
> =A0 =A0 =A0 =A0 =A0 =A0 Return sPin.visible =3D False
>
> =A0 =A0 =A0 =A0 End If
> =A0 =A0 End Function- Hide quoted text -
>
> - Show quoted text -

Thanks George:

Here's my function:

Function getPin(ByVal sPin)


If Session("SPSListings") =3D True Then
Return sPin
Else
Return "you have no access"

End If


End Function

Then on the aspx page I have this but I'm getting Container is not
declared. Any suggestions?

<font color=3D"#330099">Pin: </font><b><
%getPin(DataBinder.Eval(Container.DataItem, "Pin"))%></td></b></tr>
JJ297 [ Di, 01 April 2008 16:58 ] [ ID #1932651 ]

Re: Hiding a field in a repeater

On Apr 1, 10:58=A0am, JJ297 <nc... [at] yahoo.com> wrote:
> On Apr 1, 7:57=A0am, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
>
>
>
>
>
> > The idea to output to browser Pin or nothing to the user if he does not =
have
> > permissions. It's a little different aproach than just hiding this colum=
n
> > which is in HTML word might be prefered way.
>
> > so in C# code it will be
> > protected string GetPin(string sPin)
> > {
> > =A0 =A0 =A0 =A0 if (Session("CSI") =3D=3D true)
> > =A0 =A0 =A0 =A0 =A0 =A0 return sPin
> > =A0 =A0 =A0 =A0 else
> > =A0 =A0 =A0 =A0 =A0 =A0 return "=A0" //or anything you want
>
> > }
>
> > And on your page you have
>
> > <%# GetPin((string)DataBinder.Eval(Container.DataItem, "Pin"))%>
>
> > This line will call your GetPin for every row and output sPin or =A0
> > depends on what is in Session("CSI")
>
> > George.
>
> > "JJ297" <nc... [at] yahoo.com> wrote in message
>
> >news:912b6291-f5bf-4f98-b54e-f62a70b91706 [at] m73g2000hsh.googl egroups.com...=

> > On Mar 31, 3:33 pm, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
>
> > > I see it now....
> > > The best way to do is following....
> > > in your code on the page make a function (C# example, but you should n=
ot
> > > have a problem to convert it to VB.NET)
>
> > > protected string GetPin(string sPin)
> > > {
> > > if( _iLevel > 1 )
> > > return sPin;
> > > else
> > > return "******";
>
> > > }
>
> > > in your aspx page instead of
> > > <%#Eval("Pin")%>
> > > have something like
> > > <%# GetPin((string)DataBinder.Eval(Container.DataItem, "Pin"))%>
>
> > > Remember, Eval is the function and you always can create your own
> > > version.....
>
> > > George.
>
> > > "JJ297" <nc... [at] yahoo.com> wrote in message
>
> > >news:5f38834d-46c7-45bf-9fb9-8d5c354bf0cf [at] 8g2000hse.googleg roups.com...=

> > > On Mar 31, 2:52 pm, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
>
> > > > By hiding what exactly you mean???
>
> > > > Do it like <!--<%#Eval("Pin")%>--> and it will be hidden in a
> > > > browser....
>
> > > > Or how about not to have <%#Eval("Pin")%> at all? It will be really
> > > > hidden
> > > > then :)
>
> > > > George.
>
> > > > "JJ297" <nc... [at] yahoo.com> wrote in message
>
> > > >news:244d20da-4bd3-4701-9d16-a1d9f9cc5046 [at] p25g2000hsf.googl egroups.co=
m...
>
> > > > >I want to hide the Pin field below in my repeater. How do I do this=
?
>
> > > > > <asp:Repeater ID=3D"Repeater1" runat=3D"server"
> > > > > DataSourceID=3D"SqlDataSource1">
>
> > > > > <ItemTemplate>
> > > > > <tr>
> > > > > <td><font color=3D"#330099">Claim SSN: </font><b><%#
> > > > > Eval("ClaimSSN") %></b></td>
> > > > > <td colspan=3D"2"></td>
> > > > > <td><font color=3D"#330099">BIC: </font><b><%# Eval("BIC") %></
> > > > > b></td>
>
> > > > > <td colspan=3D"2"></td>
>
> > > > > <td colspan=3D"2"><font color=3D"#330099">BIC SSN: </font><b><%#
> > > > > Eval("BICSSN") %></b></td>
>
> > > > > <tr></tr>
> > > > > <td colspan=3D"7"></td>
>
> > > > > <td colspan=3D"7"><font color=3D"#330099">Status Code: </font><b><=

> > > > > %# Eval("StatusCode")%></b></td>
>
> > > > > <td><label runat=3D"server" id=3D"lbl"><font color=3D"#330099">Pin=
:
> > > > > </font><b><%#Eval("Pin")%></label></b></tr>
> > > > > </ItemTemplate>
> > > > > <SeparatorTemplate>
> > > > > <tr>
> > > > > <td colspan=3D"100%"><hr size=3D"1" color=3D#330099 />

>
> > > > > </td>
> > > > > </tr>
> > > > > </SeparatorTemplate>
> > > > > <FooterTemplate>
> > > > > </table>
> > > > > </FooterTemplate>
> > > > > </asp:Repeater>- Hide quoted text -
>
> > > > - Show quoted text -
>
> > > I want to put security on the page if the person has manager rights
> > > they will have the Pin field visible.
>
> > > So I will put something like:
>
> > > If Session(CSI) =3D true then
>
> > > the pin field is visible
>
> > > else
>
> > > the pin field in not visible
>
> > > I hope that makes sense
> > > I want the Pin field- Hide quoted text -
>
> > > - Show quoted text -
>
> > A little confused... like this:
>
> > Function getPin(ByVal sPin)
>
> > =A0 =A0 =A0 =A0 If Session(CSI) =3D True Then
> > =A0 =A0 =A0 =A0 =A0 =A0 Return sPin.visible =3D False
>
> > =A0 =A0 =A0 =A0 End If
> > =A0 =A0 End Function- Hide quoted text -
>
> > - Show quoted text -
>
> Thanks George:
>
> Here's my function:
>
> =A0Function getPin(ByVal sPin)
>
> =A0 =A0 =A0 =A0 If Session("SPSListings") =3D True Then
> =A0 =A0 =A0 =A0 =A0 =A0 Return sPin
> =A0 =A0 =A0 =A0 Else
> =A0 =A0 =A0 =A0 =A0 =A0 Return "you have no access"
>
> =A0 =A0 =A0 =A0 End If
>
> =A0 =A0 End Function
>
> Then on the aspx page I have this but I'm getting Container is not
> declared. =A0Any suggestions?
>
> <font color=3D"#330099">Pin: </font><b><
> %getPin(DataBinder.Eval(Container.DataItem, "Pin"))%></td></b></tr>- Hide =
quoted text -
>
> - Show quoted text -

George I got it I left out the # in front of the GetPin. Thanks.

Another question for you. I have this in the function:
If Session("SPSListings") =3D True Then
Return sPin
Else
Return "you have no access"

End If

How can I get rid of the Pin column all together if the user doesn't
have access instead of returning "You have no Access" Can I make that
column visiable =3D false?
JJ297 [ Di, 01 April 2008 17:06 ] [ ID #1932652 ]

Re: Hiding a field in a repeater

It's cause you missing #
Must be
<%# getPin(DataBinder.Eval(Container.DataItem, "Pin"))%>
----------------------------------------------------
Nothing is changed comparing
to <%#Eval("Pin")%>

The Eval("Pin") method is exactly same thing as
DataBinder.Eval(Container.DataItem, "Pin"))
It returns string during binding time... We just plugde getPing in between
to analyse permission and modify the string...

PS:
Also since getPin is called for every row it makes sence to move
Session("CSI") out of the loop (it's a look up in a hashtable done for every
row)..

So in your Page create member variable _bCSI = false and in OnLoad event
assign it _bCSI = (bool)Session("CSI") (sorry C# again)
the in getPin do If( _bCSI = True) ...... Saves a little of runtime....






George.


"JJ297" <nc297 [at] yahoo.com> wrote in message
news:18d01bca-feb5-435e-8c68-f12d1e45f9f2 [at] u69g2000hse.google groups.com...
On Apr 1, 7:57 am, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
> The idea to output to browser Pin or nothing to the user if he does not
> have
> permissions. It's a little different aproach than just hiding this column
> which is in HTML word might be prefered way.
>
> so in C# code it will be
> protected string GetPin(string sPin)
> {
> if (Session("CSI") == true)
> return sPin
> else
> return " " //or anything you want
>
> }
>
> And on your page you have
>
> <%# GetPin((string)DataBinder.Eval(Container.DataItem, "Pin"))%>
>
> This line will call your GetPin for every row and output sPin or  
> depends on what is in Session("CSI")
>
> George.
>
> "JJ297" <nc... [at] yahoo.com> wrote in message
>
> news:912b6291-f5bf-4f98-b54e-f62a70b91706 [at] m73g2000hsh.google groups.com...
> On Mar 31, 3:33 pm, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
>
>
>
>
>
> > I see it now....
> > The best way to do is following....
> > in your code on the page make a function (C# example, but you should not
> > have a problem to convert it to VB.NET)
>
> > protected string GetPin(string sPin)
> > {
> > if( _iLevel > 1 )
> > return sPin;
> > else
> > return "******";
>
> > }
>
> > in your aspx page instead of
> > <%#Eval("Pin")%>
> > have something like
> > <%# GetPin((string)DataBinder.Eval(Container.DataItem, "Pin"))%>
>
> > Remember, Eval is the function and you always can create your own
> > version.....
>
> > George.
>
> > "JJ297" <nc... [at] yahoo.com> wrote in message
>
> >news:5f38834d-46c7-45bf-9fb9-8d5c354bf0cf [at] 8g2000hse.googleg roups.com...
> > On Mar 31, 2:52 pm, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
>
> > > By hiding what exactly you mean???
>
> > > Do it like <!--<%#Eval("Pin")%>--> and it will be hidden in a
> > > browser....
>
> > > Or how about not to have <%#Eval("Pin")%> at all? It will be really
> > > hidden
> > > then :)
>
> > > George.
>
> > > "JJ297" <nc... [at] yahoo.com> wrote in message
>
> > >news:244d20da-4bd3-4701-9d16-a1d9f9cc5046 [at] p25g2000hsf.googl egroups.com...
>
> > > >I want to hide the Pin field below in my repeater. How do I do this?
>
> > > > <asp:Repeater ID="Repeater1" runat="server"
> > > > DataSourceID="SqlDataSource1">
>
> > > > <ItemTemplate>
> > > > <tr>
> > > > <td><font color="#330099">Claim SSN: </font><b><%#
> > > > Eval("ClaimSSN") %></b></td>
> > > > <td colspan="2"></td>
> > > > <td><font color="#330099">BIC: </font><b><%# Eval("BIC") %></
> > > > b></td>
>
> > > > <td colspan="2"></td>
>
> > > > <td colspan="2"><font color="#330099">BIC SSN: </font><b><%#
> > > > Eval("BICSSN") %></b></td>
>
> > > > <tr></tr>
> > > > <td colspan="7"></td>
>
> > > > <td colspan="7"><font color="#330099">Status Code: </font><b><
> > > > %# Eval("StatusCode")%></b></td>
>
> > > > <td><label runat="server" id="lbl"><font color="#330099">Pin:
> > > > </font><b><%#Eval("Pin")%></label></b></tr>
> > > > </ItemTemplate>
> > > > <SeparatorTemplate>
> > > > <tr>
> > > > <td colspan="100%"><hr size="1" color=#330099 />

>
> > > > </td>
> > > > </tr>
> > > > </SeparatorTemplate>
> > > > <FooterTemplate>
> > > > </table>
> > > > </FooterTemplate>
> > > > </asp:Repeater>- Hide quoted text -
>
> > > - Show quoted text -
>
> > I want to put security on the page if the person has manager rights
> > they will have the Pin field visible.
>
> > So I will put something like:
>
> > If Session(CSI) = true then
>
> > the pin field is visible
>
> > else
>
> > the pin field in not visible
>
> > I hope that makes sense
> > I want the Pin field- Hide quoted text -
>
> > - Show quoted text -
>
> A little confused... like this:
>
> Function getPin(ByVal sPin)
>
> If Session(CSI) = True Then
> Return sPin.visible = False
>
> End If
> End Function- Hide quoted text -
>
> - Show quoted text -

Thanks George:

Here's my function:

Function getPin(ByVal sPin)


If Session("SPSListings") = True Then
Return sPin
Else
Return "you have no access"

End If


End Function

Then on the aspx page I have this but I'm getting Container is not
declared. Any suggestions?

<font color="#330099">Pin: </font><b><
%getPin(DataBinder.Eval(Container.DataItem, "Pin"))%></td></b></tr>
George Ter-Saakov [ Di, 01 April 2008 17:18 ] [ ID #1932658 ]

Re: Hiding a field in a repeater

On Apr 1, 11:18=A0am, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
> It's cause you missing #
> Must be
> <%# getPin(DataBinder.Eval(Container.DataItem, "Pin"))%>
> ----------------------------------------------------
> Nothing is changed comparing
> to <%#Eval("Pin")%>
>
> The Eval("Pin") method is exactly same thing as
> DataBinder.Eval(Container.DataItem, "Pin"))
> It returns string during binding time... We just plugde getPing in between=

> to analyse permission and modify the string...
>
> PS:
> Also since getPin is called for every row it makes sence to move
> Session("CSI") out of the loop (it's a look up in a hashtable done for eve=
ry
> row)..
>
> So in your Page =A0create member variable _bCSI =3D false and in OnLoad ev=
ent
> assign it _bCSI =3D (bool)Session("CSI") (sorry C# again)
> the in getPin do If( _bCSI =3D True) ...... Saves a little of runtime....
>
> George.
>
> "JJ297" <nc... [at] yahoo.com> wrote in message
>
> news:18d01bca-feb5-435e-8c68-f12d1e45f9f2 [at] u69g2000hse.google groups.com...
> On Apr 1, 7:57 am, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
>
>
>
>
>
> > The idea to output to browser Pin or nothing to the user if he does not
> > have
> > permissions. It's a little different aproach than just hiding this colum=
n
> > which is in HTML word might be prefered way.
>
> > so in C# code it will be
> > protected string GetPin(string sPin)
> > {
> > if (Session("CSI") =3D=3D true)
> > return sPin
> > else
> > return " " //or anything you want
>
> > }
>
> > And on your page you have
>
> > <%# GetPin((string)DataBinder.Eval(Container.DataItem, "Pin"))%>
>
> > This line will call your GetPin for every row and output sPin or  
> > depends on what is in Session("CSI")
>
> > George.
>
> > "JJ297" <nc... [at] yahoo.com> wrote in message
>
> >news:912b6291-f5bf-4f98-b54e-f62a70b91706 [at] m73g2000hsh.googl egroups.com...=

> > On Mar 31, 3:33 pm, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
>
> > > I see it now....
> > > The best way to do is following....
> > > in your code on the page make a function (C# example, but you should n=
ot
> > > have a problem to convert it to VB.NET)
>
> > > protected string GetPin(string sPin)
> > > {
> > > if( _iLevel > 1 )
> > > return sPin;
> > > else
> > > return "******";
>
> > > }
>
> > > in your aspx page instead of
> > > <%#Eval("Pin")%>
> > > have something like
> > > <%# GetPin((string)DataBinder.Eval(Container.DataItem, "Pin"))%>
>
> > > Remember, Eval is the function and you always can create your own
> > > version.....
>
> > > George.
>
> > > "JJ297" <nc... [at] yahoo.com> wrote in message
>
> > >news:5f38834d-46c7-45bf-9fb9-8d5c354bf0cf [at] 8g2000hse.googleg roups.com...=

> > > On Mar 31, 2:52 pm, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
>
> > > > By hiding what exactly you mean???
>
> > > > Do it like <!--<%#Eval("Pin")%>--> and it will be hidden in a
> > > > browser....
>
> > > > Or how about not to have <%#Eval("Pin")%> at all? It will be really
> > > > hidden
> > > > then :)
>
> > > > George.
>
> > > > "JJ297" <nc... [at] yahoo.com> wrote in message
>
> > > >news:244d20da-4bd3-4701-9d16-a1d9f9cc5046 [at] p25g2000hsf.googl egroups.co=
m...
>
> > > > >I want to hide the Pin field below in my repeater. How do I do this=
?
>
> > > > > <asp:Repeater ID=3D"Repeater1" runat=3D"server"
> > > > > DataSourceID=3D"SqlDataSource1">
>
> > > > > <ItemTemplate>
> > > > > <tr>
> > > > > <td><font color=3D"#330099">Claim SSN: </font><b><%#
> > > > > Eval("ClaimSSN") %></b></td>
> > > > > <td colspan=3D"2"></td>
> > > > > <td><font color=3D"#330099">BIC: </font><b><%# Eval("BIC") %></
> > > > > b></td>
>
> > > > > <td colspan=3D"2"></td>
>
> > > > > <td colspan=3D"2"><font color=3D"#330099">BIC SSN: </font><b><%#
> > > > > Eval("BICSSN") %></b></td>
>
> > > > > <tr></tr>
> > > > > <td colspan=3D"7"></td>
>
> > > > > <td colspan=3D"7"><font color=3D"#330099">Status Code: </font><b><=

> > > > > %# Eval("StatusCode")%></b></td>
>
> > > > > <td><label runat=3D"server" id=3D"lbl"><font color=3D"#330099">Pin=
:
> > > > > </font><b><%#Eval("Pin")%></label></b></tr>
> > > > > </ItemTemplate>
> > > > > <SeparatorTemplate>
> > > > > <tr>
> > > > > <td colspan=3D"100%"><hr size=3D"1" color=3D#330099 />

>
> > > > > </td>
> > > > > </tr>
> > > > > </SeparatorTemplate>
> > > > > <FooterTemplate>
> > > > > </table>
> > > > > </FooterTemplate>
> > > > > </asp:Repeater>- Hide quoted text -
>
> > > > - Show quoted text -
>
> > > I want to put security on the page if the person has manager rights
> > > they will have the Pin field visible.
>
> > > So I will put something like:
>
> > > If Session(CSI) =3D true then
>
> > > the pin field is visible
>
> > > else
>
> > > the pin field in not visible
>
> > > I hope that makes sense
> > > I want the Pin field- Hide quoted text -
>
> > > - Show quoted text -
>
> > A little confused... like this:
>
> > Function getPin(ByVal sPin)
>
> > If Session(CSI) =3D True Then
> > Return sPin.visible =3D False
>
> > End If
> > End Function- Hide quoted text -
>
> > - Show quoted text -
>
> Thanks George:
>
> Here's my function:
>
> =A0Function getPin(ByVal sPin)
>
> =A0 =A0 =A0 =A0 If Session("SPSListings") =3D True Then
> =A0 =A0 =A0 =A0 =A0 =A0 Return sPin
> =A0 =A0 =A0 =A0 Else
> =A0 =A0 =A0 =A0 =A0 =A0 Return "you have no access"
>
> =A0 =A0 =A0 =A0 End If
>
> =A0 =A0 End Function
>
> Then on the aspx page I have this but I'm getting Container is not
> declared. =A0Any suggestions?
>
> <font color=3D"#330099">Pin: </font><b><
> %getPin(DataBinder.Eval(Container.DataItem, "Pin"))%></td></b></tr>- Hide =
quoted text -
>
> - Show quoted text -

Okay don't quite understand what you want me to do. I added this to
page load:

Dim _bCSI=3D(bool)Session("CSI")

Getting error message end of statement expected

Then added this:

Function getPin(ByVal sPin)

If (_BCSI =3D True) Then

Return "you have no access"

End If


End Function

Getting _BCSI is not declared. Any suggestions? Thanks
JJ297 [ Di, 01 April 2008 18:14 ] [ ID #1932665 ]

Re: Hiding a field in a repeater

You can not do it like that...
When you added Dim _bCSI=(bool)Session("CSI") to page_load you created local
variable that is only available in page_load
mast be something like

class clsMyPage
{
Dim _bCSI as Boolean
...Page_Load...
{
_bCSI=(bool)Session("CSI")
}

Function getPin(ByVal sPin)

If (_bCSI = True) Then

Return "you have no access"

End If


End Function

}



"JJ297" <nc297 [at] yahoo.com> wrote in message
news:50d90311-10c5-4a71-86e2-b38bfe82f9d3 [at] d1g2000hsg.googleg roups.com...
On Apr 1, 11:18 am, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
> It's cause you missing #
> Must be
> <%# getPin(DataBinder.Eval(Container.DataItem, "Pin"))%>
> ----------------------------------------------------
> Nothing is changed comparing
> to <%#Eval("Pin")%>
>
> The Eval("Pin") method is exactly same thing as
> DataBinder.Eval(Container.DataItem, "Pin"))
> It returns string during binding time... We just plugde getPing in between
> to analyse permission and modify the string...
>
> PS:
> Also since getPin is called for every row it makes sence to move
> Session("CSI") out of the loop (it's a look up in a hashtable done for
> every
> row)..
>
> So in your Page create member variable _bCSI = false and in OnLoad event
> assign it _bCSI = (bool)Session("CSI") (sorry C# again)
> the in getPin do If( _bCSI = True) ...... Saves a little of runtime....
>
> George.
>
> "JJ297" <nc... [at] yahoo.com> wrote in message
>
> news:18d01bca-feb5-435e-8c68-f12d1e45f9f2 [at] u69g2000hse.google groups.com...
> On Apr 1, 7:57 am, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
>
>
>
>
>
> > The idea to output to browser Pin or nothing to the user if he does not
> > have
> > permissions. It's a little different aproach than just hiding this
> > column
> > which is in HTML word might be prefered way.
>
> > so in C# code it will be
> > protected string GetPin(string sPin)
> > {
> > if (Session("CSI") == true)
> > return sPin
> > else
> > return " " //or anything you want
>
> > }
>
> > And on your page you have
>
> > <%# GetPin((string)DataBinder.Eval(Container.DataItem, "Pin"))%>
>
> > This line will call your GetPin for every row and output sPin or  
> > depends on what is in Session("CSI")
>
> > George.
>
> > "JJ297" <nc... [at] yahoo.com> wrote in message
>
> >news:912b6291-f5bf-4f98-b54e-f62a70b91706 [at] m73g2000hsh.googl egroups.com...
> > On Mar 31, 3:33 pm, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
>
> > > I see it now....
> > > The best way to do is following....
> > > in your code on the page make a function (C# example, but you should
> > > not
> > > have a problem to convert it to VB.NET)
>
> > > protected string GetPin(string sPin)
> > > {
> > > if( _iLevel > 1 )
> > > return sPin;
> > > else
> > > return "******";
>
> > > }
>
> > > in your aspx page instead of
> > > <%#Eval("Pin")%>
> > > have something like
> > > <%# GetPin((string)DataBinder.Eval(Container.DataItem, "Pin"))%>
>
> > > Remember, Eval is the function and you always can create your own
> > > version.....
>
> > > George.
>
> > > "JJ297" <nc... [at] yahoo.com> wrote in message
>
> > >news:5f38834d-46c7-45bf-9fb9-8d5c354bf0cf [at] 8g2000hse.googleg roups.com...
> > > On Mar 31, 2:52 pm, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
>
> > > > By hiding what exactly you mean???
>
> > > > Do it like <!--<%#Eval("Pin")%>--> and it will be hidden in a
> > > > browser....
>
> > > > Or how about not to have <%#Eval("Pin")%> at all? It will be really
> > > > hidden
> > > > then :)
>
> > > > George.
>
> > > > "JJ297" <nc... [at] yahoo.com> wrote in message
>
> > > >news:244d20da-4bd3-4701-9d16-a1d9f9cc5046 [at] p25g2000hsf.googl egroups.com...
>
> > > > >I want to hide the Pin field below in my repeater. How do I do
> > > > >this?
>
> > > > > <asp:Repeater ID="Repeater1" runat="server"
> > > > > DataSourceID="SqlDataSource1">
>
> > > > > <ItemTemplate>
> > > > > <tr>
> > > > > <td><font color="#330099">Claim SSN: </font><b><%#
> > > > > Eval("ClaimSSN") %></b></td>
> > > > > <td colspan="2"></td>
> > > > > <td><font color="#330099">BIC: </font><b><%# Eval("BIC") %></
> > > > > b></td>
>
> > > > > <td colspan="2"></td>
>
> > > > > <td colspan="2"><font color="#330099">BIC SSN: </font><b><%#
> > > > > Eval("BICSSN") %></b></td>
>
> > > > > <tr></tr>
> > > > > <td colspan="7"></td>
>
> > > > > <td colspan="7"><font color="#330099">Status Code: </font><b><
> > > > > %# Eval("StatusCode")%></b></td>
>
> > > > > <td><label runat="server" id="lbl"><font color="#330099">Pin:
> > > > > </font><b><%#Eval("Pin")%></label></b></tr>
> > > > > </ItemTemplate>
> > > > > <SeparatorTemplate>
> > > > > <tr>
> > > > > <td colspan="100%"><hr size="1" color=#330099 />

>
> > > > > </td>
> > > > > </tr>
> > > > > </SeparatorTemplate>
> > > > > <FooterTemplate>
> > > > > </table>
> > > > > </FooterTemplate>
> > > > > </asp:Repeater>- Hide quoted text -
>
> > > > - Show quoted text -
>
> > > I want to put security on the page if the person has manager rights
> > > they will have the Pin field visible.
>
> > > So I will put something like:
>
> > > If Session(CSI) = true then
>
> > > the pin field is visible
>
> > > else
>
> > > the pin field in not visible
>
> > > I hope that makes sense
> > > I want the Pin field- Hide quoted text -
>
> > > - Show quoted text -
>
> > A little confused... like this:
>
> > Function getPin(ByVal sPin)
>
> > If Session(CSI) = True Then
> > Return sPin.visible = False
>
> > End If
> > End Function- Hide quoted text -
>
> > - Show quoted text -
>
> Thanks George:
>
> Here's my function:
>
> Function getPin(ByVal sPin)
>
> If Session("SPSListings") = True Then
> Return sPin
> Else
> Return "you have no access"
>
> End If
>
> End Function
>
> Then on the aspx page I have this but I'm getting Container is not
> declared. Any suggestions?
>
> <font color="#330099">Pin: </font><b><
> %getPin(DataBinder.Eval(Container.DataItem, "Pin"))%></td></b></tr>- Hide
> quoted text -
>
> - Show quoted text -

Okay don't quite understand what you want me to do. I added this to
page load:

Dim _bCSI=(bool)Session("CSI")

Getting error message end of statement expected

Then added this:

Function getPin(ByVal sPin)

If (_BCSI = True) Then

Return "you have no access"

End If


End Function

Getting _BCSI is not declared. Any suggestions? Thanks
George Ter-Saakov [ Di, 01 April 2008 18:37 ] [ ID #1932668 ]

Re: Hiding a field in a repeater

You can by doing
Repeater1.Items[0].Visible = false;
It will hide first column in repeater..

George,.



"JJ297" <nc297 [at] yahoo.com> wrote in message
news:c66a0993-83ce-4cb0-9df8-ae4e5c1fe024 [at] z38g2000hsc.google groups.com...
On Apr 1, 10:58 am, JJ297 <nc... [at] yahoo.com> wrote:
> On Apr 1, 7:57 am, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
>
>
>
>
>
> > The idea to output to browser Pin or nothing to the user if he does not
> > have
> > permissions. It's a little different aproach than just hiding this
> > column
> > which is in HTML word might be prefered way.
>
> > so in C# code it will be
> > protected string GetPin(string sPin)
> > {
> > if (Session("CSI") == true)
> > return sPin
> > else
> > return " " //or anything you want
>
> > }
>
> > And on your page you have
>
> > <%# GetPin((string)DataBinder.Eval(Container.DataItem, "Pin"))%>
>
> > This line will call your GetPin for every row and output sPin or
> > depends on what is in Session("CSI")
>
> > George.
>
> > "JJ297" <nc... [at] yahoo.com> wrote in message
>
> >news:912b6291-f5bf-4f98-b54e-f62a70b91706 [at] m73g2000hsh.googl egroups.com...
> > On Mar 31, 3:33 pm, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
>
> > > I see it now....
> > > The best way to do is following....
> > > in your code on the page make a function (C# example, but you should
> > > not
> > > have a problem to convert it to VB.NET)
>
> > > protected string GetPin(string sPin)
> > > {
> > > if( _iLevel > 1 )
> > > return sPin;
> > > else
> > > return "******";
>
> > > }
>
> > > in your aspx page instead of
> > > <%#Eval("Pin")%>
> > > have something like
> > > <%# GetPin((string)DataBinder.Eval(Container.DataItem, "Pin"))%>
>
> > > Remember, Eval is the function and you always can create your own
> > > version.....
>
> > > George.
>
> > > "JJ297" <nc... [at] yahoo.com> wrote in message
>
> > >news:5f38834d-46c7-45bf-9fb9-8d5c354bf0cf [at] 8g2000hse.googleg roups.com...
> > > On Mar 31, 2:52 pm, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
>
> > > > By hiding what exactly you mean???
>
> > > > Do it like <!--<%#Eval("Pin")%>--> and it will be hidden in a
> > > > browser....
>
> > > > Or how about not to have <%#Eval("Pin")%> at all? It will be really
> > > > hidden
> > > > then :)
>
> > > > George.
>
> > > > "JJ297" <nc... [at] yahoo.com> wrote in message
>
> > > >news:244d20da-4bd3-4701-9d16-a1d9f9cc5046 [at] p25g2000hsf.googl egroups.com...
>
> > > > >I want to hide the Pin field below in my repeater. How do I do
> > > > >this?
>
> > > > > <asp:Repeater ID="Repeater1" runat="server"
> > > > > DataSourceID="SqlDataSource1">
>
> > > > > <ItemTemplate>
> > > > > <tr>
> > > > > <td><font color="#330099">Claim SSN: </font><b><%#
> > > > > Eval("ClaimSSN") %></b></td>
> > > > > <td colspan="2"></td>
> > > > > <td><font color="#330099">BIC: </font><b><%# Eval("BIC") %></
> > > > > b></td>
>
> > > > > <td colspan="2"></td>
>
> > > > > <td colspan="2"><font color="#330099">BIC SSN: </font><b><%#
> > > > > Eval("BICSSN") %></b></td>
>
> > > > > <tr></tr>
> > > > > <td colspan="7"></td>
>
> > > > > <td colspan="7"><font color="#330099">Status Code: </font><b><
> > > > > %# Eval("StatusCode")%></b></td>
>
> > > > > <td><label runat="server" id="lbl"><font color="#330099">Pin:
> > > > > </font><b><%#Eval("Pin")%></label></b></tr>
> > > > > </ItemTemplate>
> > > > > <SeparatorTemplate>
> > > > > <tr>
> > > > > <td colspan="100%"><hr size="1" color=#330099 />

>
> > > > > </td>
> > > > > </tr>
> > > > > </SeparatorTemplate>
> > > > > <FooterTemplate>
> > > > > </table>
> > > > > </FooterTemplate>
> > > > > </asp:Repeater>- Hide quoted text -
>
> > > > - Show quoted text -
>
> > > I want to put security on the page if the person has manager rights
> > > they will have the Pin field visible.
>
> > > So I will put something like:
>
> > > If Session(CSI) = true then
>
> > > the pin field is visible
>
> > > else
>
> > > the pin field in not visible
>
> > > I hope that makes sense
> > > I want the Pin field- Hide quoted text -
>
> > > - Show quoted text -
>
> > A little confused... like this:
>
> > Function getPin(ByVal sPin)
>
> > If Session(CSI) = True Then
> > Return sPin.visible = False
>
> > End If
> > End Function- Hide quoted text -
>
> > - Show quoted text -
>
> Thanks George:
>
> Here's my function:
>
> Function getPin(ByVal sPin)
>
> If Session("SPSListings") = True Then
> Return sPin
> Else
> Return "you have no access"
>
> End If
>
> End Function
>
> Then on the aspx page I have this but I'm getting Container is not
> declared. Any suggestions?
>
> <font color="#330099">Pin: </font><b><
> %getPin(DataBinder.Eval(Container.DataItem, "Pin"))%></td></b></tr>- Hide
> quoted text -
>
> - Show quoted text -

George I got it I left out the # in front of the GetPin. Thanks.

Another question for you. I have this in the function:
If Session("SPSListings") = True Then
Return sPin
Else
Return "you have no access"

End If

How can I get rid of the Pin column all together if the user doesn't
have access instead of returning "You have no Access" Can I make that
column visiable = false?
George Ter-Saakov [ Di, 01 April 2008 18:40 ] [ ID #1932669 ]

Re: Hiding a field in a repeater

On Apr 1, 12:40=A0pm, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
> You can by doing
> Repeater1.Items[0].Visible =3D false;
> It will hide first column in repeater..
>
> George,.
>
> "JJ297" <nc... [at] yahoo.com> wrote in message
>
> news:c66a0993-83ce-4cb0-9df8-ae4e5c1fe024 [at] z38g2000hsc.google groups.com...
> On Apr 1, 10:58 am, JJ297 <nc... [at] yahoo.com> wrote:
>
>
>
>
>
> > On Apr 1, 7:57 am, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
>
> > > The idea to output to browser Pin or nothing to the user if he does no=
t
> > > have
> > > permissions. It's a little different aproach than just hiding this
> > > column
> > > which is in HTML word might be prefered way.
>
> > > so in C# code it will be
> > > protected string GetPin(string sPin)
> > > {
> > > if (Session("CSI") =3D=3D true)
> > > return sPin
> > > else
> > > return " " //or anything you want
>
> > > }
>
> > > And on your page you have
>
> > > <%# GetPin((string)DataBinder.Eval(Container.DataItem, "Pin"))%>
>
> > > This line will call your GetPin for every row and output sPin or
> > > depends on what is in Session("CSI")
>
> > > George.
>
> > > "JJ297" <nc... [at] yahoo.com> wrote in message
>
> > >news:912b6291-f5bf-4f98-b54e-f62a70b91706 [at] m73g2000hsh.googl egroups.com.=
...
> > > On Mar 31, 3:33 pm, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
>
> > > > I see it now....
> > > > The best way to do is following....
> > > > in your code on the page make a function (C# example, but you should=

> > > > not
> > > > have a problem to convert it to VB.NET)
>
> > > > protected string GetPin(string sPin)
> > > > {
> > > > if( _iLevel > 1 )
> > > > return sPin;
> > > > else
> > > > return "******";
>
> > > > }
>
> > > > in your aspx page instead of
> > > > <%#Eval("Pin")%>
> > > > have something like
> > > > <%# GetPin((string)DataBinder.Eval(Container.DataItem, "Pin"))%>
>
> > > > Remember, Eval is the function and you always can create your own
> > > > version.....
>
> > > > George.
>
> > > > "JJ297" <nc... [at] yahoo.com> wrote in message
>
> > > >news:5f38834d-46c7-45bf-9fb9-8d5c354bf0cf [at] 8g2000hse.googleg roups.com.=
...
> > > > On Mar 31, 2:52 pm, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
>
> > > > > By hiding what exactly you mean???
>
> > > > > Do it like <!--<%#Eval("Pin")%>--> and it will be hidden in a
> > > > > browser....
>
> > > > > Or how about not to have <%#Eval("Pin")%> at all? It will be reall=
y
> > > > > hidden
> > > > > then :)
>
> > > > > George.
>
> > > > > "JJ297" <nc... [at] yahoo.com> wrote in message
>
> > > > >news:244d20da-4bd3-4701-9d16-a1d9f9cc5046 [at] p25g2000hsf.googl egroups.=
com...
>
> > > > > >I want to hide the Pin field below in my repeater. How do I do
> > > > > >this?
>
> > > > > > <asp:Repeater ID=3D"Repeater1" runat=3D"server"
> > > > > > DataSourceID=3D"SqlDataSource1">
>
> > > > > > <ItemTemplate>
> > > > > > <tr>
> > > > > > <td><font color=3D"#330099">Claim SSN: </font><b><%#
> > > > > > Eval("ClaimSSN") %></b></td>
> > > > > > <td colspan=3D"2"></td>
> > > > > > <td><font color=3D"#330099">BIC: </font><b><%# Eval("BIC") %></
> > > > > > b></td>
>
> > > > > > <td colspan=3D"2"></td>
>
> > > > > > <td colspan=3D"2"><font color=3D"#330099">BIC SSN: </font><b><%#=

> > > > > > Eval("BICSSN") %></b></td>
>
> > > > > > <tr></tr>
> > > > > > <td colspan=3D"7"></td>
>
> > > > > > <td colspan=3D"7"><font color=3D"#330099">Status Code: </font><b=
><
> > > > > > %# Eval("StatusCode")%></b></td>
>
> > > > > > <td><label runat=3D"server" id=3D"lbl"><font color=3D"#330099">P=
in:
> > > > > > </font><b><%#Eval("Pin")%></label></b></tr>
> > > > > > </ItemTemplate>
> > > > > > <SeparatorTemplate>
> > > > > > <tr>
> > > > > > <td colspan=3D"100%"><hr size=3D"1" color=3D#330099 />

>
> > > > > > </td>
> > > > > > </tr>
> > > > > > </SeparatorTemplate>
> > > > > > <FooterTemplate>
> > > > > > </table>
> > > > > > </FooterTemplate>
> > > > > > </asp:Repeater>- Hide quoted text -
>
> > > > > - Show quoted text -
>
> > > > I want to put security on the page if the person has manager rights
> > > > they will have the Pin field visible.
>
> > > > So I will put something like:
>
> > > > If Session(CSI) =3D true then
>
> > > > the pin field is visible
>
> > > > else
>
> > > > the pin field in not visible
>
> > > > I hope that makes sense
> > > > I want the Pin field- Hide quoted text -
>
> > > > - Show quoted text -
>
> > > A little confused... like this:
>
> > > Function getPin(ByVal sPin)
>
> > > If Session(CSI) =3D True Then
> > > Return sPin.visible =3D False
>
> > > End If
> > > End Function- Hide quoted text -
>
> > > - Show quoted text -
>
> > Thanks George:
>
> > Here's my function:
>
> > Function getPin(ByVal sPin)
>
> > If Session("SPSListings") =3D True Then
> > Return sPin
> > Else
> > Return "you have no access"
>
> > End If
>
> > End Function
>
> > Then on the aspx page I have this but I'm getting Container is not
> > declared. Any suggestions?
>
> > <font color=3D"#330099">Pin: </font><b><
> > %getPin(DataBinder.Eval(Container.DataItem, "Pin"))%></td></b></tr>- Hid=
e
> > quoted text -
>
> > - Show quoted text -
>
> George I got it I left out the # in front of the GetPin. =A0Thanks.
>
> Another question for you. =A0I have this in the function:
> =A0If Session("SPSListings") =3D True Then
> =A0 =A0 =A0 =A0 =A0 =A0 Return sPin
> =A0 =A0 =A0 =A0 Else
> =A0 =A0 =A0 =A0 =A0 =A0 Return "you have no access"
>
> =A0 =A0 =A0 =A0 End If
>
> How can I get rid of the Pin column all together if the user doesn't
> have access instead of returning "You have no Access" =A0Can I make that
> column visiable =3D false?- Hide quoted text -
>
> - Show quoted text -

Okay I added this:

Function getPin(ByVal sPin)

If Session("SPSListings") =3D True Then
Return sPin
Else
Return Repeater1.Items(8).Visible =3D False

End If

End Function

But now getting this...Index was out of range. Must be non-negative
and less than the size of the collection.
Parameter name: index
JJ297 [ Mi, 02 April 2008 16:24 ] [ ID #1933662 ]

Re: Hiding a field in a repeater

You are completely confused....
chose one method or another.

If you just want to hide the column with PIN then in OnLoad event do
Repeater1.Items(8).Visible = False
(column enumeration starts with 0, so it's 0,1,2,.... So Item(8).Visible =
false will hide 9th column)

If you want to show something like "no permissions" then go with a getPin
method...

But you can not do both....

George.





"JJ297" <nc297 [at] yahoo.com> wrote in message
news:27007bc5-8c9b-46ba-a604-64a8f8c4d8d1 [at] y21g2000hsf.google groups.com...
On Apr 1, 12:40 pm, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
> You can by doing
> Repeater1.Items[0].Visible = false;
> It will hide first column in repeater..
>
> George,.
>
> "JJ297" <nc... [at] yahoo.com> wrote in message
>
> news:c66a0993-83ce-4cb0-9df8-ae4e5c1fe024 [at] z38g2000hsc.google groups.com...
> On Apr 1, 10:58 am, JJ297 <nc... [at] yahoo.com> wrote:
>
>
>
>
>
> > On Apr 1, 7:57 am, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
>
> > > The idea to output to browser Pin or nothing to the user if he does
> > > not
> > > have
> > > permissions. It's a little different aproach than just hiding this
> > > column
> > > which is in HTML word might be prefered way.
>
> > > so in C# code it will be
> > > protected string GetPin(string sPin)
> > > {
> > > if (Session("CSI") == true)
> > > return sPin
> > > else
> > > return " " //or anything you want
>
> > > }
>
> > > And on your page you have
>
> > > <%# GetPin((string)DataBinder.Eval(Container.DataItem, "Pin"))%>
>
> > > This line will call your GetPin for every row and output sPin or
> > > depends on what is in Session("CSI")
>
> > > George.
>
> > > "JJ297" <nc... [at] yahoo.com> wrote in message
>
> > >news:912b6291-f5bf-4f98-b54e-f62a70b91706 [at] m73g2000hsh.googl egroups.com...
> > > On Mar 31, 3:33 pm, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
>
> > > > I see it now....
> > > > The best way to do is following....
> > > > in your code on the page make a function (C# example, but you should
> > > > not
> > > > have a problem to convert it to VB.NET)
>
> > > > protected string GetPin(string sPin)
> > > > {
> > > > if( _iLevel > 1 )
> > > > return sPin;
> > > > else
> > > > return "******";
>
> > > > }
>
> > > > in your aspx page instead of
> > > > <%#Eval("Pin")%>
> > > > have something like
> > > > <%# GetPin((string)DataBinder.Eval(Container.DataItem, "Pin"))%>
>
> > > > Remember, Eval is the function and you always can create your own
> > > > version.....
>
> > > > George.
>
> > > > "JJ297" <nc... [at] yahoo.com> wrote in message
>
> > > >news:5f38834d-46c7-45bf-9fb9-8d5c354bf0cf [at] 8g2000hse.googleg roups.com...
> > > > On Mar 31, 2:52 pm, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
>
> > > > > By hiding what exactly you mean???
>
> > > > > Do it like <!--<%#Eval("Pin")%>--> and it will be hidden in a
> > > > > browser....
>
> > > > > Or how about not to have <%#Eval("Pin")%> at all? It will be
> > > > > really
> > > > > hidden
> > > > > then :)
>
> > > > > George.
>
> > > > > "JJ297" <nc... [at] yahoo.com> wrote in message
>
> > > > >news:244d20da-4bd3-4701-9d16-a1d9f9cc5046 [at] p25g2000hsf.googl egroups.com...
>
> > > > > >I want to hide the Pin field below in my repeater. How do I do
> > > > > >this?
>
> > > > > > <asp:Repeater ID="Repeater1" runat="server"
> > > > > > DataSourceID="SqlDataSource1">
>
> > > > > > <ItemTemplate>
> > > > > > <tr>
> > > > > > <td><font color="#330099">Claim SSN: </font><b><%#
> > > > > > Eval("ClaimSSN") %></b></td>
> > > > > > <td colspan="2"></td>
> > > > > > <td><font color="#330099">BIC: </font><b><%# Eval("BIC") %></
> > > > > > b></td>
>
> > > > > > <td colspan="2"></td>
>
> > > > > > <td colspan="2"><font color="#330099">BIC SSN: </font><b><%#
> > > > > > Eval("BICSSN") %></b></td>
>
> > > > > > <tr></tr>
> > > > > > <td colspan="7"></td>
>
> > > > > > <td colspan="7"><font color="#330099">Status Code: </font><b><
> > > > > > %# Eval("StatusCode")%></b></td>
>
> > > > > > <td><label runat="server" id="lbl"><font color="#330099">Pin:
> > > > > > </font><b><%#Eval("Pin")%></label></b></tr>
> > > > > > </ItemTemplate>
> > > > > > <SeparatorTemplate>
> > > > > > <tr>
> > > > > > <td colspan="100%"><hr size="1" color=#330099 />

>
> > > > > > </td>
> > > > > > </tr>
> > > > > > </SeparatorTemplate>
> > > > > > <FooterTemplate>
> > > > > > </table>
> > > > > > </FooterTemplate>
> > > > > > </asp:Repeater>- Hide quoted text -
>
> > > > > - Show quoted text -
>
> > > > I want to put security on the page if the person has manager rights
> > > > they will have the Pin field visible.
>
> > > > So I will put something like:
>
> > > > If Session(CSI) = true then
>
> > > > the pin field is visible
>
> > > > else
>
> > > > the pin field in not visible
>
> > > > I hope that makes sense
> > > > I want the Pin field- Hide quoted text -
>
> > > > - Show quoted text -
>
> > > A little confused... like this:
>
> > > Function getPin(ByVal sPin)
>
> > > If Session(CSI) = True Then
> > > Return sPin.visible = False
>
> > > End If
> > > End Function- Hide quoted text -
>
> > > - Show quoted text -
>
> > Thanks George:
>
> > Here's my function:
>
> > Function getPin(ByVal sPin)
>
> > If Session("SPSListings") = True Then
> > Return sPin
> > Else
> > Return "you have no access"
>
> > End If
>
> > End Function
>
> > Then on the aspx page I have this but I'm getting Container is not
> > declared. Any suggestions?
>
> > <font color="#330099">Pin: </font><b><
> > %getPin(DataBinder.Eval(Container.DataItem, "Pin"))%></td></b></tr>-
> > Hide
> > quoted text -
>
> > - Show quoted text -
>
> George I got it I left out the # in front of the GetPin. Thanks.
>
> Another question for you. I have this in the function:
> If Session("SPSListings") = True Then
> Return sPin
> Else
> Return "you have no access"
>
> End If
>
> How can I get rid of the Pin column all together if the user doesn't
> have access instead of returning "You have no Access" Can I make that
> column visiable = false?- Hide quoted text -
>
> - Show quoted text -

Okay I added this:

Function getPin(ByVal sPin)

If Session("SPSListings") = True Then
Return sPin
Else
Return Repeater1.Items(8).Visible = False

End If

End Function

But now getting this...Index was out of range. Must be non-negative
and less than the size of the collection.
Parameter name: index
George Ter-Saakov [ Mi, 02 April 2008 16:41 ] [ ID #1933664 ]

Re: Hiding a field in a repeater

On Apr 2, 10:41=A0am, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
> You are completely confused....
> chose one method or another.
>
> If you just want to hide the column with PIN then in OnLoad event do
> Repeater1.Items(8).Visible =3D False
> (column enumeration starts with 0, so it's 0,1,2,.... So Item(8).Visible =
=3D
> false will hide 9th column)
>
> If you want to show something like "no permissions" then go with a getPin
> method...
>
> But you can not do both....
>
> George.
>
> "JJ297" <nc... [at] yahoo.com> wrote in message
>
> news:27007bc5-8c9b-46ba-a604-64a8f8c4d8d1 [at] y21g2000hsf.google groups.com...
> On Apr 1, 12:40 pm, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
>
>
>
>
>
> > You can by doing
> > Repeater1.Items[0].Visible =3D false;
> > It will hide first column in repeater..
>
> > George,.
>
> > "JJ297" <nc... [at] yahoo.com> wrote in message
>
> >news:c66a0993-83ce-4cb0-9df8-ae4e5c1fe024 [at] z38g2000hsc.googl egroups.com...=

> > On Apr 1, 10:58 am, JJ297 <nc... [at] yahoo.com> wrote:
>
> > > On Apr 1, 7:57 am, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
>
> > > > The idea to output to browser Pin or nothing to the user if he does
> > > > not
> > > > have
> > > > permissions. It's a little different aproach than just hiding this
> > > > column
> > > > which is in HTML word might be prefered way.
>
> > > > so in C# code it will be
> > > > protected string GetPin(string sPin)
> > > > {
> > > > if (Session("CSI") =3D=3D true)
> > > > return sPin
> > > > else
> > > > return " " //or anything you want
>
> > > > }
>
> > > > And on your page you have
>
> > > > <%# GetPin((string)DataBinder.Eval(Container.DataItem, "Pin"))%>
>
> > > > This line will call your GetPin for every row and output sPin or
> > > > depends on what is in Session("CSI")
>
> > > > George.
>
> > > > "JJ297" <nc... [at] yahoo.com> wrote in message
>
> > > >news:912b6291-f5bf-4f98-b54e-f62a70b91706 [at] m73g2000hsh.googl egroups.co=
m...
> > > > On Mar 31, 3:33 pm, "George Ter-Saakov" <gt-... [at] cardone.com> wrote:
>
> > > > > I see it now....
> > > > > The best way to do is following....
> > > > > in your code on the page make a function (C# example, but you shou=
ld
> > > > > not
> > > > > have a problem to convert it to VB.NET)
>
> > > > > protected string GetPin(string sPin)
> > > > > {
> > > > > if( _iLevel > 1 )
> > > > > return sPin;
> > > > > else
> > > > > return "******";
>
> > > > > }
>
> > > > > in your aspx page instead of
> > > > > <%#Eval("Pin")%>
> > > > > have something like
> > > > > <%# GetPin((string)DataBinder.Eval(Container.DataItem, "Pin"))%>
>
> > > > > Remember, Eval is the function and you always can create your own
> > > > > version.....
>
> > > > > George.
>
> > > > > "JJ297" <nc... [at] yahoo.com> wrote in message
>
> > > > >news:5f38834d-46c7-45bf-9fb9-8d5c354bf0cf [at] 8g2000hse.googleg roups.co=
m...
> > > > > On Mar 31, 2:52 pm, "George Ter-Saakov" <gt-... [at] cardone.com> wrote=
:
>
> > > > > > By hiding what exactly you mean???
>
> > > > > > Do it like <!--<%#Eval("Pin")%>--> and it will be hidden in a
> > > > > > browser....
>
> > > > > > Or how about not to have <%#Eval("Pin")%> at all? It will be
> > > > > > really
> > > > > > hidden
> > > > > > then :)
>
> > > > > > George.
>
> > > > > > "JJ297" <nc... [at] yahoo.com> wrote in message
>
> > > > > >news:244d20da-4bd3-4701-9d16-a1d9f9cc5046 [at] p25g2000hsf.googl egroup=
s.com...
>
> > > > > > >I want to hide the Pin field below in my repeater. How do I do
> > > > > > >this?
>
> > > > > > > <asp:Repeater ID=3D"Repeater1" runat=3D"server"
> > > > > > > DataSourceID=3D"SqlDataSource1">
>
> > > > > > > <ItemTemplate>
> > > > > > > <tr>
> > > > > > > <td><font color=3D"#330099">Claim SSN: </font><b><%#
> > > > > > > Eval("ClaimSSN") %></b></td>
> > > > > > > <td colspan=3D"2"></td>
> > > > > > > <td><font color=3D"#330099">BIC: </font><b><%# Eval("BIC") %><=
/
> > > > > > > b></td>
>
> > > > > > > <td colspan=3D"2"></td>
>
> > > > > > > <td colspan=3D"2"><font color=3D"#330099">BIC SSN: </font><b><=
%#
> > > > > > > Eval("BICSSN") %></b></td>
>
> > > > > > > <tr></tr>
> > > > > > > <td colspan=3D"7"></td>
>
> > > > > > > <td colspan=3D"7"><font color=3D"#330099">Status Code: </font>=
<b><
> > > > > > > %# Eval("StatusCode")%></b></td>
>
> > > > > > > <td><label runat=3D"server" id=3D"lbl"><font color=3D"#330099"=
>Pin:
> > > > > > > </font><b><%#Eval("Pin")%></label></b></tr>
> > > > > > > </ItemTemplate>
> > > > > > > <SeparatorTemplate>
> > > > > > > <tr>
> > > > > > > <td colspan=3D"100%"><hr size=3D"1" color=3D#330099 />

>
> > > > > > > </td>
> > > > > > > </tr>
> > > > > > > </SeparatorTemplate>
> > > > > > > <FooterTemplate>
> > > > > > > </table>
> > > > > > > </FooterTemplate>
> > > > > > > </asp:Repeater>- Hide quoted text -
>
> > > > > > - Show quoted text -
>
> > > > > I want to put security on the page if the person has manager right=
s
> > > > > they will have the Pin field visible.
>
> > > > > So I will put something like:
>
> > > > > If Session(CSI) =3D true then
>
> > > > > the pin field is visible
>
> > > > > else
>
> > > > > the pin field in not visible
>
> > > > > I hope that makes sense
> > > > > I want the Pin field- Hide quoted text -
>
> > > > > - Show quoted text -
>
> > > > A little confused... like this:
>
> > > > Function getPin(ByVal sPin)
>
> > > > If Session(CSI) =3D True Then
> > > > Return sPin.visible =3D False
>
> > > > End If
> > > > End Function- Hide quoted text -
>
> > > > - Show quoted text -
>
> > > Thanks George:
>
> > > Here's my function:
>
> > > Function getPin(ByVal sPin)
>
> > > If Session("SPSListings") =3D True Then
> > > Return sPin
> > > Else
> > > Return "you have no access"
>
> > > End If
>
> > > End Function
>
> > > Then on the aspx page I have this but I'm getting Container is not
> > > declared. Any suggestions?
>
> > > <font color=3D"#330099">Pin: </font><b><
> > > %getPin(DataBinder.Eval(Container.DataItem, "Pin"))%></td></b></tr>-
> > > Hide
> > > quoted text -
>
> > > - Show quoted text -
>
> > George I got it I left out the # in front of the GetPin. Thanks.
>
> > Another question for you. I have this in the function:
> > If Session("SPSListings") =3D True Then
> > Return sPin
> > Else
> > Return "you have no access"
>
> > End If
>
> > How can I get rid of the Pin column all together if the user doesn't
> > have access instead of returning "You have no Access" Can I make that
> > column visiable =3D false?- Hide quoted text -
>
> > - Show quoted text -
>
> Okay I added this:
>
> =A0Function getPin(ByVal sPin)
>
> =A0 =A0 =A0 =A0 If Session("SPSListings") =3D True Then
> =A0 =A0 =A0 =A0 =A0 =A0 Return sPin
> =A0 =A0 =A0 =A0 Else
> =A0 =A0 =A0 =A0 =A0 =A0 Return Repeater1.Items(8).Visible =3D False
>
> =A0 =A0 =A0 =A0 End If
>
> =A0 =A0 End Function
>
> But now getting this...Index was out of range. Must be non-negative
> and less than the size of the collection.
> Parameter name: index- Hide quoted text -
>
> - Show quoted text -

Okay I got it I need the "no permissions" so I'm going with GetPin.

Thanks for all of your help!!!!
JJ297 [ Mi, 02 April 2008 17:58 ] [ ID #1933674 ]
Microsoft » microsoft.public.dotnet.framework.aspnet » Hiding a field in a repeater

Vorheriges Thema: Dns.Resolve / GetHostByAddress deprecated in c# 2?
Nächstes Thema: Paging display on GridView with a large number of rows