Hiding a field in a repeater

Hiding a field in a repeater

am 31.03.2008 20:48:34 von JJ297

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

DataSourceID="SqlDataSource1">



Claim SSN: <%#
Eval("ClaimSSN") %>


BIC: <%# Eval("BIC") %> b>



BIC SSN: <%#
Eval("BICSSN") %>





Status Code: <
%# Eval("StatusCode")%>
















Re: Hiding a field in a repeater

am 31.03.2008 20:52:13 von George Ter-Saakov

By hiding what exactly you mean???

Do it like 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" wrote in message
news:244d20da-4bd3-4701-9d16-a1d9f9cc5046@p25g2000hsf.google groups.com...
>I want to hide the Pin field below in my repeater. How do I do this?
>
> > DataSourceID="SqlDataSource1">
>
>
>
> Claim SSN: <%#
> Eval("ClaimSSN") %>

>
> BIC: <%# Eval("BIC") %> > b>
>
>
>
> BIC SSN: <%#
> Eval("BICSSN") %>

>
>
>
>
> Status Code: <
> %# Eval("StatusCode")%>

>
>
>

>
>
>




>
>
>
>
>
>
>

>

Re: Hiding a field in a repeater

am 31.03.2008 21:13:04 von JJ297

On Mar 31, 2:52=A0pm, "George Ter-Saakov" wrote:
> By hiding what exactly you mean???
>
> Do it like 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" wrote in message
>
> news:244d20da-4bd3-4701-9d16-a1d9f9cc5046@p25g2000hsf.google groups.com...
>
>
>
> >I want to hide the Pin field below in my repeater. =A0How do I do this?
>
> > > > DataSourceID=3D"SqlDataSource1">
>
> > =A0 =A0 =A0 =A0 =A0
> > =A0 =A0 =A0 =A0
> > =A0 =A0 =A0 =A0Claim SSN: <%#
> > Eval("ClaimSSN") %>

> > =A0 =A0 =A0 =A0
> > =A0 =A0 =A0 =A0 BIC: <%# Eval("BIC=
") %> > > b>
>
> > =A0 =A0 =A0 =A0
>
> > =A0 =A0 =A0 =A0 BIC SSN: t><%#
> > Eval("BICSSN") %>

>
> > =A0 =A0 =A0 =A0
> > =A0 =A0 =A0 =A0
>
> > =A0 =A0 =A0 =A0 Status Code: <=
/font><
> > %# Eval("StatusCode")%>

>
> > =A0 =A0 =A0 =A0
> > =A0 =A0 =A0 =A0

> > =A0 =A0 =A0
> > =A0 =A0 =A0 =A0
> > =A0 =A0 =A0 =A0


/>
>
> > =A0 =A0 =A0 =A0
> > =A0 =A0 =A0 =A0
> > =A0 =A0 =A0 =A0
> > =A0 =A0 =A0 =A0
> > =A0 =A0 =A0 =A0
> > =A0 =A0 =A0 =A0

> > =A0 =A0 =A0 =A0- 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

Re: Hiding a field in a repeater

am 31.03.2008 21:33:15 von George Ter-Saakov

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" wrote in message
news:5f38834d-46c7-45bf-9fb9-8d5c354bf0cf@8g2000hse.googlegr oups.com...
On Mar 31, 2:52 pm, "George Ter-Saakov" wrote:
> By hiding what exactly you mean???
>
> Do it like 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" wrote in message
>
> news:244d20da-4bd3-4701-9d16-a1d9f9cc5046@p25g2000hsf.google groups.com...
>
>
>
> >I want to hide the Pin field below in my repeater. How do I do this?
>
> > > > DataSourceID="SqlDataSource1">
>
> >
> >
> > Claim SSN: <%#
> > Eval("ClaimSSN") %>

> >
> > BIC: <%# Eval("BIC") %> > > b>
>
> >
>
> > BIC SSN: <%#
> > Eval("BICSSN") %>

>
> >
> >
>
> > Status Code: <
> > %# Eval("StatusCode")%>

>
> >
> >

> >
> >
> >




>
> >
> >
> >
> >
> >
> >

> > - 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

Re: Hiding a field in a repeater

am 31.03.2008 21:58:27 von JJ297

On Mar 31, 3:33=A0pm, "George Ter-Saakov" 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" wrote in message
>
> news:5f38834d-46c7-45bf-9fb9-8d5c354bf0cf@8g2000hse.googlegr oups.com...
> On Mar 31, 2:52 pm, "George Ter-Saakov" wrote:
>
>
>
>
>
> > By hiding what exactly you mean???
>
> > Do it like 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" wrote in message
>
> >news:244d20da-4bd3-4701-9d16-a1d9f9cc5046@p25g2000hsf.googl egroups.com...=

>
> > >I want to hide the Pin field below in my repeater. How do I do this?
>
> > > > > > DataSourceID=3D"SqlDataSource1">
>
> > >
> > >
> > > Claim SSN: <%#
> > > Eval("ClaimSSN") %>

> > >
> > > BIC: <%# Eval("BIC") %> > > > b>
>
> > >
>
> > > BIC SSN: <%#
> > > Eval("BICSSN") %>

>
> > >
> > >
>
> > > Status Code: <
> > > %# Eval("StatusCode")%>

>
> > >
> > >

> > >
> > >
> > >




>
> > >
> > >
> > >
> > >
> > >
> > >

> > > - 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

Re: Hiding a field in a repeater

am 01.04.2008 13:57:47 von George Ter-Saakov

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" wrote in message
news:912b6291-f5bf-4f98-b54e-f62a70b91706@m73g2000hsh.google groups.com...
On Mar 31, 3:33 pm, "George Ter-Saakov" 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" wrote in message
>
> news:5f38834d-46c7-45bf-9fb9-8d5c354bf0cf@8g2000hse.googlegr oups.com...
> On Mar 31, 2:52 pm, "George Ter-Saakov" wrote:
>
>
>
>
>
> > By hiding what exactly you mean???
>
> > Do it like 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" wrote in message
>
> >news:244d20da-4bd3-4701-9d16-a1d9f9cc5046@p25g2000hsf.googl egroups.com...
>
> > >I want to hide the Pin field below in my repeater. How do I do this?
>
> > > > > > DataSourceID="SqlDataSource1">
>
> > >
> > >
> > > Claim SSN: <%#
> > > Eval("ClaimSSN") %>

> > >
> > > BIC: <%# Eval("BIC") %> > > > b>
>
> > >
>
> > > BIC SSN: <%#
> > > Eval("BICSSN") %>

>
> > >
> > >
>
> > > Status Code: <
> > > %# Eval("StatusCode")%>

>
> > >
> > >

> > >
> > >
> > >




>
> > >
> > >
> > >
> > >
> > >
> > >

> > > - 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

Re: Hiding a field in a repeater

am 01.04.2008 16:58:34 von JJ297

On Apr 1, 7:57=A0am, "George Ter-Saakov" 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") == 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" wrote in message
>
> news:912b6291-f5bf-4f98-b54e-f62a70b91706@m73g2000hsh.google groups.com...
> On Mar 31, 3:33 pm, "George Ter-Saakov" 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" wrote in message
>
> >news:5f38834d-46c7-45bf-9fb9-8d5c354bf0cf@8g2000hse.googleg roups.com...
> > On Mar 31, 2:52 pm, "George Ter-Saakov" wrote:
>
> > > By hiding what exactly you mean???
>
> > > Do it like 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" wrote in message
>
> > >news:244d20da-4bd3-4701-9d16-a1d9f9cc5046@p25g2000hsf.googl egroups.com.=
...
>
> > > >I want to hide the Pin field below in my repeater. How do I do this?
>
> > > > > > > > DataSourceID=3D"SqlDataSource1">
>
> > > >
> > > >
> > > > Claim SSN: <%#
> > > > Eval("ClaimSSN") %>

> > > >
> > > > BIC: <%# Eval("BIC") %> > > > > b>
>
> > > >
>
> > > > BIC SSN: <%#
> > > > Eval("BICSSN") %>

>
> > > >
> > > >
>
> > > > Status Code: <
> > > > %# Eval("StatusCode")%>

>
> > > >
> > > >

> > > >
> > > >
> > > >




>
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >

> > > > - 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?

Pin: <
%getPin(DataBinder.Eval(Container.DataItem, "Pin"))%>

Re: Hiding a field in a repeater

am 01.04.2008 17:06:42 von JJ297

On Apr 1, 10:58=A0am, JJ297 wrote:
> On Apr 1, 7:57=A0am, "George Ter-Saakov" 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") == 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" wrote in message
>
> >news:912b6291-f5bf-4f98-b54e-f62a70b91706@m73g2000hsh.googl egroups.com...=

> > On Mar 31, 3:33 pm, "George Ter-Saakov" 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" wrote in message
>
> > >news:5f38834d-46c7-45bf-9fb9-8d5c354bf0cf@8g2000hse.googleg roups.com...=

> > > On Mar 31, 2:52 pm, "George Ter-Saakov" wrote:
>
> > > > By hiding what exactly you mean???
>
> > > > Do it like 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" wrote in message
>
> > > >news:244d20da-4bd3-4701-9d16-a1d9f9cc5046@p25g2000hsf.googl egroups.co=
m...
>
> > > > >I want to hide the Pin field below in my repeater. How do I do this=
?
>
> > > > > > > > > > DataSourceID=3D"SqlDataSource1">
>
> > > > >
> > > > >
> > > > > Claim SSN: <%#
> > > > > Eval("ClaimSSN") %>

> > > > >
> > > > > BIC: <%# Eval("BIC") %> > > > > > b>
>
> > > > >
>
> > > > > BIC SSN: <%#
> > > > > Eval("BICSSN") %>

>
> > > > >
> > > > >
>
> > > > > Status Code: <=

> > > > > %# Eval("StatusCode")%>

>
> > > > >
> > > > >

> > > > >
> > > > >
> > > > >




>
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >

> > > > > - 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?
>
> Pin: <
> %getPin(DataBinder.Eval(Container.DataItem, "Pin"))%>
- 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?

Re: Hiding a field in a repeater

am 01.04.2008 17:18:28 von George Ter-Saakov

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" wrote in message
news:18d01bca-feb5-435e-8c68-f12d1e45f9f2@u69g2000hse.google groups.com...
On Apr 1, 7:57 am, "George Ter-Saakov" 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" wrote in message
>
> news:912b6291-f5bf-4f98-b54e-f62a70b91706@m73g2000hsh.google groups.com...
> On Mar 31, 3:33 pm, "George Ter-Saakov" 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" wrote in message
>
> >news:5f38834d-46c7-45bf-9fb9-8d5c354bf0cf@8g2000hse.googleg roups.com...
> > On Mar 31, 2:52 pm, "George Ter-Saakov" wrote:
>
> > > By hiding what exactly you mean???
>
> > > Do it like 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" wrote in message
>
> > >news:244d20da-4bd3-4701-9d16-a1d9f9cc5046@p25g2000hsf.googl egroups.com...
>
> > > >I want to hide the Pin field below in my repeater. How do I do this?
>
> > > > > > > > DataSourceID="SqlDataSource1">
>
> > > >
> > > >
> > > > Claim SSN: <%#
> > > > Eval("ClaimSSN") %>

> > > >
> > > > BIC: <%# Eval("BIC") %> > > > > b>
>
> > > >
>
> > > > BIC SSN: <%#
> > > > Eval("BICSSN") %>

>
> > > >
> > > >
>
> > > > Status Code: <
> > > > %# Eval("StatusCode")%>

>
> > > >
> > > >

> > > >
> > > >
> > > >




>
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >

> > > > - 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?

Pin: <
%getPin(DataBinder.Eval(Container.DataItem, "Pin"))%>

Re: Hiding a field in a repeater

am 01.04.2008 18:14:40 von JJ297

On Apr 1, 11:18=A0am, "George Ter-Saakov" 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" wrote in message
>
> news:18d01bca-feb5-435e-8c68-f12d1e45f9f2@u69g2000hse.google groups.com...
> On Apr 1, 7:57 am, "George Ter-Saakov" 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") == 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" wrote in message
>
> >news:912b6291-f5bf-4f98-b54e-f62a70b91706@m73g2000hsh.googl egroups.com...=

> > On Mar 31, 3:33 pm, "George Ter-Saakov" 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" wrote in message
>
> > >news:5f38834d-46c7-45bf-9fb9-8d5c354bf0cf@8g2000hse.googleg roups.com...=

> > > On Mar 31, 2:52 pm, "George Ter-Saakov" wrote:
>
> > > > By hiding what exactly you mean???
>
> > > > Do it like 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" wrote in message
>
> > > >news:244d20da-4bd3-4701-9d16-a1d9f9cc5046@p25g2000hsf.googl egroups.co=
m...
>
> > > > >I want to hide the Pin field below in my repeater. How do I do this=
?
>
> > > > > > > > > > DataSourceID=3D"SqlDataSource1">
>
> > > > >
> > > > >
> > > > > Claim SSN: <%#
> > > > > Eval("ClaimSSN") %>

> > > > >
> > > > > BIC: <%# Eval("BIC") %> > > > > > b>
>
> > > > >
>
> > > > > BIC SSN: <%#
> > > > > Eval("BICSSN") %>

>
> > > > >
> > > > >
>
> > > > > Status Code: <=

> > > > > %# Eval("StatusCode")%>

>
> > > > >
> > > > >

> > > > >
> > > > >
> > > > >




>
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >

> > > > > - 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?
>
> Pin: <
> %getPin(DataBinder.Eval(Container.DataItem, "Pin"))%>
- 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

Re: Hiding a field in a repeater

am 01.04.2008 18:37:36 von George Ter-Saakov

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" wrote in message
news:50d90311-10c5-4a71-86e2-b38bfe82f9d3@d1g2000hsg.googleg roups.com...
On Apr 1, 11:18 am, "George Ter-Saakov" 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" wrote in message
>
> news:18d01bca-feb5-435e-8c68-f12d1e45f9f2@u69g2000hse.google groups.com...
> On Apr 1, 7:57 am, "George Ter-Saakov" 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" wrote in message
>
> >news:912b6291-f5bf-4f98-b54e-f62a70b91706@m73g2000hsh.googl egroups.com...
> > On Mar 31, 3:33 pm, "George Ter-Saakov" 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" wrote in message
>
> > >news:5f38834d-46c7-45bf-9fb9-8d5c354bf0cf@8g2000hse.googleg roups.com...
> > > On Mar 31, 2:52 pm, "George Ter-Saakov" wrote:
>
> > > > By hiding what exactly you mean???
>
> > > > Do it like 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" wrote in message
>
> > > >news:244d20da-4bd3-4701-9d16-a1d9f9cc5046@p25g2000hsf.googl egroups.com...
>
> > > > >I want to hide the Pin field below in my repeater. How do I do
> > > > >this?
>
> > > > > > > > > > DataSourceID="SqlDataSource1">
>
> > > > >
> > > > >
> > > > > Claim SSN: <%#
> > > > > Eval("ClaimSSN") %>

> > > > >
> > > > > BIC: <%# Eval("BIC") %> > > > > > b>
>
> > > > >
>
> > > > > BIC SSN: <%#
> > > > > Eval("BICSSN") %>

>
> > > > >
> > > > >
>
> > > > > Status Code: <
> > > > > %# Eval("StatusCode")%>

>
> > > > >
> > > > >

> > > > >
> > > > >
> > > > >




>
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >

> > > > > - 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?
>
> Pin: <
> %getPin(DataBinder.Eval(Container.DataItem, "Pin"))%>
- 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

Re: Hiding a field in a repeater

am 01.04.2008 18:40:16 von George Ter-Saakov

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

George,.



"JJ297" wrote in message
news:c66a0993-83ce-4cb0-9df8-ae4e5c1fe024@z38g2000hsc.google groups.com...
On Apr 1, 10:58 am, JJ297 wrote:
> On Apr 1, 7:57 am, "George Ter-Saakov" 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" wrote in message
>
> >news:912b6291-f5bf-4f98-b54e-f62a70b91706@m73g2000hsh.googl egroups.com...
> > On Mar 31, 3:33 pm, "George Ter-Saakov" 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" wrote in message
>
> > >news:5f38834d-46c7-45bf-9fb9-8d5c354bf0cf@8g2000hse.googleg roups.com...
> > > On Mar 31, 2:52 pm, "George Ter-Saakov" wrote:
>
> > > > By hiding what exactly you mean???
>
> > > > Do it like 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" wrote in message
>
> > > >news:244d20da-4bd3-4701-9d16-a1d9f9cc5046@p25g2000hsf.googl egroups.com...
>
> > > > >I want to hide the Pin field below in my repeater. How do I do
> > > > >this?
>
> > > > > > > > > > DataSourceID="SqlDataSource1">
>
> > > > >
> > > > >
> > > > > Claim SSN: <%#
> > > > > Eval("ClaimSSN") %>

> > > > >
> > > > > BIC: <%# Eval("BIC") %> > > > > > b>
>
> > > > >
>
> > > > > BIC SSN: <%#
> > > > > Eval("BICSSN") %>

>
> > > > >
> > > > >
>
> > > > > Status Code: <
> > > > > %# Eval("StatusCode")%>

>
> > > > >
> > > > >

> > > > >
> > > > >
> > > > >




>
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >

> > > > > - 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?
>
> Pin: <
> %getPin(DataBinder.Eval(Container.DataItem, "Pin"))%>
- 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?

Re: Hiding a field in a repeater

am 02.04.2008 16:24:55 von JJ297

On Apr 1, 12:40=A0pm, "George Ter-Saakov" wrote:
> You can by doing
> Repeater1.Items[0].Visible =3D false;
> It will hide first column in repeater..
>
> George,.
>
> "JJ297" wrote in message
>
> news:c66a0993-83ce-4cb0-9df8-ae4e5c1fe024@z38g2000hsc.google groups.com...
> On Apr 1, 10:58 am, JJ297 wrote:
>
>
>
>
>
> > On Apr 1, 7:57 am, "George Ter-Saakov" 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") == 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" wrote in message
>
> > >news:912b6291-f5bf-4f98-b54e-f62a70b91706@m73g2000hsh.googl egroups.com.=
...
> > > On Mar 31, 3:33 pm, "George Ter-Saakov" 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" wrote in message
>
> > > >news:5f38834d-46c7-45bf-9fb9-8d5c354bf0cf@8g2000hse.googleg roups.com.=
...
> > > > On Mar 31, 2:52 pm, "George Ter-Saakov" wrote:
>
> > > > > By hiding what exactly you mean???
>
> > > > > Do it like 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" wrote in message
>
> > > > >news:244d20da-4bd3-4701-9d16-a1d9f9cc5046@p25g2000hsf.googl egroups.=
com...
>
> > > > > >I want to hide the Pin field below in my repeater. How do I do
> > > > > >this?
>
> > > > > > > > > > > > DataSourceID=3D"SqlDataSource1">
>
> > > > > >
> > > > > >
> > > > > > Claim SSN: <%#
> > > > > > Eval("ClaimSSN") %>

> > > > > >
> > > > > > BIC: <%# Eval("BIC") %> > > > > > > b>
>
> > > > > >
>
> > > > > > BIC SSN: <%#=

> > > > > > Eval("BICSSN") %>

>
> > > > > >
> > > > > >
>
> > > > > > Status Code: ><
> > > > > > %# Eval("StatusCode")%>

>
> > > > > >
> > > > > >

> > > > > >
> > > > > >
> > > > > >




>
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >

> > > > > > - 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?
>
> > Pin: <
> > %getPin(DataBinder.Eval(Container.DataItem, "Pin"))%>
- 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

Re: Hiding a field in a repeater

am 02.04.2008 16:41:03 von George Ter-Saakov

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" wrote in message
news:27007bc5-8c9b-46ba-a604-64a8f8c4d8d1@y21g2000hsf.google groups.com...
On Apr 1, 12:40 pm, "George Ter-Saakov" wrote:
> You can by doing
> Repeater1.Items[0].Visible = false;
> It will hide first column in repeater..
>
> George,.
>
> "JJ297" wrote in message
>
> news:c66a0993-83ce-4cb0-9df8-ae4e5c1fe024@z38g2000hsc.google groups.com...
> On Apr 1, 10:58 am, JJ297 wrote:
>
>
>
>
>
> > On Apr 1, 7:57 am, "George Ter-Saakov" 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" wrote in message
>
> > >news:912b6291-f5bf-4f98-b54e-f62a70b91706@m73g2000hsh.googl egroups.com...
> > > On Mar 31, 3:33 pm, "George Ter-Saakov" 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" wrote in message
>
> > > >news:5f38834d-46c7-45bf-9fb9-8d5c354bf0cf@8g2000hse.googleg roups.com...
> > > > On Mar 31, 2:52 pm, "George Ter-Saakov" wrote:
>
> > > > > By hiding what exactly you mean???
>
> > > > > Do it like 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" wrote in message
>
> > > > >news:244d20da-4bd3-4701-9d16-a1d9f9cc5046@p25g2000hsf.googl egroups.com...
>
> > > > > >I want to hide the Pin field below in my repeater. How do I do
> > > > > >this?
>
> > > > > > > > > > > > DataSourceID="SqlDataSource1">
>
> > > > > >
> > > > > >
> > > > > > Claim SSN: <%#
> > > > > > Eval("ClaimSSN") %>

> > > > > >
> > > > > > BIC: <%# Eval("BIC") %> > > > > > > b>
>
> > > > > >
>
> > > > > > BIC SSN: <%#
> > > > > > Eval("BICSSN") %>

>
> > > > > >
> > > > > >
>
> > > > > > Status Code: <
> > > > > > %# Eval("StatusCode")%>

>
> > > > > >
> > > > > >

> > > > > >
> > > > > >
> > > > > >




>
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >

> > > > > > - 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?
>
> > Pin: <
> > %getPin(DataBinder.Eval(Container.DataItem, "Pin"))%>
-
> > 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

Re: Hiding a field in a repeater

am 02.04.2008 17:58:02 von JJ297

On Apr 2, 10:41=A0am, "George Ter-Saakov" 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" wrote in message
>
> news:27007bc5-8c9b-46ba-a604-64a8f8c4d8d1@y21g2000hsf.google groups.com...
> On Apr 1, 12:40 pm, "George Ter-Saakov" wrote:
>
>
>
>
>
> > You can by doing
> > Repeater1.Items[0].Visible =3D false;
> > It will hide first column in repeater..
>
> > George,.
>
> > "JJ297" wrote in message
>
> >news:c66a0993-83ce-4cb0-9df8-ae4e5c1fe024@z38g2000hsc.googl egroups.com...=

> > On Apr 1, 10:58 am, JJ297 wrote:
>
> > > On Apr 1, 7:57 am, "George Ter-Saakov" 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" wrote in message
>
> > > >news:912b6291-f5bf-4f98-b54e-f62a70b91706@m73g2000hsh.googl egroups.co=
m...
> > > > On Mar 31, 3:33 pm, "George Ter-Saakov" 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" wrote in message
>
> > > > >news:5f38834d-46c7-45bf-9fb9-8d5c354bf0cf@8g2000hse.googleg roups.co=
m...
> > > > > On Mar 31, 2:52 pm, "George Ter-Saakov" wrote=
:
>
> > > > > > By hiding what exactly you mean???
>
> > > > > > Do it like 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" wrote in message
>
> > > > > >news:244d20da-4bd3-4701-9d16-a1d9f9cc5046@p25g2000hsf.googl egroup=
s.com...
>
> > > > > > >I want to hide the Pin field below in my repeater. How do I do
> > > > > > >this?
>
> > > > > > > > > > > > > > DataSourceID=3D"SqlDataSource1">
>
> > > > > > >
> > > > > > >
> > > > > > > Claim SSN: <%#
> > > > > > > Eval("ClaimSSN") %>

> > > > > > >
> > > > > > > BIC: <%# Eval("BIC") %><=
/
> > > > > > > b>
>
> > > > > > >
>
> > > > > > > BIC SSN: <=
%#
> > > > > > > Eval("BICSSN") %>

>
> > > > > > >
> > > > > > >
>
> > > > > > > Status Code: =
<
> > > > > > > %# Eval("StatusCode")%>

>
> > > > > > >
> > > > > > >

> > > > > > >
> > > > > > >
> > > > > > >




>
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >

> > > > > > > - 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?
>
> > > Pin: <
> > > %getPin(DataBinder.Eval(Container.DataItem, "Pin"))%>
-
> > > 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!!!!