How to get the data in textbox when it's property is enable=false at runtime

I m doing project in  ASP.NET 2005 using  SQL  SERVER 2005 as the database. And using SQL DATASOURCE CONTROL to get the data from sql.

I want to get data of dynamic control textbox at lost focus event which is enabled=false. But, I dont know the procedure to get data at lost focus event and enables property=false. how can I get it?
Please answer me as early as possible.....
Thanking you in advance

protected void cmdsubmit_Click(object sender, EventArgs e)
       string str;
      //str ="select id from companymaster where companyname='glaxo'";
      //tbid.Text = str.ToString();
       str = ("Select (max(id),0) + 1 from addresstable ");

   ----- I don't get how to see/store it in the textbox---

Compiler Error Message: CS0117: 'System.Web.UI.WebControls.TextBox' does not contain a definition for 'text'
Line 96:         tbid.text = str;

If i write the string instead of query in the str variable then it displays now it must be problem in writing query or assign it to textbox..

I have already created the id as identity in sql server which helps to autoincrement.
I want to display that autoincremented id in my textbox control.

If possible with the label control then also it's fine.
4/22/2007 5:34:04 AM 93655 articles. 3 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 14

You may need to have look at the data tutorials at

It explains all about database programming!


Mark post(s) as "Answer" that helped you

Electronic Screw
4/22/2007 6:57:40 AM

Similar Artilces:

Urgent Help! How to get data from child's gridview to parent's textbox
 Hello Sir,Would you please advise me, how can I get the data from child gridview to parent textbox.For example, I have select 2 row in child's datagrid the values are "A" and "B" then click add and "A B" appears in the same parent's textbox. Thanks in advance!   Anyone please help me. How to get the data from gridview on popup page to textbox on the main page. Thank you so much!!!! Hi Novox , Please check my sample :   <asp:GridView ID="GridView1" runat="server" Height="227px" Width...

Urgent Help! How to get data from child's gridview to parent's textbox #2
 Hello Sir,Would you please advise me, how can I get the data from child gridview to parent textbox?For example, I have select 2 row in child's datagrid the values are "A" and "B" then click add and "A B" appears in the parent's textbox. I think this must use JavaScript to make this happen but I have no idea, please help! Thanks in advance!  parent page : <html xmlns="" ><head runat="server"> <title>Untitled Page</title></head><body> <form...

Getting a web form's properties to a Custom User Control
Ok. This is hopefully a simple question that someone could help me out on. I've researched but only found out how to get a user control properties to a web form. Problem:  Anyway, I have created a custom user control (Help button with a menu extender) which will be used on several pages. The menu that extends from the button will not be static, so I will want to load the right data (from my xml file) depending on which page the help button is on. For example, my custom user control will be on pages news and the other on media. Now, when the user control loads on the news page, I need ...

How to programatically access another web site's form and get the data?
Hello,I need to write a script that will send a POST to a web site's form and then accept the CSV file that it will return.  I can go onto the web site and enter my username, password and a month from a drop down to get a CSV file of data but I would like to program a web form on my Admin site that will do this for me by pressing a button as I want to process the results and add to a database.Any thoughts on how to start?Thanks Well sounds like what you need to start is creating an object of this login screen, pressing the login button and then changing the drop down to the corre...

How to send http request including POST's or GET's Data and triggering the event of web pgae!
http://svr1/Login.aspx <Html>...<Body><form id="Form1" method="post" runat="server"><asp:TextBox id="txtUserName" runat="server"></asp:TextBox><asp:TextBox id="txtPwd" runat="server"></asp:TextBox><asp:Button id="btnLogin" runat="server" Text="Login"></asp:Button><asp:Label id="Label1" runat="server"> </asp:Label></form></Body></Html> Codebehind Login.aspx.cs…private void btnLogin_Click(object sender, System.EventArgs e){if((txtUserName.Text=="Peter")&&(txtPwd.Text=="1234")){Label1.Text="succe...

The Enable property of TextBox and Botton are false. how to change these control's forecolor? Is it impossible?
The Enable property of TextBox and Botton are false.  Forcolor of These control is gray.  Old people  cannot see it clearly. how to change the control's forecolor? Is  it  impossible? Thank you Very much    U cant do anything with disabled control for textbox u can do ReadOnly ="true" For button u can apply some good color combination so that ur button text appaers for eg use Red as forecolor so that its visible clearly even if the button is disabledMAKMark as Answer if this reply helps youMVP ASP/ASP.NetASP...

How to get textbox value when textbox properties is readonly or enabled false
Hi ,I have one problem, If u have idea please solve  itTo dispaly canlendercontrol iam using ajax canlender control, after selecting dateof birth into textboxIn textbox keeping textbox properites as readonly or enabled equal false,  getting that textbox value into lable,  ThanksRamesh  Just get the Textbox.Text value?Don't forget to click "Mark as Answer" on the post that helped you. If I understand you correctly, you have a textbox that is disabled/readonly. You use some code to change the value in the textbox, and you want that value to be returne...

Access Web Control's property within the Web Form
Hello, I have a Web Control which has a TextBox and a Button. I want to put this Control on a WebForm, then put some text in a Control's TextBox, press on Control's Button and be able to access text box's value from within the Web Form. That's my Control: _________________________________________________ public class Colo : System.Web.UI.UserControl { protected System.Web.UI.WebControls.TextBox TextBox1; protected System.Web.UI.WebControls.Button Button1; public string Myval{ get{return (string)ViewState["myval"];} set{ViewState["myval"] = va...

Meke Control's property disabled or enabled based on another property's entered value ?
Does anyone know how to disable or enable a property in properties window based on value entered in another property?Please advise.Regards,Dimitry...

hei guys, i need help on my application, i'm using C#.NET as front-ed and SQL as back-end, aside from a datagrid, i want to display my data using textboxes and not a datagrid, i can do it using Visual Basic 6 but since i'm a newbee at C#.NET i don't know how to do it, specially the codes, can anyone help me with it? thank you in advance! If you are doing windows development, i would suggest using 'DataForm wizard' (Use Solution Explorer-->Rightclick project-->Add new Item-->New DataForm). It will guide you through steps. If you are doing web apps. Use quickstart to learn them. h...

Why can't I Enable Editing on a Gridview that gets it's data from a View through an SqlDataSource?
Hi, I think the title explains it all really. I cannot configure the SqlDataSource to add Insert, Update and Delete statements - not through the wizard anyway. The view combines two tables, each containing 3 columns. I have tried using different combinations of columns, and ended up selecting all of them (making sure the foreign key column of the first table was given a different alias to the primary key column of the second table) but I still cannot enable editing. Cheers, PatrickDisco Patrick writes web applications using:Visual Studio 2008ASP.NET 3.5C#SQL Server 2008 Use stored pr...

It's all very fuzzy now...can make web request(?) but definately can't get web response from web service
Alas...trying to get a web service response from a web service that is part of the web site in Visual Studio.Net 3.5 appears to be impossible.  Infact, I've been ALL over the internet over the past couple of days looking at all types of fragmentory examples in all types of Microsoft languages to no avail. =========QUESTION:=========1.  How do I call a web service (the function to call is "WebService_BulkData") so that my aspx page will send it a SOAP request and print out the web service response data to the page?  The aspx page AND the web service are part of t...

Mozilla get's no style tag's from .net server.
I made a webform in web matrix, and it looks fine in IE. If I open the same link whit Mozilla, it looks like a disaster. When I look at the HTML source, there are no style tags as in IE. But when I save the HTML source from IE (the one whit style tags) and open it in Mozilla, it looks perfect. So the onley reason the webform looks wrong in Mozilla, is because the .net server detects Mozilla and not IE and sends a style less HTML source. Wy? Mozilla does support style tags. Is there a solution for this bug? Or is this a uh.. feature? ..Mivz Update, I have got some more info. It is ...

How can I get out of my Mozilla's browser the Winamp browser and get back the Google's or Mozilla's browser.
Please I have got to my browser ( I don't know how.) the Winamp browser he behave like virus stick in.But he doesn't has uninstalation section so I can't do anything to get him away from Mozilla's file. I'm not happy of Winamp's behave its like advertisement against a customer's will. Please is there any way to get him away from Mozilla?Please send me exact direction I have tried many ways but he is deeply inside the systeme so when I install new Mozilla he is always here ready to pester me. Thank you for an answer. Richard ...

Web resources about - How to get the data in textbox when it's property is enable=false at runtime -

Resources last updated: 12/3/2015 6:39:33 PM