> I see it now....
> The best way to do is following....
[quoted text clipped - 97 lines]
>
> - Show quoted text -
> 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
[quoted text clipped - 134 lines]
>
> - 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>
JJ297 - 01 Apr 2008 16:06 GMT
> > 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
[quoted text clipped - 160 lines]
>
> - Show quoted text -
George I got it I left out the # in front of the GetPin. Thanks.
Another question for you. I have this in the function:
If Session("SPSListings") = True Then
Return sPin
Else
Return "you have no access"
End If
How can I get rid of the Pin column all together if the user doesn't
have access instead of returning "You have no Access" Can I make that
column visiable = false?
George Ter-Saakov - 01 Apr 2008 17:40 GMT
You can by doing
Repeater1.Items[0].Visible = false;
It will hide first column in repeater..
George,.
> On Apr 1, 7:57 am, "George Ter-Saakov" <gt-...@cardone.com> wrote:
>
[quoted text clipped - 167 lines]
>
> - 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?
JJ297 - 02 Apr 2008 15:24 GMT
> You can by doing
> Repeater1.Items[0].Visible = false;
[quoted text clipped - 189 lines]
>
> - Show quoted text -
Okay I added this:
Function getPin(ByVal sPin)
If Session("SPSListings") = True Then
Return sPin
Else
Return Repeater1.Items(8).Visible = False
End If
End Function
But now getting this...Index was out of range. Must be non-negative
and less than the size of the collection.
Parameter name: index
George Ter-Saakov - 02 Apr 2008 15:41 GMT
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.
On Apr 1, 12:40 pm, "George Ter-Saakov" <gt-...@cardone.com> wrote:
> You can by doing
> Repeater1.Items[0].Visible = false;
[quoted text clipped - 197 lines]
>
> - 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
JJ297 - 02 Apr 2008 16:58 GMT
> You are completely confused....
> chose one method or another.
[quoted text clipped - 233 lines]
>
> - Show quoted text -
Okay I got it I need the "no permissions" so I'm going with GetPin.
Thanks for all of your help!!!!
George Ter-Saakov - 01 Apr 2008 16:18 GMT
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.
On Apr 1, 7:57 am, "George Ter-Saakov" <gt-...@cardone.com> wrote:
> The idea to output to browser Pin or nothing to the user if he does not
> have
[quoted text clipped - 138 lines]
>
> - 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>
JJ297 - 01 Apr 2008 17:14 GMT
> It's cause you missing #
> Must be
[quoted text clipped - 186 lines]
>
> - Show quoted text -
Okay don't quite understand what you want me to do. I added this to
page load:
Dim _bCSI=(bool)Session("CSI")
Getting error message end of statement expected
Then added this:
Function getPin(ByVal sPin)
If (_BCSI = True) Then
Return "you have no access"
End If
End Function
Getting _BCSI is not declared. Any suggestions? Thanks
George Ter-Saakov - 01 Apr 2008 17:37 GMT
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
}
On Apr 1, 11:18 am, "George Ter-Saakov" <gt-...@cardone.com> wrote:
> It's cause you missing #
> Must be
[quoted text clipped - 193 lines]
>
> - 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