Click here to Skip to main content
15,903,030 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Load session variables when user automatically authenticates (Forms Authentication) Pin
Christian Graus30-Nov-08 14:55
protectorChristian Graus30-Nov-08 14:55 
AnswerRe: Load session variables when user automatically authenticates (Forms Authentication) Pin
Brij30-Nov-08 17:19
mentorBrij30-Nov-08 17:19 
GeneralRe: Load session variables when user automatically authenticates (Forms Authentication) Pin
AlexeiXX330-Nov-08 17:23
AlexeiXX330-Nov-08 17:23 
GeneralRe: Load session variables when user automatically authenticates (Forms Authentication) Pin
Christian Graus30-Nov-08 17:25
protectorChristian Graus30-Nov-08 17:25 
GeneralRe: Load session variables when user automatically authenticates (Forms Authentication) Pin
Brij30-Nov-08 17:36
mentorBrij30-Nov-08 17:36 
GeneralRe: Load session variables when user automatically authenticates (Forms Authentication) Pin
N a v a n e e t h30-Nov-08 19:24
N a v a n e e t h30-Nov-08 19:24 
GeneralRe: Load session variables when user automatically authenticates (Forms Authentication) Pin
AlexeiXX330-Nov-08 19:50
AlexeiXX330-Nov-08 19:50 
QuestionGridView Add, Edit and Delete operation Pin
srihariacha30-Nov-08 6:30
srihariacha30-Nov-08 6:30 
I need your help to write Add, Edit and Delete features. Here is the functionality details of the project:

1) SelectAll, ClearAll, Add, Edit and Delete is placed under FooterTemplate,
2) Textboxes for Name and Description is placed in FooterTemplate but its visible property is set to false, it has to be visible only if the Add button is clicked and SelectAll, ClearAll, Edit and Delete should become invisible
3) The edit and delete functionality should be enabled when any of the check box is selected and appropriate button is clicked

and the ASP Code is :
[code]
<![CDATA[<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>]]>


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body style="font-family: Tahoma; font-size: smaller">

    <script type="text/javascript">
    function Sel()
    {        
        var frm = document.forms[0];
        
        for(i=0;i<frm.length;i++)>
        {     
                frm.elements[i].checked=true;
        }
    }
    
    function DeSel()
    {        
        var frm = document.forms[0];
        
        for(i=0;i<frm.length;i++)>
        {     
                frm.elements[i].checked=false;
        }
    }
    </script>

    <form id="form1" runat="server">
        <div>
            <asp:gridview id="GridView1" runat="server" cellpadding="4" forecolor="Crimson" gridlines="None" xmlns:asp="#unknown">
                AutoGenerateColumns="False" BorderColor="Crimson" BorderStyle="Dashed" BorderWidth="2px"
                ShowFooter="True" OnRowDataBound="GridView1_RowDataBound" OnRowCommand="GridView1_RowCommand"
                OnRowDeleting="GridView1_RowDeleting" OnRowEditing="GridView1_RowEditing" OnRowCreated="GridView1_RowCreated"
                OnRowUpdating="GridView1_RowUpdating">
                <columns>
                    <asp:templatefield headertext="S. No.">
                        <itemtemplate>
                            <asp:label id="Check" runat="server" text="<%# Bind("sno") %>"></asp:label>
                        </itemtemplate>
                        <footertemplate>
                            <asp:linkbutton id="SelectAll" text="Select All" runat="server" forecolor="White"></asp:linkbutton>
                            <asp:textbox id="nametb" runat="server" visible="false"></asp:textbox>
                        </footertemplate>
                    </asp:templatefield>
                    <asp:templatefield headertext="Name">
                        <itemtemplate>
                            <asp:label id="lblName" runat="server" text="<%# Bind("name") %>"></asp:label>
                        </itemtemplate>
                        
                        <edititemtemplate>
                            <asp:textbox id="ename" runat="server" text="<%# Bind("name") %>"></asp:textbox>
                        </edititemtemplate>
                        <footertemplate>
                            <asp:linkbutton id="ClearAll" text="Clear All" runat="server" forecolor="White"></asp:linkbutton>
                            <asp:textbox id="Desctb" runat="server" visible="false"></asp:textbox>
                        </footertemplate>
                    </asp:templatefield>
                    <asp:templatefield headertext="Description">
                        <itemtemplate>
                            <asp:label id="lblDesc" runat="server" text="<%# Bind("Description") %>" width="300"></asp:label>
                        </itemtemplate>
                        <edititemtemplate>
                        <asp:textbox id="edesc" runat="server" text="<%#Bind("Description") %>"></asp:textbox>
                        </edititemtemplate>
                        <footertemplate>
                            <asp:button id="Add" runat="server" text="Add" width="50" font-names="Tahoma" commandname="add" />
                            <asp:button id="Edit" runat="server" text="Edit" width="50" font-names="Tahoma" commandname="edit" />
                            <asp:button id="Delete" runat="server" text="Delete" width="50" font-names="Tahoma">
                                CommandName="delete" />
                        </asp:button></footertemplate>
                    </asp:templatefield>
                    <asp:templatefield>
                        <itemtemplate>
                            <asp:checkbox id="SelectRow" runat="Server" />
                        </itemtemplate>
                    </asp:templatefield>
                </columns>
                <footerstyle backcolor="Crimson" font-bold="True" forecolor="White" />
                <rowstyle backcolor="White" forecolor="Crimson" bordercolor="Crimson" borderwidth="2px" />
                <pagerstyle backcolor="#FFCC66" forecolor="#333333" horizontalalign="Center" />
                <selectedrowstyle backcolor="#FFFFC0" font-bold="True" forecolor="Crimson" />
                <headerstyle backcolor="Crimson" font-bold="True" forecolor="White" />
                <alternatingrowstyle backcolor="#FFE5E5" bordercolor="#FFCCCC" forecolor="Crimson" />
            </asp:gridview>
            <asp:label id="Label1" runat="server" xmlns:asp="#unknown"></asp:label></div>
    </form>
</body>
</html>

[/code]

My requirement is not to use SQLDataSource rather Data through code.

The ideal output of the GridView looks like this : http://picasaweb.google.co.in/srihariacha/GirdView

Kindly help me !

Regards,

Sri Hari Acha
AnswerRe: GridView Add, Edit and Delete operation Pin
Christian Graus30-Nov-08 12:43
protectorChristian Graus30-Nov-08 12:43 
Questionmaintain such user on all web pages. Pin
Mr. Wonderful30-Nov-08 2:20
Mr. Wonderful30-Nov-08 2:20 
AnswerRe: maintain such user on all web pages. Pin
Vimalsoft(Pty) Ltd30-Nov-08 2:39
professionalVimalsoft(Pty) Ltd30-Nov-08 2:39 
GeneralRe: maintain such user on all web pages. Pin
Mr. Wonderful30-Nov-08 2:53
Mr. Wonderful30-Nov-08 2:53 
AnswerRe: maintain such user on all web pages. Pin
Brij30-Nov-08 2:59
mentorBrij30-Nov-08 2:59 
AnswerRe: maintain such user on all web pages. Pin
Paul Conrad30-Nov-08 6:25
professionalPaul Conrad30-Nov-08 6:25 
AnswerRe: maintain such user on all web pages. Pin
Christian Graus30-Nov-08 12:28
protectorChristian Graus30-Nov-08 12:28 
GeneralRe: maintain such user on all web pages. Pin
Paul Conrad30-Nov-08 14:36
professionalPaul Conrad30-Nov-08 14:36 
GeneralRe: maintain such user on all web pages. Pin
Christian Graus30-Nov-08 14:43
protectorChristian Graus30-Nov-08 14:43 
GeneralRe: maintain such user on all web pages. Pin
Paul Conrad30-Nov-08 14:46
professionalPaul Conrad30-Nov-08 14:46 
GeneralRe: maintain such user on all web pages. Pin
Christian Graus30-Nov-08 14:57
protectorChristian Graus30-Nov-08 14:57 
GeneralRe: maintain such user on all web pages. Pin
Paul Conrad30-Nov-08 15:04
professionalPaul Conrad30-Nov-08 15:04 
GeneralRe: maintain such user on all web pages. Pin
Christian Graus30-Nov-08 15:10
protectorChristian Graus30-Nov-08 15:10 
GeneralRe: maintain such user on all web pages. Pin
Paul Conrad30-Nov-08 15:22
professionalPaul Conrad30-Nov-08 15:22 
GeneralRe: maintain such user on all web pages. Pin
Christian Graus30-Nov-08 15:36
protectorChristian Graus30-Nov-08 15:36 
QuestionForums notification service [modified] Pin
Muhammad Gouda29-Nov-08 22:40
Muhammad Gouda29-Nov-08 22:40 
AnswerRe: Forums notification service Pin
Wendelius30-Nov-08 0:13
mentorWendelius30-Nov-08 0:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.