Friday, November 8, 2013

jQuery not firing in Content Page derived from Master Page

If Your jquery is not working in Content Page i.e. Web form using Master page than try the following

usually we get DOM by $("#ControlName")

The above method should work properly when the web form is not derived from Master Page

But when the page is derived from Master Page all controls id's are changed hence the above method will not find reference of the control

Now in order to find correct reference we should do something like this

 var reference = $("#<%=controlName.ClientID %>")

This way we can get the reference and assign it to a variable

Now using variable we can work on the control like we usually do it jquery

I hope it was informative for you, and I would like to Thank you for reading

Wednesday, November 6, 2013

How To Hide Certain Column in datagridview C#

In order to hide certain column of datagridview, do something like this

dataGridView1.Columns[4].Visible = false;
  • where dataGridView1 is the name of your datagridview
  • Column starts from index 0 
You can hide multiple columns just change the index number

I hope it was informative for you, and I would like to Thank you for reading

Tuesday, November 5, 2013

How To Pass Array to a Web Method or Web Service Method

In this tutorial I will show you how to pass an array to a Method this can also work for web service method as well.

1. First we need to define a array and it some data in it


   1:              string[] array = new string[20];
   2:              for (int i = 0; i < 4; i++)
   3:              {
   4:                  array[i] = "This is number " + i;
   5:              }
 
 
Here I have define an array of type string, this can be of other type as well.

2. Now we will create a method that will accept a array of type string as a parameter


   1:  public void compressFiles(string[] objlistt)
   2:          {
   3:                  for (int i = 0; i <objlistt.Length; i++)
   4:                  {
   5:                  // your code here
   6:                  }
   7:          }
 
3. Now to send the array to the method, you will need to call that method like this


   1:  compressFiles(array);
 
I hope it was informative for you, and I would like to thank you for reading

How To Fix Apache Server No Service Installed

Hello,

 If you have encounter an error while installing Apache Server like below, than you are at the right place, in this tutorial I will tell you why these error occur and what does these error means.



  • The First error window means that something is interfering with port 80 and it is not letting Apache Server to use this port.
In my case the problem was with the IIS, IIS was already installed on my machine now because it was using the port 80 that's why Apache gave error that it cannot bind the port 80.
  • The Second error window state that after installing Apache, the system could not find service called "Apache2"
In our case because it couldn't bind the port 80, so it didn't register the service

So what is the solution ?? you have 2 options.

1. Disable IIS service (Click to find How)

OR

2. Change your website port to something else in IIS (Click to find How)

If you have any further queries, than please do comment.

Thanks

Monday, November 4, 2013

How To Disable IIS Service

Hello,
          In this tutorial I will show you how to Disable IIS Service.

1. Click on Start Menu and than Click on Run

2. Type services.msc and click on OK

3. Now find service called IIS Admin Service, right click on the service and click on Stop



You will receive a warning message like above because

  • World Wide Web Publishing Service
  • Windows Remote Management (WS-Management)
  • HTTP SSL
All these 3 services are dependent on IIS, so if you stop IIS these services will be stop as well

4. Click on Yes

Keep in mind that, IIS will start again next time when you start your windows, to keep it disable for future you would need to right click on IIS Admin Service and click on properties, than from there change the start-up type to Disable.

That's it you have successfully disabled IIS.

If you have further queries please don't hesitate to comment.

Thanks