Jump to content
Xtreme .Net Talk

otpiness

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by otpiness

  1. Hope this helps Step1. In your HTML <form id="Form1" method="post" runat="server"> <asp:Button id="Button1" runat="server" Text="Button"></asp:Button> <SELECT id="Select1" runat="server"> <OPTION SELECTED>Item1</OPTION> <OPTION>Item2</OPTION> <OPTION>Item3</OPTION> </SELECT> </form> Step2. In your Code behind public class WebForm1 : System.Web.UI.Page { protected System.Web.UI.WebControls.Button Button1; protected System.Web.UI.HtmlControls.HtmlSelect Select1; private void Button1_Click(object sender, System.EventArgs e) { Response.Write(Select1.Value); } } ================================== What you are looking at is: ================================== 1. Step1 make your HTML dropdown runat="server" and give it an ID (Select1 in this case) 2. Declare a variable with the same name as the ID and Type System.Web.UI.HtmlControls.HtmlSelect Finally, access the HTML control as Select11.Value ! :)
  2. I guess your problem is not really the Text but the paint process of that box. I would try two possibilities 1. Override the OnPaint() event in a derived textbox and control when to paint how much. So actual text is held in the Text property but you paint only that is visible 2. Create a custom/owner drawn control
  3. 1. DataTable has got property called PrimaryKey and then use DataTable.Rows.Find() 2. DataTable.Select() has two very usefull overloads and then count on the Rows>0 Hope this helps
×
×
  • Create New...