Se stai pensando che l’utente che Vista crea dopo il suo setup sia un administrator, allora ti sbagli alla grande.

L’utente che viene creato è – per parlare in stile XP – un incrocio tra un Power User e un Administrator, al quale con l’aggiunta delle UAC Vista sega parecchio le gambe.

Per tornare ai vecchi amori, specie per chi sviluppa, la soluzione è quella di abilitare l’utente Administrator di default disabilitato. Per fare questa operazione bisogna:

  1. Aprire un prompt di MS-DOS con la modalità “Run as administrator”
  2. Digitare net user administrator /actve:yes e premere invio

Da questo momento, avrete il vostro account pronto all’uso per tutto quello che si faceva un tempo.

Asp.net: Ajax e ObjectDataSource

31 May 2007 In: ASP e ASP.Net

Uno degli errori più comuni che si incontrano utilizzando Asp.net Ajax è l’errore javascript “Sys is undefined“, che si incontra quando non viene caricato correttamente lo ScriptManager.
In generale questo errore è comune quando per chi passa dalla versione RC o precedente alla RTM, ed è risolvibile configurando correttamente il Web.config (trovate le indicazioni sul blog di ScottGu http://weblogs.asp.net/scottgu/archive/2006/12/15/asp-net-ajax-1-0-release-candidate-now-available.aspx.

Tuttavia oggi mi sono imbattuto nello stesso errore, circostanziato ad un’unica pagina (mentre nelle altre pagine tutto funzionava correttamente).
Dopo alcuni tentativi e qualche ricerca ho scoperto che il problema era nell’utilizzo di un ObjectDataSource che utilizzava un riferimento alla pagina (per invocare un metodo sull’oggetto Page stesso).
Creato un oggetto ad hoc, tutto funziona correttamente, anche se quando il tempo me lo consentirà (o meglio, se il tempo me lo consentirà) indagherò più a fondo su questo bizzarro comportamento

Technorati Tags: ajax

Il titolo può quanto meno sembrare criptico, tuttavia, meglio di così non sono riuscito a condensarlo. Avevo un “problema” apparentemente semplice, quello di dover per l’appunto accedere ad una specifica colonna elaborata dal datasource, ma all’interno del codebehind.

Normalmente, grazie alla grande flessibilità dei nuovi oggetti ASP.Net 2.0, con poche righe di codice si riesce a modellare la pagina e mostrare i dati recuperati dal database.

Un esempio:

<asp:formview runat="Server" id="CategoryView" DataSourceID="CategoryData">
<itemtemplate>

</itemtemplate>
</asp:formview>

Avevo però la necessità di dover “catturare” uno di questi valori e assegnarlo ad un controllo che era da tutt’altra parte nella pagina, e che non doveva stare nel FormView.

Mi aspettavo quindi che agendo sull’evento OnDataBinding, il sender sarebbe stato capace di darmi accesso al DataRowView. Sulle prime non sapevo che l’oggetto che dovevo andare a cercare era quello, e forse questa ignoranza è stata frutto del tempo speso a cercare di capire.

Per accedere quindi alla collection di dati bisogna aggiungere un handler per l’evento OnDataBound come riportato nel codice sottostante.

<asp:formview datasourceid="CategoryData" id="CategoryView" runat="Server">
<itemtemplate>

</itemtemplate>
</asp:formview>

Nel codebehind, invece, bisognerà scrivere quanto segue:

protected void FormView1_DataBound(object sender, EventArgs)
{
DataRowView r = (DataRowView) FormView1.DataItem;
String xyz = r.Row[0].ToString();
}

Ovviamente questo discorso vale se l’oggetto bindato è di tipo AccessDataSource, SqlDataSource, ecc. Se già fosse stato un ObjectDataSource, la cosa sarebbe stata decisamente differente, perchè a tornare indietro sarebbe stato un oggetto di tipo object.

This is a topic for which I’ve asked help also on dedicated ng, and for what I remember also the MVPes wasn’t able to help me. After some research and a bit of luck, I’ve finally found the solution.

Windows Vista has a powerful document indexer integrated into it, that is in charge to catalog all newly docs generated or saved into the PC, included e-mail and contacts inside Outlook.

Outlook 2007, installed on Windows Vista, use exclusively this indexer to scan through all the e-mails and contact when user queries for a specific topic, replacing the internal search engine function that is embedded within the product.

Along the past few months, I have had a little problem twice while using Windows Vista. I reformatted the PC and moved obviously all my data across the installation process, .pst files included.

As I did in the past, a simple copy to remote PC should be the only thing needed; but unfortunately starting from that moment, all my past e-mail and contacts seemed to not exist anymore when queried from the search toolbar. This was happening only for older elements, not the more recent ones.

At a certain point, I compared Outlook 2007 installed on Vista, and the same version installed on Windows XP. On the second there was a menu item missing (the one represented in the figure).

So I realized that the search query uses the indexing option built-in into the OS and that all the e-mail wasn’t correctly indexed. However, a button to start to reindex the e-mail inside Outlook wasn’t available. I was misled because of the previously mentioned menu item. In fact the “instant search” and “indexing status” button was suggesting me that, also by pressing the “indexing status” item, it always told me that no documents needed to be indexed.

Finally I realized that, just because the pst file wasn’t a new file - but a simple copy - the OS indexer didn’t correctly index it (or didn’t index at all).Windows Vista Control Panel

I then  entered into the control panel, “System and Maintenance”, then “Indexing Option”. The pop-up window appeared and I pressed the “Rebuild” button, into the “Troubleshooting” group.

At that point, a full reindex of all my hard disk has started again, and at the same time a reindex of the pst too.

Going back to the Outlook interface, I noticed that querying for an e-mail (rather than a contact) a tag line advised me that not all possible messages could return due to the re-indexing in progress (See picture below).

I left the text into the search box, and meanwhile the indexing process was going ahead, all the past e-mail start to appear. I finally pulled a sigh of relief, because it could not seek more in the old e-mail was indeed a problem.

Outlook 2007 index in progress

Technorati tags: Outlook 2007Vista, E-mail

Qualcosa di me

Mi chiamo Andrea Moro, sono un appassionato di informatica da quando avevo 8 anni e da quando mio padre mi regalò il C64.

Qualche anno più tardi, il mio primo pc e nel 1994 la prima esperienza con Internet, di cui mi sono subito innamorato e con cui oggi mando avanti la mia attività di Web Designing e posizionamento nei motori di ricerca.

Andrea Moro's profile on LinkedIn

Profilo Facebook di Andrea Moro


Sponsors


Google Friend