Click here to Skip to main content
15,888,610 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionrestricting user access based on type of user Pin
SIMOKOOL5-Nov-11 8:11
SIMOKOOL5-Nov-11 8:11 
AnswerRe: restricting user access based on type of user Pin
Mark Salsbery5-Nov-11 9:48
Mark Salsbery5-Nov-11 9:48 
AnswerRe: restricting user access based on type of user Pin
Wonde Tadesse5-Nov-11 10:42
professionalWonde Tadesse5-Nov-11 10:42 
AnswerRe: restricting user access based on type of user Pin
MaulikDusara9-Nov-11 18:07
MaulikDusara9-Nov-11 18:07 
Questionhi friends Pin
xgow4-Nov-11 20:11
xgow4-Nov-11 20:11 
AnswerRe: hi friends Pin
purnananda behera7-Nov-11 19:03
purnananda behera7-Nov-11 19:03 
Questionbuttons on asp.net 2010 controls Pin
classy_dog4-Nov-11 4:43
classy_dog4-Nov-11 4:43 
AnswerRe: buttons on asp.net 2010 controls Pin
Hanzaplast5-Nov-11 3:35
Hanzaplast5-Nov-11 3:35 
if i understand, you want to preform update, insert, delete functions from other location rather than inside common asp.net grid controls like ListView, FormView, DetailsView...

it can be done easily. you just need to call function you want to preform for target control. this is example how to call Update function for FormView outside of FormView

XML
<asp:FormView runat="server" ID="fv" DefaultMode="Edit" DataKeyNames="id" OnItemUpdating="fv_ItemUpdating">
<EditItemTemplate>
    <asp:TextBox runat="server" ID="tb" Text='<%#Bind("name") %>' />
    <asp:Button runat="server" ID="btn" Text="Edit Inside" CommandName="Update" />
</EditItemTemplate>
</asp:FormView>

<asp:Button runat="server" ID="btn" Text="Edit Outside" OnClick="EditOutside" />


C#
public System.Data.DataTable SomeData()
{
    System.Data.DataTable temp = new System.Data.DataTable();
    temp.Columns.Add("id");
    temp.Columns.Add("name");

    System.Data.DataRow dr = temp.NewRow();
    dr["id"] = 1;
    dr["name"] = "somebody";
    temp.Rows.Add(dr);

    dr = temp.NewRow();
    dr["id"] = 2;
    dr["name"] = "someone";
    temp.Rows.Add(dr);
    return temp;
}
protected void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack)
    {
        fv.DataSource = SomeData();
        fv.DataBind();
    }
}
public void fv_ItemUpdating(object sender, FormViewUpdateEventArgs e)
{
    string txtValue = (fv.FindControl("tb") as TextBox).Text;
}
public void EditOutside(object sender, EventArgs e)
{
    fv.UpdateItem(false);
}

GeneralRe: buttons on asp.net 2010 controls Pin
classy_dog5-Nov-11 13:20
classy_dog5-Nov-11 13:20 
Questionhow to insert an image dynamically into a table Pin
rahul honey4-Nov-11 1:43
rahul honey4-Nov-11 1:43 
AnswerRe: how to insert an image dynamically into a table Pin
Rocky#4-Nov-11 2:41
Rocky#4-Nov-11 2:41 
GeneralRe: how to insert an image dynamically into a table Pin
rahul honey4-Nov-11 2:50
rahul honey4-Nov-11 2:50 
Questionhi friends Pin
xgow3-Nov-11 21:24
xgow3-Nov-11 21:24 
AnswerRe: hi friends Pin
Anurag Gandhi3-Nov-11 22:34
professionalAnurag Gandhi3-Nov-11 22:34 
QuestionCollecting data from website in DataTable Pin
Mugdha_Aditya3-Nov-11 19:15
Mugdha_Aditya3-Nov-11 19:15 
AnswerRe: Collecting data from website in DataTable Pin
Richard MacCutchan3-Nov-11 23:39
mveRichard MacCutchan3-Nov-11 23:39 
AnswerRe: Collecting data from website in DataTable Pin
jkirkerx5-Nov-11 17:36
professionaljkirkerx5-Nov-11 17:36 
GeneralRe: Collecting data from website in DataTable Pin
Mugdha_Aditya8-Nov-11 2:05
Mugdha_Aditya8-Nov-11 2:05 
Questionasp.net 2010 single row control Pin
classy_dog3-Nov-11 11:45
classy_dog3-Nov-11 11:45 
AnswerRe: asp.net 2010 single row control Pin
Rocky#4-Nov-11 0:52
Rocky#4-Nov-11 0:52 
QuestionDebugging Pin
indian1433-Nov-11 11:08
indian1433-Nov-11 11:08 
QuestionQuering Active directory Pin
byka3-Nov-11 8:09
byka3-Nov-11 8:09 
AnswerRe: Quering Active directory Pin
Richard MacCutchan3-Nov-11 23:40
mveRichard MacCutchan3-Nov-11 23:40 
GeneralRe: Quering Active directory Pin
byka8-Nov-11 3:39
byka8-Nov-11 3:39 
GeneralRe: Quering Active directory Pin
Richard MacCutchan8-Nov-11 5:43
mveRichard MacCutchan8-Nov-11 5:43 

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.