How to use Edit and update in DataList???
-
Hello, I have used a Datalist to display the records...i want to give provision for users to edit their record...How can l implement this by using datalist????If any idea Please help me..... Thanks in advance Bijesh
-
Hello, I have used a Datalist to display the records...i want to give provision for users to edit their record...How can l implement this by using datalist????If any idea Please help me..... Thanks in advance Bijesh
Sample ------ <%# DataBinder.Eval(Container.DataItem, "username") %> - <%# DataBinder.Eval(Container.DataItem, "category") %> || protected void dl_GalleryEdit(Object s, DataListCommandEventArgs e) { dlGallery.EditItemIndex = e.Item.ItemIndex; //Update Code bindData(); } Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)
-
Sample ------ <%# DataBinder.Eval(Container.DataItem, "username") %> - <%# DataBinder.Eval(Container.DataItem, "category") %> || protected void dl_GalleryEdit(Object s, DataListCommandEventArgs e) { dlGallery.EditItemIndex = e.Item.ItemIndex; //Update Code bindData(); } Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)
Hello.... Please help How we can regonize the specified item want to change by using this code dlGallery.EditItemIndex = e.Item.ItemIndex; our item template like this...... <%# DataBinder.Eval(Container.DataItem, "username") %> - <%# DataBinder.Eval(Container.DataItem, "category") %> How we can get the value of item?????? Please help to solve my problem thanks Biju
-
Hello.... Please help How we can regonize the specified item want to change by using this code dlGallery.EditItemIndex = e.Item.ItemIndex; our item template like this...... <%# DataBinder.Eval(Container.DataItem, "username") %> - <%# DataBinder.Eval(Container.DataItem, "category") %> How we can get the value of item?????? Please help to solve my problem thanks Biju
What about EditTemplate? <%# DataBinder.Eval(Container.DataItem, "username") %> - <%# DataBinder.Eval(Container.DataItem, "category") %> || Check-out this example http://authors.aspalliance.com/aspxtreme/webforms/controls/allowinguserstoedititemsindatalist.aspx Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)
-
What about EditTemplate? <%# DataBinder.Eval(Container.DataItem, "username") %> - <%# DataBinder.Eval(Container.DataItem, "category") %> || Check-out this example http://authors.aspalliance.com/aspxtreme/webforms/controls/allowinguserstoedititemsindatalist.aspx Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)
Hello, I set the code like this in html...... ----------------------------------------------------------------------------- <%# DataBinder.Eval(Container.DataItem, "AD_TITLE") %>
-
Hello, I set the code like this in html...... ----------------------------------------------------------------------------- <%# DataBinder.Eval(Container.DataItem, "AD_TITLE") %>
bijeshputhalath wrote:
string title = ((System.Web.UI.WebControls.TextBox)e.AD_TITLE.FindControl("Text1")).Text;
You should remove "
AD_TITLE
".string title = ((System.Web.UI.WebControls.TextBox)e.FindControl("Text1")).Text;
bijeshputhalath wrote:
C:\Inetpub\wwwroot\approvedplotfinal\index.aspx(2616): Could not find any attribute 'align' of element 'marquee'.
Where do you set "marquee" in your code??
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)
-
bijeshputhalath wrote:
string title = ((System.Web.UI.WebControls.TextBox)e.AD_TITLE.FindControl("Text1")).Text;
You should remove "
AD_TITLE
".string title = ((System.Web.UI.WebControls.TextBox)e.FindControl("Text1")).Text;
bijeshputhalath wrote:
C:\Inetpub\wwwroot\approvedplotfinal\index.aspx(2616): Could not find any attribute 'align' of element 'marquee'.
Where do you set "marquee" in your code??
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)
Hello while i removing AD_TITLE and try with your suggestion....But the following error comes C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(151): 'System.EventArgs' does not contain a definition for 'AD_TITLE' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(163): 'System.EventArgs' does not contain a definition for 'FindControl' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(171): 'System.EventArgs' does not contain a definition for 'FindControl' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(170): 'System.EventArgs' does not contain a definition for 'FindControl' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(162): 'System.EventArgs' does not contain a definition for 'FindControl' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(161): 'System.EventArgs' does not contain a definition for 'FindControl' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(169): 'System.EventArgs' does not contain a definition for 'FindControl' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(168): 'System.EventArgs' does not contain a definition for 'FindControl' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(167): 'System.EventArgs' does not contain a definition for 'FindControl' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(164): 'System.EventArgs' does not contain a definition for 'FindControl' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(166): 'System.EventArgs' does not contain a definition for 'FindControl' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(165): 'System.EventArgs' does not contain a definition for 'FindControl' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(160): 'System.EventArgs' does not contain a definition for 'FindControl' ----------------------------------------------------------------------------- Now My code is below --------------------------------- private void dlGallery_EditCommand(object sender, System.EventArgs e) { dlGallery.EditItemIndex = e.AD_TITLE.ItemIndex; BindList(); } private void dlGallery_updateCommand(object sender, System.EventArgs e) { // string item = ((System.Web.UI.WebControls.Label)e.FindControl("Label1")).Text; // string qty = ((System.Web.UI.WebControls.TextBox)e.FindControl("Text1")).Text; string title = ((System.Web.UI.WebControls.TextBox)e.FindControl("Text1")).Text; str
-
Hello while i removing AD_TITLE and try with your suggestion....But the following error comes C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(151): 'System.EventArgs' does not contain a definition for 'AD_TITLE' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(163): 'System.EventArgs' does not contain a definition for 'FindControl' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(171): 'System.EventArgs' does not contain a definition for 'FindControl' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(170): 'System.EventArgs' does not contain a definition for 'FindControl' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(162): 'System.EventArgs' does not contain a definition for 'FindControl' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(161): 'System.EventArgs' does not contain a definition for 'FindControl' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(169): 'System.EventArgs' does not contain a definition for 'FindControl' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(168): 'System.EventArgs' does not contain a definition for 'FindControl' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(167): 'System.EventArgs' does not contain a definition for 'FindControl' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(164): 'System.EventArgs' does not contain a definition for 'FindControl' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(166): 'System.EventArgs' does not contain a definition for 'FindControl' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(165): 'System.EventArgs' does not contain a definition for 'FindControl' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(160): 'System.EventArgs' does not contain a definition for 'FindControl' ----------------------------------------------------------------------------- Now My code is below --------------------------------- private void dlGallery_EditCommand(object sender, System.EventArgs e) { dlGallery.EditItemIndex = e.AD_TITLE.ItemIndex; BindList(); } private void dlGallery_updateCommand(object sender, System.EventArgs e) { // string item = ((System.Web.UI.WebControls.Label)e.FindControl("Label1")).Text; // string qty = ((System.Web.UI.WebControls.TextBox)e.FindControl("Text1")).Text; string title = ((System.Web.UI.WebControls.TextBox)e.FindControl("Text1")).Text; str
Sorry.. my mistake .. Try again with the following code.
e.Item.FindControl("")
If it is not still working, I wanna know a few thing and will make a sample download for you. 1. Are you using VS 2003 or 2005? 2. Are those column in DataList the bounded column or unbounded?Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)
-
Sorry.. my mistake .. Try again with the following code.
e.Item.FindControl("")
If it is not still working, I wanna know a few thing and will make a sample download for you. 1. Are you using VS 2003 or 2005? 2. Are those column in DataList the bounded column or unbounded?Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)
Hello Thank you for your reply.... 1. Are you using VS 2003 or 2005? Ans: vs2003 2. Are those column in DataList the bounded column or unbounded? Ans:Bounded i try it with e.Item.FindControl("") But still the same error comes...... ------------------------------------------------------------------------- C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(159): 'System.EventArgs' does not contain a definition for 'Item' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(163): 'System.EventArgs' does not contain a definition for 'Item' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(171): 'System.EventArgs' does not contain a definition for 'Item' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(170): 'System.EventArgs' does not contain a definition for 'Item' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(162): 'System.EventArgs' does not contain a definition for 'Item' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(161): 'System.EventArgs' does not contain a definition for 'Item' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(169): 'System.EventArgs' does not contain a definition for 'Item' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(168): 'System.EventArgs' does not contain a definition for 'Item' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(167): 'System.EventArgs' does not contain a definition for 'Item' ---------------------------------------------------------------------------- Then i hide(//give comment lines and try if the Datalist showing the items or not
**But the Error is like this ......What is my mistake, i cant recognize...???please help me to find it out.............**
Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS0122: 'Newclassified.Youradvts.dlGallery_cancelCommand(object, System.EventArgs)' is inaccessible due to its protection level Source Error: Line 7103: Line 7104: Line 7105: -
Hello Thank you for your reply.... 1. Are you using VS 2003 or 2005? Ans: vs2003 2. Are those column in DataList the bounded column or unbounded? Ans:Bounded i try it with e.Item.FindControl("") But still the same error comes...... ------------------------------------------------------------------------- C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(159): 'System.EventArgs' does not contain a definition for 'Item' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(163): 'System.EventArgs' does not contain a definition for 'Item' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(171): 'System.EventArgs' does not contain a definition for 'Item' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(170): 'System.EventArgs' does not contain a definition for 'Item' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(162): 'System.EventArgs' does not contain a definition for 'Item' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(161): 'System.EventArgs' does not contain a definition for 'Item' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(169): 'System.EventArgs' does not contain a definition for 'Item' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(168): 'System.EventArgs' does not contain a definition for 'Item' C:\Inetpub\wwwroot\approvedplotfinal\classified\Youradvts.aspx.cs(167): 'System.EventArgs' does not contain a definition for 'Item' ---------------------------------------------------------------------------- Then i hide(//give comment lines and try if the Datalist showing the items or not
**But the Error is like this ......What is my mistake, i cant recognize...???please help me to find it out.............**
Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS0122: 'Newclassified.Youradvts.dlGallery_cancelCommand(object, System.EventArgs)' is inaccessible due to its protection level Source Error: Line 7103: Line 7104: Line 7105:bijeshputhalath wrote:
private void dlGallery_EditCommand(object sender, System.EventArgs e)
void dlGallery_EditCommand( Object sender, DataListCommandEventArgs e ) {
bijeshputhalath wrote:
private void dlGallery_updateCommand(object sender, System.EventArgs e)
private void dlGallery_updateCommand(object sender, DataListCommandEventArgs e)
bijeshputhalath wrote:
private void dlGallery_cancelCommand(object sender, System.EventArgs e)
private void dlGallery_cancelCommand(object sender, DataListCommandEventArgs e) If you want sample for that, please check the following link. http://www.dotnetjohn.com/articles.aspx?articleid=17 http://authors.aspalliance.com/aspxtreme/shared/viewsrc.aspx?path=/aspxtreme/sys/web/ui/webcontrols/demos/datalisteditcommand.aspx.src[^] x Hope it helps.
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)