Clear text in All Text Box Controls Reset the all text box Control by using Following Function Usage : Resetfromcontrol(this); Function : public void Resetfromcontrol(Control parent) { try { foreach (Control c in parent.Controls) { if (c.Controls.Count > 0) { Resetfromcontrol(c); } ...
Create Look up Page Data Bound //Opener Page (Look Up page) Step 1 : Add following script in Lookup.aspx page // Lookup.aspx < script language ="javascript" type ="text/javascript"> function GetRowValue(val) { if (val != ' ' ) { val1 = 0; window.opener.document.getElementById( 'ctl00_ContentPlaceHolder1_hdfID' ).value = val; window.opener.document.getElementById( 'ctl00_ContentPlaceHolder1_hdfFlagID' ).value = val1; } window.opener.document.forms[0].submit(); self.close(); } </ script > // in code behinds lookup.aspx.cs Step2 : InGridView- Go to edit item template in grid and select the button field and convert as item template...
Code to create Sorting for a GridView in ASP.net in Code Behind? Step 1: Add the Property in your Class public string SortField { get { return ( string ) ViewState [ "_sortField" ]; } set { ViewState [ "_sortField" ] = value ; } } public string SortDir { get { return ( string ) ViewState [ "_sortDir" ]; } set { ViewState [ "_sortDir" ] = value ; ...
Binding the image Control with byte File upload control on client side show image using byte array //File upload control on change to post the method fileupload control and image control should be in update panel <asp:FileUpload ID="FileUpload1" runat="server" onchange="this.form.submit();" /> image control on page // on page load if (FileUpload1.PostedFile != null && FileUpload1.PostedFile. ContentLength > 0) { UploadImage(); } // upload image method void UploadImage() { //Session["File"] = fluPicture.FileBytes; //Session["Name"] = fluPicture.FileName; // st...