Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Selected Text event not working

Selected Text event not working

Scheduled Pinned Locked Moved ASP.NET
databasehelptutorialannouncement
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    omlac
    wrote on last edited by
    #1

    Hi all I have a textbox(tboContent) im typinh data into and another one tboCharacters i would like to display information ie the number of text i have entered in the first textbox. I have added that to the textchanged event and set autopostback to true. I added the control as a trigger on the Update panel but nothing changes gets displayed on the display screen until i submit the form manually(say clicking another control with postback set to true) Does anyone know how to solve this problem. protected void tboContent_TextChanged1(object sender, EventArgs e) { tboCharacters.Text = Convert.ToString(160 - Convert.ToInt64(tboContent.Text.Length - 1)); } Thank you.

    B O 2 Replies Last reply
    0
    • O omlac

      Hi all I have a textbox(tboContent) im typinh data into and another one tboCharacters i would like to display information ie the number of text i have entered in the first textbox. I have added that to the textchanged event and set autopostback to true. I added the control as a trigger on the Update panel but nothing changes gets displayed on the display screen until i submit the form manually(say clicking another control with postback set to true) Does anyone know how to solve this problem. protected void tboContent_TextChanged1(object sender, EventArgs e) { tboCharacters.Text = Convert.ToString(160 - Convert.ToInt64(tboContent.Text.Length - 1)); } Thank you.

      B Offline
      B Offline
      Brij
      wrote on last edited by
      #2

      can u post the full code?

      Cheers!! Brij

      1 Reply Last reply
      0
      • O omlac

        Hi all I have a textbox(tboContent) im typinh data into and another one tboCharacters i would like to display information ie the number of text i have entered in the first textbox. I have added that to the textchanged event and set autopostback to true. I added the control as a trigger on the Update panel but nothing changes gets displayed on the display screen until i submit the form manually(say clicking another control with postback set to true) Does anyone know how to solve this problem. protected void tboContent_TextChanged1(object sender, EventArgs e) { tboCharacters.Text = Convert.ToString(160 - Convert.ToInt64(tboContent.Text.Length - 1)); } Thank you.

        O Offline
        O Offline
        omlac
        wrote on last edited by
        #3

        public partial class Home_Page_frmSMSTemplate: System.Web.UI.Page { long lngSMSID = 0; // long lngContactID = 0; string strUserName = ""; SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString); protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { lblNewRecord.Text = "true"; strUserName = Convert.ToString(Session["UserName"]); //strUserName = Convert.ToString(Request.QueryString["strUsername"]); lngSMSID = Convert.ToInt64(Request.QueryString["ID"]); LoadSMSDetail(lngSMSID); } else { lngSMSID = Convert.ToInt64(Request.QueryString["ID"]); strUserName = Convert.ToString(Session["UserName"]); //strUserName = Convert.ToString(Request.QueryString["strUsername"]); } } private void LoadSMSDetail(long lngSMSID) { try { LoadMergeFields(); if (con.State == ConnectionState.Closed) { con.Open(); } SqlCommand SqlCmd = new SqlCommand("Get_SMSTemplate", con); SqlDataReader dtr; SqlCmd.Parameters.AddWithValue("@SMSTemplateID", lngSMSID); //SqlCmd.Parameters.AddWithValue("@ContactID", lngContactID); SqlCmd.CommandType = CommandType.StoredProcedure; dtr = SqlCmd.ExecuteReader(); while (dtr.Read()) { tboName.Text = (string)dtr["SMSTemplateName"]; //tboSubject.Text = (string)dtr["SMSTemplateText"]; rbtnAuditor.Checked = (bool)dtr["IsScheduledAuditor"]; rbtnSite.Checked = (bool)dtr["IsScheduledSite"]; rbtnNotification.Checked = (bool)dtr["IsNotification"]; rbtnReport.Checked = (bool)dtr["IsAuditReport"]; rbtnSample.Checked = (bool)dtr["IsScheduledSamples"]; rbtnReSite.Checked = (bool)dtr["IsReScheduledSite"]; rbtnFotten.Checked = (bool)dtr["IsForgotPassword"]; rbtnNewIncident.Checked = (bool)dtr["IsNewIncident"]; rbtnIncidentReassign.Checked = (bool)dtr["IsReassignedIncident"]; rbtnReactivatedInc.Checked = (bool)dtr["IsReactivatedIncident"]; rbtnActionsNotification.Checked = (bool)dtr["IsNewAction"]; r

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups