Wednesday, October 13, 2010

Use many Ajax Panels and triggers on the same page

When you have to single page for a whole site or a main part of it then you have to use panels, making them visible or invisible.
Here is a very good article to start off understanding and working with Ajax panels and triggers
http://www.asp.net/ajax/tutorials/understanding-asp-net-ajax-updatepanel-triggers
When using two more update panels (and/or controls that are not in Panels) the trick is to use triggers to use the control id and the event method name
for a trigger
<asp:asyncpostbacktrigger controlid="Button1" eventname="Click">
You can see that example working here
The dopdownlist for the selection of color is outside any panel but has a trigger places for it in one of the panels and hence behaves like a part of the panel. This can be used when you have two (or more) panels (i.e like a set of controls) and you need some external check for controls in there.

Tuesday, October 5, 2010

SharePoint Site creation

It's really easy to create a website
First off log in as the admin
on the to top nav bar looks like

click sites , then create site and choose a blank site template (I usually do this because any custom web parts can be added later), the put in a name and description
and a URL name, its better to choose a small one (like total quality management would be TQM) . The new website will take in Default site permissions
finally click on create button to create the website
I work on SharePoint 2003, for SharePoint 2007/2010 look at this
how to create a site in ShaePoint

Sunday, October 3, 2010

Create uninstaller shotcut for installer in .NET

I had a small problem of creating an uninstaller, here's it is....

I recommend you go through this first : Setup and deployment in VS 2005

In you solution Add a new project
From project templates choose a windows project.



in program.cs of the new project add this code in main()


[STAThread]
static void Main()
{
    string[] arguments = Environment.GetCommandLineArgs();
    foreach(string argument in arguments)
    {
       string[] parameters = argument.Split('=');
       if (parameters[0].ToLower() == "/u")
       {
          string productCode = parameters[1];
          string path =  Environment.GetFolderPath(Environment.SpecialFolder.System);
         Process proc = new Process();
         proc.StartInfo.FileName = string.Concat(path,"\\msiexec.exe");
         proc.StartInfo.Arguments = string.Concat(" /i ", productCode);
         proc.Start();
       }
    }
}

In the setup and deployment project created for your project
(see this to help yourself create one: Setup and deployment)

Include uninstall program out put in your setup project
Add the uninstaller's output to the set up....



,

In "User's Program menu" create shortcut to Uninstaller project output (as shown in the images above and in properties of this shortcut in parameter 'arguments' insert value "/u=[ProductCode]".

Rebuild Solution.

Hope it helps ;)