c# - asp.net panel control visibility issue -
I have written a code that checks the unique ID availability status. If ID is available, then the panel is visible otherwise The visibility of the panel should be hidden. But it is not working. It works if I work in the page load visibility of the panel .. But the panel visibility code within the text visibility code of the text box does not work to update the content within the update panel in my watch page script manager is present. What am i doing wrong
& lt; asp: ScriptManager id = "scriptmanager1" runat = "server" & gt; & Lt; / ASP: ScriptManager & gt; & Lt; Div & gt; & Lt; asp: UpdatePanel id = "PnlUsrDetails" runat = "server" & gt; & Lt; ContentTemplate & gt; & Lt; Table & gt; & Lt; TR & gt; Enter a specific number: & lt; ASP: Textbox ID = "TextQQIEE" Runat = "Server" AutoPostback = "True" On Text Exchange = "TextNEWEAPPTED" /> & lt; / TR & gt; & Lt; TR & gt; & Lt; div id = "checkusername" runat = "server" visible = "false" & gt; & Lt; ASP: Image ID = "IMGStatus" runat = "server" width = "17px" height = "17px" /> & Lt; Asp: Label ID = "lblStatus" runat = "server" & gt; & Lt; / Asp: label & gt; & Lt; / Div & gt; & Lt; / TR & gt; & Lt; / Table & gt; & Lt; / ContentTemplate & gt; & Lt; / ASP: UpdatePanel & gt; & Lt; ASP: panel id = "panel 1" runat = "server" & gt; & Lt; Div & gt; Panel content & lt; / Div & gt; & Lt; / ASP: Cell & gt; false; PopulateCategory (); getSubCategories (CategoryDropDownList.SelectedValue); // Category DropOneListScheduled Index (faucet, empty); }} Secure void txtUniqueNo_TextChanged (Object Sender, EventArgs E) {if (! String .nnnotottytte (TSTTN ANICAte Text)) {ODBC Connection Connection = New ODBC Connection (DB Database String ()); If (conn.State == ConnectionState.Open) conn.Close (); conn.Open (); OdbcDataReader dr = cmd.ExecuteReader (); if (Dr. HasRows) {checkusername}, "ODBC Commands CMD = New ODBC Commands (" Choose from Gallery, where unique_no = '"+ + + + TCTTN exclusive. .Visible = true; Panel 1. View = Valid; imgstatus.ImageUrl = "~ / Picture / Unavailable Page"; LblStatus.Text = "Unique ID Already Taken";} {Tryusername.Visible = true; Panel 1.Visible = True; Imgstatus.ImageUrl = "~ / images / tick.png"; LblStatus.Text = "Unique ID Available";} Hold (Exception Pre) {string mess = ex.Message;}}} and { Checkusername.Visible = fals e;}} My file upload is also in the update panel, which loses its file when uploading Please suggest me an alternative approach to get this functionality ... thanks < / P>
Probably not the reason for control (visible = false) and no viewtest has been saved previously. And try to show it with styles:
First:
Protected Zero Page_load (Object Sender, event events e) {if (! This.Page.IsPostBack) {/ Panel1. Person = False; PopulateCategory () comment; getSubCategories (CategoryDropDownList.SelectedValue); // Category DropOpenStyledExpectedAccount (empty, empty); }} Secure void txtUniqueNo_TextChanged (Object Sender, EventArgs E) {if (! String .nnnotottytte (TSTTN ANICAte Text)) {ODBC Connection Connection = New ODBC Connection (DB Database String ()); If (conn.State == ConnectionState.Open) conn.Close (); conn.Open (); OdbcDataReader dr = cmd.ExecuteReader (); if (Dr. HasRows) {checkusername}, "ODBC Commands CMD = New ODBC Commands (" Choose from Gallery, where unique_no = '"+ + + + TCTTN exclusive. .Visible = true; Panel 1.Style.Add ("Display", "None"); imgstatus.ImageUrl = "~ / Picture / Unavailable Page"; LblStatus.Text = "Unique ID Already Taken";} Other {Try {checkusername.Visible = true; Panel 1.Style.Add ("Display", "Block"); imgstatus.ImageUrl = "~ / images / tick.png"; LblStatus.Text = "Unique ID Available"; } Hold (Exception pre) {string mess = ex. Message;}}} and {checkusername.Visible = false;}}
Comments
Post a Comment