Friday, 20 May 2016

How to use ternary operator in Gridview


In below article we will tell you How to use Ternary Operator in GridView.

Basically working of ternary operator is similar as if and else conditions, if it finds the condition to be true then the first expression will be executed otherwise the second will be executed.
It mainly has two  operators, ? and :, the "?" .

Syntax :-

 condition ? first_expression : second_expression;

Thursday, 19 May 2016

How to show and hide textbox on click of dropdown using javascript in

Introduction: Javascript is used for client side scripting

Code on Desgin page of Asp

 <asp:dropdownlist id="country" runat="server" class="form-txtfield" width="145px"
                            onchange="if(this.value!='Other'){ document.getElementById('divothercountry').style.visbility='hidden'; document.getElementById('divothercountry').style.display='none'; document.getElementById('divothercountry').style.visbility='hidden'; document.getElementById('divothercountry').style.display='none'; } else { document.getElementById('divothercountry').style.visbility='visible'; document.getElementById('divothercountry').style.display='block'; document.getElementById('divothercountry').style.visbility='visible'; document.getElementById('divothercountry').style.display='block'; }"

I hope that the functionality of the above attribute is clear to you now. Now you can use this code in your application If you have further question, just drop a line below and I will try to answer you as soon as possible.
Last but not least, connect with me on Twitter , Facebook , LinkedIn and Google+ for technical updates and articles news. We won’t spam or share your email address as we respect your privacy.

Friday, 13 May 2016

Create dynamic Copyright of website

Dynamic copyright year

 Every time when year changes we need to change our copyright year in our website which time consuming .If we have done the static coding . 

Thursday, 12 May 2016

Download multiple files as Zip Archive File using GridView in ASP.Net

Displaying the Files stored in Folder on the Server in ASP.Net GridView

Place GridView control on my Web Page along with a Button that will be used to download the Files.
var downloadFileName = string.Format("Sheet-{0}{1}.zip",cmf.Decrypt(Request.QueryString["Month"].ToString().Trim()).Replace(" ","").Replace(":",""), "-" + DateTime.Now.ToString("yyyy-MM-dd-HH_mm_ss"));