My team members were asking me about how come their files can't be modified and etc even if it is a duplicated local copy. I tried it out and realized it is indeed not working as told. My finding was that the TFS has a tight control on the versioning of the file, even if the files are offline or those files are duplicate copies of the original files, the TFS control still present in every aspects of the actions you want to do onto those files.
So, it seems like there need to have an official declaration to inform Visual Studio that the project files are out of the TFS radar. After some internet searches and trials, it seems like to "permanently" detach project file from TFS are not so straightforward and not properly documented too. It requires some kind of hacking seems.
Below are the steps required after the files get copied out from the TFS.
1. Change all the files from readonly to non-readonly.
2. Remove your local workspace from the Visual Studio.
Go to menu item - Source Control Explorer -> Workspaces -> (Select your workspace) -> Edit -> Remove Working Folder that you do not need it to associate with TFS.
3. Use a notepad to edit the *.sln (solution file) with the following text.
Add the following lines before the EndGlobal.
GlobalSection(ExtensibilityGlobals) = postSolution
IsWCSFSolution = True
RootNamespace = "YourDefaultNamespace"
EndGlobalSection
EndGlobal
4. Once it is done, save the sln file and then reopen the solution file with Visual Studio.
5. Visual Studio would prompt to ask if you need to remove any association with TFS. Select yes. There are other prompts follow too, just click ok or yes.
6. Once that is done. You should be able to do what ever stuff you want without the TFS interference anymore.
Semut's References
Monday, March 05, 2012
Thursday, February 02, 2012
Spam Messages and Messenger Software in Mobile Devices. And How to Remove the Spammer
Many people are using their mobile devices to communicate nowadays. Messenger, facebook, SMS and etc in one device. And to serve the users needs, most mobile devices will come equip with multi-protocol messenger built in or free to download and install. However, because these free multi-procotol messenger software are not the de facto owner of these messenging protocol like GTalk or MSN messenger. They lack of proper update in term of protocol support and vulnerability fixe that big corp like Microsoft can offer. Because of that, spammer and malware are taking advantages of this and exploiting these loopholes. Thus, many mobile devices user are getting scam, junk messages from their mobile devices messengers.
Recently, i have just removed a long time MSN messenger spam+bot contact of mine that has Artifical Inteligent that can prevent typical messenger contact removal from mobile phone. Logon to latest version of PC Microsoft Windows Live. Then click - Tools - Options - Privacy - Block the contact. Select no for any invites that pop up later sent by the bot contact. That is the AI and trick of the bot contact to try to stay in the contact list. Most software/freeware will fail to remove the contact because these invites are invisble in most software other than genuine MS Live Messenger. Spammers or malwares are exploiting the loopholes of those software.Block list is centralized, so, you remove it in MSN Live PC would remove it in mobile devices or other multi-protocol messenger like Miranda/Pidgin later.
I believe there are more of these kind of exploits going on in the internet/mobile internet to be precise nowadays. Open source software economy has a common weakness which is getting proper support. Proprietary software company on the other hand has the obligation to help to fix and support.
Recently, i have just removed a long time MSN messenger spam+bot contact of mine that has Artifical Inteligent that can prevent typical messenger contact removal from mobile phone. Logon to latest version of PC Microsoft Windows Live. Then click - Tools - Options - Privacy - Block the contact. Select no for any invites that pop up later sent by the bot contact. That is the AI and trick of the bot contact to try to stay in the contact list. Most software/freeware will fail to remove the contact because these invites are invisble in most software other than genuine MS Live Messenger. Spammers or malwares are exploiting the loopholes of those software.Block list is centralized, so, you remove it in MSN Live PC would remove it in mobile devices or other multi-protocol messenger like Miranda/Pidgin later.
I believe there are more of these kind of exploits going on in the internet/mobile internet to be precise nowadays. Open source software economy has a common weakness which is getting proper support. Proprietary software company on the other hand has the obligation to help to fix and support.
Sunday, April 10, 2011
Disable Nokia On Screen Keypad for the applications by editing JAR (j2ME) manifest file without having to repacking or make use of programming tools
I have a phone that runs on Symbian S60v5. The phone is a cool phone as I can use it for GPS navigation, decent camera, ergonomic (no awkward function/design like some other phones i have used before that put me off. Design and function make sense to me, no impractical but just down to earth.), sturdy , stable signal reception and good call quality.
However, like any phone OSes, there are always bugs in it and Symbian makes no exception. And of all bugs in Symbian S60v5, there is one particular bug in the Symbian that really annoys me. It is this Java Suite Setting that sits inside the Installed App menu (Symbian Application Manager). The Installed Applications has a memory constraint bug that it cannot load up if there are too many applications/games installed into your phone. Especially if you have upgraded your memory card.
When the Installed App could not load up. There is no way that you can change the Java Suite Settings of your Java application/game.
What is in the Java Suite Settings? You can turn off the on screen keypad and the default orientation of the application in it.
And without that, I need to live with games/application with a redundant ugly on screen keypad which I do not need knowing my phone is touch screen and those games/application support touch screen. On screen keypad is only needed if the applications/games required keypad to operate but not in this case.
I google quite a bit but the working solution that people proposed is to reduce the number of applications/games in your phone. This is not a solution because I need those applications/games.
So, how do i overcome the problem.
Edit the J2ME jar file before you install it to your phone. And it is not difficult too.
1. Download and install WinRAR.
2. Download the Jar file of your application.
3. Open the JAR file using WinRAR
4. Locate the manifest file. Normally in META-INF\MANIFEST.MF
5. Edit the manifest file using Notepad.
Add lines
Nokia-MIDlet-On-Screen-Keypad: no
Nokia-MIDlet-App-Orientation: portrait
or
Nokia-MIDlet-App-Orientation: landscape
6. Save and exit the notepad and WinRAR would prompt if you would want to update your archive. Select Yes.
That's all you need to do. Install the JAR again and you would find that the on screen keypad is gone and orientation default has been changed for your application/game.
However, like any phone OSes, there are always bugs in it and Symbian makes no exception. And of all bugs in Symbian S60v5, there is one particular bug in the Symbian that really annoys me. It is this Java Suite Setting that sits inside the Installed App menu (Symbian Application Manager). The Installed Applications has a memory constraint bug that it cannot load up if there are too many applications/games installed into your phone. Especially if you have upgraded your memory card.
When the Installed App could not load up. There is no way that you can change the Java Suite Settings of your Java application/game.
What is in the Java Suite Settings? You can turn off the on screen keypad and the default orientation of the application in it.
And without that, I need to live with games/application with a redundant ugly on screen keypad which I do not need knowing my phone is touch screen and those games/application support touch screen. On screen keypad is only needed if the applications/games required keypad to operate but not in this case.
I google quite a bit but the working solution that people proposed is to reduce the number of applications/games in your phone. This is not a solution because I need those applications/games.
So, how do i overcome the problem.
Edit the J2ME jar file before you install it to your phone. And it is not difficult too.
1. Download and install WinRAR.
2. Download the Jar file of your application.
3. Open the JAR file using WinRAR
4. Locate the manifest file. Normally in META-INF\MANIFEST.MF
5. Edit the manifest file using Notepad.
Add lines
Nokia-MIDlet-On-Screen-Keypad: no
Nokia-MIDlet-App-Orientation: portrait
or
Nokia-MIDlet-App-Orientation: landscape
6. Save and exit the notepad and WinRAR would prompt if you would want to update your archive. Select Yes.
That's all you need to do. Install the JAR again and you would find that the on screen keypad is gone and orientation default has been changed for your application/game.
Friday, January 21, 2011
Dos Prompt - Batch file programming - Preparing executables for deployment(more straightforward way)
All I want to do is to get a set of binaries from projects in solution file (.NET win application) in the debug/release folder and put into one target folder so then I can quickly deploy into staging environment for testing.
I do not want to create the setup packages because I want to retain the pdb files in it (for debug version). I know this can be done using the package setup too and also some well build automation script to include debug database but too much of hassle and I want to do it across many projects. Also, I do not want to purchase another tool for simple stuff like this. All I want is a generic script for all kind of the projects.
So, here, I come out with a batch file
There are some approach in batch programming where a batch will read from another text file (the locations of the project). But i like to put all the location setting to the batch file. Easy to keep track and feel like in control all the time. Too many files to maintain not my preference that all.
Here goes the script.
I do not want to create the setup packages because I want to retain the pdb files in it (for debug version). I know this can be done using the package setup too and also some well build automation script to include debug database but too much of hassle and I want to do it across many projects. Also, I do not want to purchase another tool for simple stuff like this. All I want is a generic script for all kind of the projects.
So, here, I come out with a batch file
There are some approach in batch programming where a batch will read from another text file (the locations of the project). But i like to put all the location setting to the batch file. Easy to keep track and feel like in control all the time. Too many files to maintain not my preference that all.
Here goes the script.
cls
SET SOURCELOCATION="D:\Solution\"
SSET OUTPUTLOCATION="D:\Deployment"
SET FOLDER1=Project1
SET FOLDER2=Project2
SET FOLDER3=Project3
SET FOLDER4=Project4
SET FOLDER5=Project5
@echo off & setLocal EnableDELAYedeXpansion
pushd %SOURCELOCATION%
for /Lfor /L %%i in (1 1 5) do
(
echo.FOLDER%%i is !FOLDER%%i!
pushd !FOLDER%%i!
pushd "bin\Debug"
if not exist *.dll goto ERROR
mkdir %OUTPUTLOCATION%\!FOLDER%%i!
xcopy xcopy *.* %OUTPUTLOCATION%\!FOLDER%%i!
popd
popd
)
:QUIT echo Done EXIT /B 1
:ERROR echo Error occurredEXIT /B 1
Sunday, January 16, 2011
Microsoft XPS Viewer would not print in Windows 7
I need to delay the print job as there is no printer available for me to print. Therefore, I decided to save it as XPS for the print job and print it later when I am hook up to a printer in the network.
XPS is the format supported in Win 7. It is part of the windows installation.
So, i suppose, no issue would follow even though this would be my first time using the XPS.
Next day, I open the file using the Ms XPS viewer. Yes, it does the job nicely, i can see the print out clearly and it looks exactly like the actual print out. (what am i talking, it "is" the print out.)
Then, ok, it is time to print since i am hooked up to printer.
Click print, says successful. Then, go to the printer, nothing comes out. Try few more times, same thing.
I thought something is wrong with my printer. Try to print other thing. No issue. Only XPS viewer can't print. So, I figured out that it is XPS viewer printing issue.
I then, try to convert to other format like PDF using Paperport or paginated version using Fineprint. Nothing works.
Google it, the only working solution is
http://www.timbarcz.com/blog/HowToPrintXPSDocumentsEasyAs11a1aI233a45.aspx
This guy do not have XPS in Vista or XP where he needs to install the XPS software bottom up. Along the way, he has identify the bug in Ms XPS Viewer. My case is even Ms did install the XPS for me which should have learn from other people comment. Yet, the XPS viewer shipped in Win 7 is still buggy!!! How come no one ever complaint about this loudly? Unless... no one uses this XPS thingy.
I can confirm is XPS viewer bug because the when i print in Paperport or Fineprint.
Those programs would report error or something.
The solution I found based on the blog and some trial and error is
To install PrimoPdf - http://www.primopdf.com/index.aspx. And then print the XPS to the PrimoPdf. The reason why it works is that PrimoPdf is more lax and has additional error correction to the print out that gets send to it. Like this case, XPS viewer send buggy print script to the printer (in our case, the PrimoPdf). PrimoPdf corrects it and make the printing possible.
Good work PrimoPdf, you save the day for a bunch of Ms XPS users.
XPS is the format supported in Win 7. It is part of the windows installation.
So, i suppose, no issue would follow even though this would be my first time using the XPS.
Next day, I open the file using the Ms XPS viewer. Yes, it does the job nicely, i can see the print out clearly and it looks exactly like the actual print out. (what am i talking, it "is" the print out.)
Then, ok, it is time to print since i am hooked up to printer.
Click print, says successful. Then, go to the printer, nothing comes out. Try few more times, same thing.
I thought something is wrong with my printer. Try to print other thing. No issue. Only XPS viewer can't print. So, I figured out that it is XPS viewer printing issue.
I then, try to convert to other format like PDF using Paperport or paginated version using Fineprint. Nothing works.
Google it, the only working solution is
http://www.timbarcz.com/blog/HowToPrintXPSDocumentsEasyAs11a1aI233a45.aspx
This guy do not have XPS in Vista or XP where he needs to install the XPS software bottom up. Along the way, he has identify the bug in Ms XPS Viewer. My case is even Ms did install the XPS for me which should have learn from other people comment. Yet, the XPS viewer shipped in Win 7 is still buggy!!! How come no one ever complaint about this loudly? Unless... no one uses this XPS thingy.
I can confirm is XPS viewer bug because the when i print in Paperport or Fineprint.
Those programs would report error or something.
The solution I found based on the blog and some trial and error is
To install PrimoPdf - http://www.primopdf.com/index.aspx. And then print the XPS to the PrimoPdf. The reason why it works is that PrimoPdf is more lax and has additional error correction to the print out that gets send to it. Like this case, XPS viewer send buggy print script to the printer (in our case, the PrimoPdf). PrimoPdf corrects it and make the printing possible.
Good work PrimoPdf, you save the day for a bunch of Ms XPS users.
Wednesday, December 08, 2010
Resolving SSRS 2008 Deployment and Access Issues
If you are coming from SSRS 2005 background. You would be accustomed to the fact that SSRS is part of SQL server and at the same time, it is a web application in IIS.
So, when you want to configure the report server, you would tinker the IIS and SQL server management studio.
However, once you have upgraded the SSRS to be 2008. You would feel lost at first that all these familiar ways of doing things have changed. So, now, it is no longer depending on IIS seems. It has it's own http.sys.
These are all good as in term of technology improvement and progress but at developer end, it is nothing pleasant but confusion and frustration when trying to troubleshoot the problem developers encounter, especially for experienced SSRS developers. They suddenly have turned into rookies. Ok, to help those experienced developers out there. This is my take to experienced guys as this is what i have been through too.
First thing first, you have to accept the fact that technology advance quicker than you thought, don't obsess to the old way of doing things. (This is a digression, just for laugh, don't take it seriously...:)).
Ok, the real deal is there are few new places that you need to check on. So quit those old habits and check items below.
1. Reporting Services Configuration Manager.
2. The familiar http://(YourServer)/Reports (report manager)
3. SQL Server Management Studio
4. C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer\rsreportserver.config
5. Checking status of URL for http.sys
6. Folder permission for virtual directory.
7. Visual Studio Project Setting.
8. The Run As Administrator permission when running the Internet Explorer.
Reporting Services Configuration Manager
----------------------------------------
Reporting Services Configuration Manager is a new dedicated configuration program to configure everything that you used to do in IIS in the past.
The common problem that you would face if you are using it in your own testing machine is that you can't connect to ReportManager URL using your browser. No matter what you do, you tweak your permission and etc. Out of many solutions that i have tried. (If i am positively sure i install everything correctly). The commonest problem would be the SSRS is trying to use SSL as the main connection to the report manager. May be someone would be needing that in the production server but not for developer. So, first thing, remove the Multiple SSL identities for Report Manager. iPV4 or iPV6. It should solve the report manager not being able to connect problem.
http://(YourServer)/Reports (report manager)
--------------------------------------------
This is the same old report manager but now, it has more in it. You have to assign windows login / domain user the permission to each of the folder . Especially the root. You need it for deploying using your IDE or report builder. You need to ensure roles below get assign to the Windows Login you use in your IDE/report builder.
- Browser
- Content Manager
- My Reports
- Publisher
- Report Builder.
SQL Server Management Studio
-----------------------------
This is the same as before, but one thing most commonly neglect in here is the user permission to the database schema. Report server still uses database and it has it own database schema. Make sure the ReportServer database has your user login configured in it.
C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer\rsreportserver.config
--------------------------------------------
This is the most obscure setting among all. It got me stuck for hours. Basically, the commonest issue is that the SSRS installer is being thoughtful to help to harden the security of the connection which most developers do not need.
Look for
<Add Key="SecureConnectionLevel" Value="2"/>
Change the value to be 0.
Status of URL for http.sys
-------------------------
If you are not using the default URL/virtual directory. You need to check this
Run
netsh http show urlacl
and compare it to C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer\rsreportserver.config
if the setting matches the one running in http.sys
Delete the unwanted URL reservations:
netsh http delete urlacl [INSERT RESERVED URL HERE]
Permission for virtual folder
--------------------------
I don't recall i have seen the virtual folder for the report server. IN fact, there is no virtual folder etc anymore, everything is stored in database now. So, don't bother to crack your head to look for it and suspect it is folder permission problem.
However, there aresome places that you need to set the permission.
http://(yourmachine)/Reports or http://(yourmachine)/ReportServer (which ever work)
Run your IE with admin rights and then in site settings click security and in the setting, set it to admin for the user login.
After this, set this to folder as well . Click Home and then properties of each and set the credential you need.
Visual Studio Project Setting
-------------------------
Ensure the targetURL is "http://ServerName/ReportServer" and NOT http://ServerName/Reports".
I think that is all required for seasoned SSRS 2005 developer should they get stuck with SSRS 2008. Other problems beside above would stuff like firewall, incomplete installation, sharepoint (if it is to be used with sharepoint) and internet browser security setting which is not covered here.
The Run As Administrator permission when running the Internet Explorer
------------------
One of the security improvement in Windows (so called improvement) is that whenever you want to perform any system related action in your application, you need to run the application as Administrator. Especially if you have Vista or Windows 7, menial stuff also you would need to ensure you run it as System Administrator eventhough your login to windows is already an Administrator. A few layers of confirmation check by Microsoft. (Kinda like, are you sure? are you really really sure?) This itself would affect the SSRS 2008 when you want to run the report manager. Find it hard to believe but if you do not run your Internet Explorer as Administrator, you get permission denied prompt. Many people would not expect this and I always forget about this. Must run as Administrator.
So, when you want to configure the report server, you would tinker the IIS and SQL server management studio.
However, once you have upgraded the SSRS to be 2008. You would feel lost at first that all these familiar ways of doing things have changed. So, now, it is no longer depending on IIS seems. It has it's own http.sys.
These are all good as in term of technology improvement and progress but at developer end, it is nothing pleasant but confusion and frustration when trying to troubleshoot the problem developers encounter, especially for experienced SSRS developers. They suddenly have turned into rookies. Ok, to help those experienced developers out there. This is my take to experienced guys as this is what i have been through too.
First thing first, you have to accept the fact that technology advance quicker than you thought, don't obsess to the old way of doing things. (This is a digression, just for laugh, don't take it seriously...:)).
Ok, the real deal is there are few new places that you need to check on. So quit those old habits and check items below.
1. Reporting Services Configuration Manager.
2. The familiar http://(YourServer)/Reports (report manager)
3. SQL Server Management Studio
4. C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer\rsreportserver.config
5. Checking status of URL for http.sys
6. Folder permission for virtual directory.
7. Visual Studio Project Setting.
8. The Run As Administrator permission when running the Internet Explorer.
Reporting Services Configuration Manager
----------------------------------------
Reporting Services Configuration Manager is a new dedicated configuration program to configure everything that you used to do in IIS in the past.
The common problem that you would face if you are using it in your own testing machine is that you can't connect to ReportManager URL using your browser. No matter what you do, you tweak your permission and etc. Out of many solutions that i have tried. (If i am positively sure i install everything correctly). The commonest problem would be the SSRS is trying to use SSL as the main connection to the report manager. May be someone would be needing that in the production server but not for developer. So, first thing, remove the Multiple SSL identities for Report Manager. iPV4 or iPV6. It should solve the report manager not being able to connect problem.
http://(YourServer)/Reports (report manager)
--------------------------------------------
This is the same old report manager but now, it has more in it. You have to assign windows login / domain user the permission to each of the folder . Especially the root. You need it for deploying using your IDE or report builder. You need to ensure roles below get assign to the Windows Login you use in your IDE/report builder.
- Browser
- Content Manager
- My Reports
- Publisher
- Report Builder.
SQL Server Management Studio
-----------------------------
This is the same as before, but one thing most commonly neglect in here is the user permission to the database schema. Report server still uses database and it has it own database schema. Make sure the ReportServer database has your user login configured in it.
C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer\rsreportserver.config
--------------------------------------------
This is the most obscure setting among all. It got me stuck for hours. Basically, the commonest issue is that the SSRS installer is being thoughtful to help to harden the security of the connection which most developers do not need.
Look for
<Add Key="SecureConnectionLevel" Value="2"/>
Change the value to be 0.
Status of URL for http.sys
-------------------------
If you are not using the default URL/virtual directory. You need to check this
Run
netsh http show urlacl
and compare it to C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer\rsreportserver.config
if the setting matches the one running in http.sys
Delete the unwanted URL reservations:
netsh http delete urlacl [INSERT RESERVED URL HERE]
Permission for virtual folder
--------------------------
I don't recall i have seen the virtual folder for the report server. IN fact, there is no virtual folder etc anymore, everything is stored in database now. So, don't bother to crack your head to look for it and suspect it is folder permission problem.
However, there aresome places that you need to set the permission.
http://(yourmachine)/Reports or http://(yourmachine)/ReportServer (which ever work)
Run your IE with admin rights and then in site settings click security and in the setting, set it to admin for the user login.
After this, set this to folder as well . Click Home and then properties of each and set the credential you need.
Visual Studio Project Setting
-------------------------
Ensure the targetURL is "http://ServerName/ReportServer" and NOT http://ServerName/Reports".
I think that is all required for seasoned SSRS 2005 developer should they get stuck with SSRS 2008. Other problems beside above would stuff like firewall, incomplete installation, sharepoint (if it is to be used with sharepoint) and internet browser security setting which is not covered here.
The Run As Administrator permission when running the Internet Explorer
------------------
One of the security improvement in Windows (so called improvement) is that whenever you want to perform any system related action in your application, you need to run the application as Administrator. Especially if you have Vista or Windows 7, menial stuff also you would need to ensure you run it as System Administrator eventhough your login to windows is already an Administrator. A few layers of confirmation check by Microsoft. (Kinda like, are you sure? are you really really sure?) This itself would affect the SSRS 2008 when you want to run the report manager. Find it hard to believe but if you do not run your Internet Explorer as Administrator, you get permission denied prompt. Many people would not expect this and I always forget about this. Must run as Administrator.
Monday, July 26, 2010
Roadblocks utilizing ASP.NET 3.5 and ASP.NET AJAX - part 2
This is a continuation of the previous post. (http://anthony-yio.blogspot.com/2010/03/roadblocks-utilizing-aspnet-35-and.html)
ASP.NET Dropdownlist with tooltip
Problem: Although it might occur to everyone that dropdownlist when the text in it is too lengthy, there should have some tooltip to show the text in the dropdownlist like "any" combobox in Windows. But to your surprise, this feature does not come for free on ASP.NET 1.1, 2.0, 3.0, 3.5 or may be even 4.0.
Resolution:
(quote from - http://forums.asp.net/p/903935/994720.aspx)
I have search many solutions, some used JQuery, some use CSS and etc. But i do not like to mess around too much with the CSS and Javascript/JQuery for this sort of thing since i am doing MVP+Controller model. A little or non scripting is preferred.
Therefore, it is to add the title attribute to the item
Add a ondatabound="ApplyOptionTitles" event to your DropDownList control.
Then implement in code-behind (C#) as follows:
protected void ApplyOptionTitles(object sender, EventArgs e)
{
DropDownList ddl = sender as DropDownList;
if (ddl != null)
{
foreach (ListItem item in ddl.Items)
{
item.Attributes["title"] = item.Text;
}
}
}
Data bound controls
Problem: There is no dedicated function to refresh the content of the AJAX controls that bound to data source suppose if you have updated the records in the database. The only way is to reload the page which defeat the purpose of having AJAX.
Resolution: The original thought is to call databind or rebind function but it does not work. (Wonder what the use of having those functions then? Basically, it would check if there is any changes to data source "name", or else calling those functions do nothing.. duh...)
So, the workaround are below
1. Datasource set to null programmically and then call databind() and then set the datasource back to the original one and call databind() - Which look like a mess.
2. If you have control parameters or session parameters. Just reset those value like set to null and back to original value. This would work even on AJAX. - The slightly better way...
ASP.NET Dropdownlist with tooltip
Problem: Although it might occur to everyone that dropdownlist when the text in it is too lengthy, there should have some tooltip to show the text in the dropdownlist like "any" combobox in Windows. But to your surprise, this feature does not come for free on ASP.NET 1.1, 2.0, 3.0, 3.5 or may be even 4.0.
Resolution:
(quote from - http://forums.asp.net/p/903935/994720.aspx)
I have search many solutions, some used JQuery, some use CSS and etc. But i do not like to mess around too much with the CSS and Javascript/JQuery for this sort of thing since i am doing MVP+Controller model. A little or non scripting is preferred.
Therefore, it is to add the title attribute to the item
Add a ondatabound="ApplyOptionTitles" event to your DropDownList control.
Then implement in code-behind (C#) as follows:
protected void ApplyOptionTitles(object sender, EventArgs e)
{
DropDownList ddl = sender as DropDownList;
if (ddl != null)
{
foreach (ListItem item in ddl.Items)
{
item.Attributes["title"] = item.Text;
}
}
}
Data bound controls
Problem: There is no dedicated function to refresh the content of the AJAX controls that bound to data source suppose if you have updated the records in the database. The only way is to reload the page which defeat the purpose of having AJAX.
Resolution: The original thought is to call databind or rebind function but it does not work. (Wonder what the use of having those functions then? Basically, it would check if there is any changes to data source "name", or else calling those functions do nothing.. duh...)
So, the workaround are below
1. Datasource set to null programmically and then call databind() and then set the datasource back to the original one and call databind() - Which look like a mess.
2. If you have control parameters or session parameters. Just reset those value like set to null and back to original value. This would work even on AJAX. - The slightly better way...
Subscribe to:
Posts (Atom)