|
You can either use commandfield like,
<Columns>
<asp:CommandField ShowDeleteButton="True" />
</Columns>
or TemplateField like,
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="lbtnDelete" runat="server">Delete</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
For more info,
http://msdn.microsoft.com/en-us/library/bb288032.aspx[^]
|
|
|
|
|
hi i want to submit the value of dynamically created textbox dynamically.for this i have written following code but it is givin error:object refrence not set to an instance of an object.
the code is:
protected void Button2_Click(object sender, EventArgs e)
{
OleDbDataReader dr = null;
string str = "Select * From ProductSpecification";
OleDbCommand cmd = new OleDbCommand(str, conn);
conn.Open();
dr = cmd.ExecuteReader();
for (int i = 1; i < dr.VisibleFieldCount; i++)
{
while (dr.Read())
{
string s=dr["Specification"].ToString();
TextBox txtctrl=new TextBox();
txtctrl=(TextBox)Panel2.FindControl("txt" + s);
string s1 = txtctrl.Text;
string s2 = "Update ProductSpecification Set(Value='" + s1 + "')";
cmd = new OleDbCommand(s2, conn);
cmd.ExecuteNonQuery();
}
}
conn.Close();
}
|
|
|
|
|
mylogics wrote: txtctrl=(TextBox)Panel2.FindControl("txt" + s);
I think you are getting error may be because of this.Plz check if you are getting that control by using FindControl.
|
|
|
|
|
yaa m getting error on same line....
wat shud i do to remove this error...
wat line shud i write instead of this...
|
|
|
|
|
|
Button click will do a post back. Do you take care in you page load that your textbox does not get vanished?
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
no shud i chek for ispostback at pageload event....
|
|
|
|
|
Make sure the dynamic control is added to Page_Load method. If not, when posting back, the control will lose
txtctrl.ID = "txt" + s;
Panel2.Controls.Add(txtctrl);
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 21:57pm.
|
|
|
|
|
(ASP.NET 3.5)
I m getting problem with ~ sign used to locate the master file.
The project is running on local but when hosted on web then an error "Home.Master" page not found.
===============
<%@ Page Title="" Language="C#" MasterPageFile="~/Home.Master" AutoEventWireup="true" CodeBehind="StudentRegistration.aspx.cs" Inherits="IUMS.SIS.StudentRegistration"
=================
Please suggest me some answer
Thax
|
|
|
|
|
gauravems wrote: MasterPageFile="~/Home.Master"
Shouldn't it be MasterPageFile="Home.Master" ?
Your current path does not make any sense to me.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hello,
I am a ASP.NET web developer. I need to design a Work Flow for an Application which has about 75+ forms & tables. I need a supporting toolkit which can be used by the end user of my application who can configure his own flows dynamically. The workflow engine should provide a web based graphical designer for the end user and an API for integrating the workflow designed by the end user graphically.
If you can suggest some product which is available in the market which can be a open source or even a commercial product, which should be reliable & more economical. The work flow engine should be more dynamic & more user friendly.
Regards
Darpan Perumal
|
|
|
|
|
Try this site many people are using for creating work flows
http://www.skelta.com/[^]
If It Helps Click It as Answer
|
|
|
|
|
Thanks for your reply,
I went through your referred vendor. But the product is not compatible with external forms tables & classes. If I need to use his product I need to create forms using his product.
I would like to know any product which has the capabilities or in-line with "Tibco Iprocess".
|
|
|
|
|
hi
i want display my table values in treeview control
my table has two columns
Pid sub Id
1 5
1 8
2 7
6 8
4 6
4 9
treeview i want like this
1
->5
->8
2
->7
6
->8
4
->6
->9
using vb.net code(for loop and if condition) is it possible to display the table content like this
|
|
|
|
|
Member 2657553 wrote: using vb.net code(for loop and if condition) is it possible to display the table content like this
Yes.
All you'd do is create your first set of nodes, then you'd look up each first level node to insert the second level ones.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
You can use a construction like this:
Dictionary<int, Listlt;int>> LlstTreeNodes = new Dictionary<int, List<int>>();
Fill it with the data from your table.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hi,
is there any components to play list of audio songs in asp.net web application, this wants to support different audio types or atleast .Mp3 and .wav formats. Please help me out, if any one knows.
Thanks in advance...
Regards
murthy
|
|
|
|
|
|
hii
i have generated dynamic labels and textbox based on
the no.of rows in my table Specification.
the table contains columns:
ProductID,Specification,Value.
ProductID and Specification columns are already filled before.
i have to enter thier values on button click.
For these i have generated the respective labels and textbox
dynamically.also i have generated a button dynamically.
now on click event of this button i want that the values entered
in the textbox get submitted in the respective rows of value column in Specification table.I a have used the followin coding.plz guide
how cud i submit the values on the button click.code is:
protected void LinkButton2_Click(object sender, EventArgs e)
{
OleDbDataReader dr = null;
string str = "Select * From ProductSpecification";
OleDbCommand cmd = new OleDbCommand(str, conn);
conn.Open();
dr = cmd.ExecuteReader();
for (int i = 1; i < dr.VisibleFieldCount; i++)
{
while (dr.Read())
{
Label lbl = new Label();
String getlbl = dr["Specification"].ToString();
lbl.ID = "lbl" + getlbl;
lbl.Width=50;
Panel2.Controls.Add(lbl);
lbl.Text = getlbl;
TextBox txt = new TextBox();
string gettxt = dr["Specification"].ToString();
txt.ID = "txt" + gettxt;
Panel2.Controls.Add(txt);
Panel2.Controls.Add(new LiteralControl("<br>"));
}
}
conn.Close();
Button b = new Button();
b.Text = "AddValues";
b.Click += new EventHandler(btnadd_Click);
Panel2.Controls.Add(b);
}
thanks.....
|
|
|
|
|
mylogics wrote: now on click event of this button i want that the values entered
in the textbox get submitted in the respective rows of value column in Specification table.
If you are not creating control before Page_Load it will not able to load postback data and view state data. . You need to create all dynamic control either in init or Pre_init
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
hii m creating this dynamic controls on click event of linkbutton.
and there is no preinit event for the link button.
reply....
|
|
|
|
|
Each time the page is posted back, all the events get generated again with IsPostBack value true.
So you can check it easily.
|
|
|
|
|
mylogics wrote: preinit event for the link button
Its not LinkButton, Its Page_PreInit() ;
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
theres no page preinit event in csharp...
plz give me exact answer...
|
|
|
|
|
mylogics wrote: theres no page preinit event in csharp...
There is in .NET 3.5.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|