<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Security</title><link>http://forums.asp.net/25.aspx</link><description>All about ASP.NET security (authentication, authorization, membership, roles, etc.) and the Login controls. &lt;a href="http://aspadvice.com/SignUp/list.aspx?l=24&amp;c=17" target="_blank"&gt;Email List&lt;/a&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: gridview security</title><link>http://forums.asp.net/thread/1605145.aspx</link><pubDate>Mon, 05 Mar 2007 11:42:15 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1605145</guid><dc:creator>mlawton40</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1605145.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1605145</wfw:commentRss><description>&lt;p&gt;but any ideas about the above problem?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Cheers, Mark&lt;/p&gt;</description></item><item><title>Re: gridview security</title><link>http://forums.asp.net/thread/1605139.aspx</link><pubDate>Mon, 05 Mar 2007 11:36:54 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1605139</guid><dc:creator>macal_vm</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1605139.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1605139</wfw:commentRss><description>&lt;p&gt;also, u can aways create a admin.aspx page and set the view to insert/edit or whatever u want. the same way, u can set the view for normal users to read only.&lt;/p&gt;
&lt;p&gt;this way u need only to protect the page.&lt;/p&gt;</description></item><item><title>Re: gridview security</title><link>http://forums.asp.net/thread/1605109.aspx</link><pubDate>Mon, 05 Mar 2007 11:06:24 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1605109</guid><dc:creator>mlawton40</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1605109.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1605109</wfw:commentRss><description>&lt;p&gt;Hi, Im just trying this and have the following code, which I have used from the &amp;nbsp;&lt;pre class=coloredcode&gt;&lt;span class=kwd&gt;protected void&lt;/span&gt; Delete_RowDataBound(&lt;span class=kwd&gt;object&lt;/span&gt; sender, GridViewRowEventArgs e)
    {
        &lt;span class=kwd&gt;if&lt;/span&gt; (e.Row.RowType == DataControlRowType.DataRow)
        {
            &lt;span class=kwd&gt;if&lt;/span&gt; (Roles.IsUserInRole(User.Identity.Name, &lt;span class=st&gt;"Administrator"&lt;/span&gt;))
            {
                ImageButton btnDel = e.Row.Cells[6].Controls[0] &lt;span class=kwd&gt;as&lt;/span&gt; ImageButton;
                btnDel.visible = &lt;span class=kwd&gt;true&lt;/span&gt;;
            }
            &lt;span class=kwd&gt;else&lt;/span&gt;
            {
                ImageButton btnDel = e.Row.Cells[6].Controls[0] &lt;span class=kwd&gt;as&lt;/span&gt; ImageButton;
                btnDel.Visible = &lt;span class=kwd&gt;false&lt;/span&gt;;
            }
        }
    } &lt;/pre&gt;&amp;nbsp;above example. 
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The problem is the following message appears:&lt;/p&gt;
&lt;p&gt;'System.Web.UI.WebControls.ImageButton' does not contain a definition for 'visible'&lt;/p&gt;
&lt;p&gt;Any idea? Cheers, Mark&lt;/p&gt;&lt;/p&gt;</description></item><item><title>Re: gridview security</title><link>http://forums.asp.net/thread/1519306.aspx</link><pubDate>Fri, 05 Jan 2007 03:51:47 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1519306</guid><dc:creator>ulysses098</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1519306.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1519306</wfw:commentRss><description>you can also use the load event of a formview, and put the condition of hiding and showing the edit/insert/delete button.</description></item><item><title>Re: gridview security</title><link>http://forums.asp.net/thread/1519303.aspx</link><pubDate>Fri, 05 Jan 2007 03:45:56 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1519303</guid><dc:creator>ulysses098</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1519303.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1519303</wfw:commentRss><description>&lt;p&gt;well let us assume you have a usertype session that will determine if we will view the edit/insert/delete button. &lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void example_RowDataBound(object sender, GridViewRowEventArgs e)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (e.Row.RowType == DataControlRowType.DataRow)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  if(Session["usertype"] == "admin"){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Button btnsample= (Button)e.Row.FindControl("insertbutton");&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  btnsample.visible = true;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  }&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  else&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Button btnsample= (Button)e.Row.FindControl("insertbutton");&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;  &lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; btnsample.visible = false; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: gridview security</title><link>http://forums.asp.net/thread/1490382.aspx</link><pubDate>Fri, 08 Dec 2006 02:22:22 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1490382</guid><dc:creator>benvan</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1490382.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1490382</wfw:commentRss><description>&lt;p&gt;This is a very good example of how NOT to ask a question.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Do you have any knowledge of C# or VB?&lt;/p&gt;&lt;p&gt;&amp;nbsp;on rowcreated, Use e.Row.Cells( index of required cell, in this case probably 0 ).Visible = False&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;likewise, change the index for any other columns which you want to hide. I would suggest writing a hidecolumns function.&lt;/p&gt;</description></item><item><title>Re: gridview security</title><link>http://forums.asp.net/thread/1487281.aspx</link><pubDate>Tue, 05 Dec 2006 22:03:18 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1487281</guid><dc:creator>mso789</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1487281.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1487281</wfw:commentRss><description>&lt;p&gt;What about the FormView controls.&amp;nbsp;&amp;nbsp; How do I allow administrators to see the edit/insert/delete functions and hide those controls from any other user ?&lt;/p&gt;&lt;p&gt;Also, going back to your response, what exactly am I to type under the rowdatabound gridView control ?&amp;nbsp; Can you provide me with a sample ?&lt;/p&gt;&lt;p&gt;Thanks.&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: gridview security</title><link>http://forums.asp.net/thread/1478248.aspx</link><pubDate>Tue, 28 Nov 2006 01:37:08 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1478248</guid><dc:creator>ulysses098</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1478248.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1478248</wfw:commentRss><description>yes. you can access the controls inside a gridview and formview, then their are events in the gridview called rowdatabound which you can use to show or hide certain controls inside that row.&lt;br /&gt;</description></item><item><title>gridview security</title><link>http://forums.asp.net/thread/1478055.aspx</link><pubDate>Mon, 27 Nov 2006 21:34:13 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1478055</guid><dc:creator>mso789</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1478055.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1478055</wfw:commentRss><description>&lt;p&gt;I am building an application that need to be flexible enough to hide certain pieces of information withing a page
based on who the user is.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;More specifically, I have a gridview/formview which needs to allow certain users to
edit/insert/delete information while at the same time would limit other users
to view information.&lt;/p&gt;&lt;p&gt;Is this possible and how will I go about doing this ?&lt;/p&gt;&lt;p&gt;Thanks in advance.&lt;/p&gt;</description></item></channel></rss>