473,396 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

</td>
</tr>
</SeparatorTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
Mar 31 '08 #1
11 4905
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***@yahoo.comwrote in message
news:24**********************************@p25g2000 hsf.googlegroups.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 /><br />

</td>
</tr>
</SeparatorTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>

Mar 31 '08 #2
On Mar 31, 2:52*pm, "George Ter-Saakov" <gt-...@cardone.comwrote:
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...@yahoo.comwrote in message

news:24**********************************@p25g2000 hsf.googlegroups.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 /><br/>
* * * *</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

Mar 31 '08 #3
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***@yahoo.comwrote in message
news:5f**********************************@8g2000hs e.googlegroups.com...
On Mar 31, 2:52 pm, "George Ter-Saakov" <gt-...@cardone.comwrote:
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...@yahoo.comwrote in message

news:24**********************************@p25g2000 hsf.googlegroups.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 /><br />
</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
Mar 31 '08 #4
On Mar 31, 3:33*pm, "George Ter-Saakov" <gt-...@cardone.comwrote:
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...@yahoo.comwrote in message

news:5f**********************************@8g2000hs e.googlegroups.com...
On Mar 31, 2:52 pm, "George Ter-Saakov" <gt-...@cardone.comwrote:


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...@yahoo.comwrote in message
news:24**********************************@p25g2000 hsf.googlegroups.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 /><br />
</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
Mar 31 '08 #5
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 "&nbsp;" //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 &nbsp;
depends on what is in Session("CSI")


George.

"JJ297" <nc***@yahoo.comwrote in message
news:91**********************************@m73g2000 hsh.googlegroups.com...
On Mar 31, 3:33 pm, "George Ter-Saakov" <gt-...@cardone.comwrote:
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...@yahoo.comwrote in message

news:5f**********************************@8g2000hs e.googlegroups.com...
On Mar 31, 2:52 pm, "George Ter-Saakov" <gt-...@cardone.comwrote:


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...@yahoo.comwrote in message
news:24**********************************@p25g2000 hsf.googlegroups.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 /><br />
</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
Apr 1 '08 #6
On Apr 1, 7:57*am, "George Ter-Saakov" <gt-...@cardone.comwrote:
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 "&nbsp;" //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 &nbsp;
depends on what is in Session("CSI")

George.

"JJ297" <nc...@yahoo.comwrote in message

news:91**********************************@m73g2000 hsh.googlegroups.com...
On Mar 31, 3:33 pm, "George Ter-Saakov" <gt-...@cardone.comwrote:


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...@yahoo.comwrote in message
news:5f**********************************@8g2000hs e.googlegroups.com...
On Mar 31, 2:52 pm, "George Ter-Saakov" <gt-...@cardone.comwrote:
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...@yahoo.comwrote in message
>news:24**********************************@p25g200 0hsf.googlegroups.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 /><br />
</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>

Apr 1 '08 #7
On Apr 1, 10:58*am, JJ297 <nc...@yahoo.comwrote:
On Apr 1, 7:57*am, "George Ter-Saakov" <gt-...@cardone.comwrote:


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...@yahoo.comwrote in message
news:91**********************************@m73g2000 hsh.googlegroups.com...
On Mar 31, 3:33 pm, "George Ter-Saakov" <gt-...@cardone.comwrote:
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...@yahoo.comwrote in message
>news:5f**********************************@8g2000h se.googlegroups.com...
On Mar 31, 2:52 pm, "George Ter-Saakov" <gt-...@cardone.comwrote:
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...@yahoo.comwrote in message
news:24**********************************@p25g2000 hsf.googlegroups.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 /><br />
</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?

Apr 1 '08 #8
You can by doing
Repeater1.Items[0].Visible = false;
It will hide first column in repeater..

George,.

"JJ297" <nc***@yahoo.comwrote in message
news:c6**********************************@z38g2000 hsc.googlegroups.com...
On Apr 1, 10:58 am, JJ297 <nc...@yahoo.comwrote:
On Apr 1, 7:57 am, "George Ter-Saakov" <gt-...@cardone.comwrote:


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...@yahoo.comwrote in message
news:91**********************************@m73g2000 hsh.googlegroups.com...
On Mar 31, 3:33 pm, "George Ter-Saakov" <gt-...@cardone.comwrote:
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...@yahoo.comwrote in message
>news:5f**********************************@8g2000h se.googlegroups.com...
On Mar 31, 2:52 pm, "George Ter-Saakov" <gt-...@cardone.comwrote:
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...@yahoo.comwrote in message
news:24**********************************@p25g2000 hsf.googlegroups.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 /><br />
</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?
Apr 1 '08 #9
On Apr 1, 12:40*pm, "George Ter-Saakov" <gt-...@cardone.comwrote:
You can by doing
Repeater1.Items[0].Visible = false;
It will hide first column in repeater..

George,.

"JJ297" <nc...@yahoo.comwrote in message

news:c6**********************************@z38g2000 hsc.googlegroups.com...
On Apr 1, 10:58 am, JJ297 <nc...@yahoo.comwrote:


On Apr 1, 7:57 am, "George Ter-Saakov" <gt-...@cardone.comwrote:
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...@yahoo.comwrote in message
>news:91**********************************@m73g200 0hsh.googlegroups.com....
On Mar 31, 3:33 pm, "George Ter-Saakov" <gt-...@cardone.comwrote:
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...@yahoo.comwrote in message
news:5f**********************************@8g2000hs e.googlegroups.com....
On Mar 31, 2:52 pm, "George Ter-Saakov" <gt-...@cardone.comwrote:
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...@yahoo.comwrote in message
>news:24**********************************@p25g200 0hsf.googlegroups.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 /><br />
</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
Apr 2 '08 #10
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" <nc***@yahoo.comwrote in message
news:27**********************************@y21g2000 hsf.googlegroups.com...
On Apr 1, 12:40 pm, "George Ter-Saakov" <gt-...@cardone.comwrote:
You can by doing
Repeater1.Items[0].Visible = false;
It will hide first column in repeater..

George,.

"JJ297" <nc...@yahoo.comwrote in message

news:c6**********************************@z38g2000 hsc.googlegroups.com...
On Apr 1, 10:58 am, JJ297 <nc...@yahoo.comwrote:


On Apr 1, 7:57 am, "George Ter-Saakov" <gt-...@cardone.comwrote:
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...@yahoo.comwrote in message
>news:91**********************************@m73g200 0hsh.googlegroups.com...
On Mar 31, 3:33 pm, "George Ter-Saakov" <gt-...@cardone.comwrote:
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...@yahoo.comwrote in message
news:5f**********************************@8g2000hs e.googlegroups.com...
On Mar 31, 2:52 pm, "George Ter-Saakov" <gt-...@cardone.comwrote:
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...@yahoo.comwrote in message
>news:24**********************************@p25g200 0hsf.googlegroups.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 /><br />
</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
Apr 2 '08 #11
On Apr 2, 10:41*am, "George Ter-Saakov" <gt-...@cardone.comwrote:
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" <nc...@yahoo.comwrote in message

news:27**********************************@y21g2000 hsf.googlegroups.com...
On Apr 1, 12:40 pm, "George Ter-Saakov" <gt-...@cardone.comwrote:


You can by doing
Repeater1.Items[0].Visible = false;
It will hide first column in repeater..
George,.
"JJ297" <nc...@yahoo.comwrote in message
news:c6**********************************@z38g2000 hsc.googlegroups.com...
On Apr 1, 10:58 am, JJ297 <nc...@yahoo.comwrote:
On Apr 1, 7:57 am, "George Ter-Saakov" <gt-...@cardone.comwrote:
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...@yahoo.comwrote in message
news:91**********************************@m73g2000 hsh.googlegroups.com...
On Mar 31, 3:33 pm, "George Ter-Saakov" <gt-...@cardone.comwrote:
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...@yahoo.comwrote in message
>news:5f**********************************@8g2000h se.googlegroups.com...
On Mar 31, 2:52 pm, "George Ter-Saakov" <gt-...@cardone.comwrote:
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...@yahoo.comwrote in message
news:24**********************************@p25g2000 hsf.googlegroups.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 /><br />
</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- 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!!!!
Apr 2 '08 #12

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

Similar topics

2
by: Kevin | last post by:
I've got a problem where I need to know the value of a hidden field inside a repeater once a button is clicked. Ths code inside my repeater looks like this: <input id="conf_num" type="hidden"...
2
by: D. Shane Fowlkes | last post by:
I'm using ASP.NET (VB) and I'm pretty new to .NET and using Templates. I have a SqlDataReader which is bound to a Repeater. The Repeater contains a table and for each record, it'll write a...
0
by: hsr | last post by:
I'm trying to find a way to only display a fixed amount of characters from one field in a data repeater. The field that is read into the dataset is much larger, but I only want to display say the...
22
by: Mr Newbie | last post by:
I was thinking about developing a workflow application yesterday and was musing over the different approaches than one could take in restricting specific actions on a ticket( Form ) at any said...
0
by: funphxnaz | last post by:
I'm using ASP.net 2.0 (VWD) and I'd like to programmatically hide a DataList row based on a Repeater nested in the DataList. Specifically, if the Repeater.Items.Count = 0, I'd like the entire...
1
by: j.t.w | last post by:
Hi. I'm new to ASP.Net and I'm running into a simple problem (I think). I'm trying to get 2 values from 2 separate queries into 2 different variables. I would then like to take the difference...
0
by: Sean | last post by:
I have a page that has a formview and two repeaters that use separate objectdatasources. Each objectdatasource returns records that contain a field named DateAndTime. The problem I'm having is...
4
by: adiel_g | last post by:
I am trying to loop through a repeater to retrieve a dataitem field but am getting a NullReferenceException. I can find a checkbox control but cannot find a dataitem field. Here is the code that...
2
by: akshalika | last post by:
Hi, I have a repeater control. it dynamically bind textbox or dropdown base on some condition. i want to bind required field validator dynamically for validate textbox or dropdown. here is my...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.