Feeds:
Posts
Comments

Archive for February, 2009

I needed to access every cell of a GridView in Client Side in one of my application, so needed to call javascript from GridView Cell. Actually I have a Dropdownlist , select any of the item from the dropdownlist will change the value of the same row in a different cell and will change the GridView footer row  value.

Here is a article showing how to access row and cell of a gridview from client site.
http://weblogs.asp.net/ashrafurrahaman/archive/2009/02/26/javascript-for-gridview-row-level.aspx

Advertisements

Read Full Post »

I needed to run my web application in a fixed port of my web server due to fixed SiteURL in the web site whcih I needed to change every time from the web config.

Here are simple and easy steps tp run your web application in a fixed port of your web server.

1. Go to Solution Explorer of your project
2. Go to properties of your web site clicking F4 on your web site name.
3. Make “Use Dynamic Port” to “False” and put a “Port Number“, you website will always run in that port number.

Read Full Post »

I have just wrote a simple method to start/stop remote services from powershell

function ManageRemoteService
{
param([string]$serverName, [string]$serviceName, [string]$status)
if (-not ([appdomain]::CurrentDomain.getassemblies() |? {$_.ManifestModule -like “system.serviceprocess”}))
{
[void][System.Reflection.Assembly]::LoadWithPartialName(‘system.serviceprocess’)
}
$getServiceStatus = (new-Object System.ServiceProcess.ServiceController($serviceName,$serverName)).Status
if($getServiceStatus -ne $null)
{
if($getServiceStatus -eq “Running” -AND $status -eq “Stop”)
{
(new-Object System.ServiceProcess.ServiceController($serviceName,$serverName)).Stop()
(new-Object System.ServiceProcess.ServiceController($serviceName,$serverName)).WaitForStatus(‘Stopped’,(new-timespan -seconds 10))
“$serviceName stopped”
}
elseif($getServiceStatus -eq “Stopped” -AND $status -eq “Start”)
{
(new-Object System.ServiceProcess.ServiceController($serviceName,$serverName)).Start()
(new-Object System.ServiceProcess.ServiceController($serviceName,$serverName)).WaitForStatus(‘Running’,(new-timespan -seconds 10))
“$serviceName started”
}
else
{
“$serviceName is already $status”
}
}
else
{
“$serviceName not found in $serverName”
}
}
Call the method from you powershell scripts just that way
ManageRemoteService “MyServerPC” “MyAlertService” “Start”
ManageRemoteService “MyServerPC” “MyAlertService” “Stop”

Read Full Post »