Wednesday, 26 May 2021

 Just to visit back on this post after 13 years and I am suprised this still exists! Hopefully all my friends and visitors to this page a great day ahead!👋👋

Thursday, 21 February 2008

ProfileBase.Save() doesn't save any changes after deployed on server

I have this method to save all the changes to current profile (because I am using Membership security by ASP.net 2 ). you first call

ProfileBase currentProfile = ProfileBase.Create(username);

in a separate class library and then we call ProfileBase.Save() to save the changes we made in the form. This will be all fine when the code is running on my local development server, but once I put it on staging/testing server, this won't save any changes I made. The reason is because Membership will treat this two version as two separate web applications regardless what you specified in provider application name of the web.config file. Users created in one application will still be able to log in in another application, but the profile data for that user won't be shown because it's not the same application. So I do it in webroot level instead of class library, I would be able to get hold of ProfileCommon class and the save method in that works fine on . But still this will just be a imperfect solution for the problem we have. I wonder if there's anything we can do to specify the application name in run time...

Wednesday, 13 February 2008

Update of the site

Because the nature of my job, this blog's title will be mainly about .net c# and asp.net from now on. Hopefully I can have updated content posted soon ! :)

Saturday, 15 December 2007

Christmas Greetings!

It's been a long time since I posted last time... The job is slowly taking over life and of course including blogging :) I will keep posting as soon as I got a chance from work. In the mean time, Hope everyone who sees this post a very happy christmas!


Just reminded by the IrnBru ads, here is the link for Ramond Briggs Snowman :) Enjoy!

Wednesday, 26 September 2007

Infopath Development Tips 1 - Infopath repeating table manipulation

Infopath forms are the essential part of sharepoint workflow development. Repeating table is also very tempting because it can solve many UI problems when presenting group of data. So the problem is , how do we populate repeating table from the data we have. It's easy. AppendChild method of DOM using managed code and Infopath's powerful conditional formatting.
1. First thing first, let's specify the conditional formatting for repeating table. right click the table, then properties->conditional formatting-> add. Then you can specify when the value of element of table, say , text box is blank, tick "hide this control". This will make sure your table doesn't show extra blank row when inserting the rows. We will see why we might need to hide this row later on.

2. Secondly, we need to use a little code behind to populate the table we have in the IP form. Say the name of the table we have is called docList and the collection of data we have is docArray. so the code will be



//repeating table

relDocListTable = mainRoot.SelectSingleNode("/my:myFields/my:docList", this.NamespaceManager);


//repeating table row
relDocListRow = mainRoot.SelectSingleNode("/my:myFields/my:docList/my:docItem", this.NamespaceManager);

for (int index = 0; index < newrow =" relDocListRow.Clone();" innerxml =" docNameArr[index];">