November 2008 - Posts
.Question:
I've got the following control on my aspx page:
<asp:DropDownList ID="favList" runat="server" AutoPostBack="true">
<asp:ListItem Value="" Text="--" />
</asp:DropDownList>
I have three other drop down lists on the page that are working fine. However this one doesn't seem to come up under intellisense when I'm in my code-behind. If I type "favList." ....I get nothing. But I can still programmatically reference the control using
Dim favoritesDropDown As DropDownList =
DirectCast(FindControl("favList"), DropDownList)
I only recently added the control to the page, which has been in existence for some time now...could that have anything to do with it?
Solution:
Try the following steps :
- Switch the page View to design mode this may refresh the designer file and reflect the control in IntelliSense.
- Make sure that the control is not a child of another control.
Hope it helps :)
Source : Can't reference server control in code-behind/intellisense?
Last week I was checking ASP.NET Forums as usual and I had answered a thread about renaming Windows Server 2003 and the impact of this renaming on IIS.
The issue was , after renaming the machine the http://ServerName no longer resolved to the localhost. (Check thread here http://forums.asp.net/t/1350535.aspx)
So here is a small guidelines how to safely renaming the Windows Server 2003 machine name which hosting IIS 6.0
- Make sure you have read HOWTO: Rename the Computer running IIS6 post.
- You may manually map the new ServerName to localhost IP (127.0.0.1) through Windows hosts file located in <Windows Directory>\System32\drivers\etc\hosts
127.0.0.1 localhost
127.0.0.1 serverName
- If you have DNS installed make sure you have corrected DNS entries.
If anyone know other steps or solutions, please feel free comment to this post ... Thanks !
To Schedule a build using TFS 2005 : (From TFSGuide)
- The Team Build feature in TFS does not support scheduled builds from the user interface. Instead, you can use the Microsoft Windows® Task Scheduler to run the TFSBuild command utility to start builds at predetermined time.
- Create a TFSBuild command line.
TfsBuild start <<TeamFoundationServer>> <<TeamProject>> <<BuildTypeName>> - Place the command line in a batch file. Note that you must specify the full path to the TFSBuild.exe file so that it can run from windows command prompt. An example of the command used in the batch file is shown here:
"C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\TFSBuild" start <<TeamFoundationServer>> <<TeamProject>> <<BuildTypeName>> - Create a Windows Scheduled Task that runs the batch file at your desired interval
To Schedule a build using TFS 2008: 
- Navigate to the build definition prosperities and choose edit then select triggers
- Select which days to schedule build on also the time.
- Note :
- Build Dated and times using your system local date and time.
- The build will not if no changes happened since previous build , if you need to build even no changes has been done you have to choose the "Build even if nothing has changed since the previous build" checkbox
Thanks !
If you are using a script manager in your master page in order to share it with all your pages instead of adding a script manager to each page , you need to follow the following steps in order to avoid any further problems:
1- Make sure you have added the script manager tag after opening of Form tag.
2- To access the master page script manager you may use one of those ways :
- Create a public property in your master page which will return the current instance of script manager and use it in your content page.
In your master page .cs file
public ScriptManager rootScriptManager {
get { return matserScriptManager; }
}
In content page
//Sit1 is the master page class name
Site1 site1 = Master as Site1;
//check the script manager property
if(site1.rootScriptManager.IsInAsyncPostBack)
{
//Do something
}
ScriptManager scriptManager =
(ScriptManager)Master.FindControl("matserScriptManager");
if(scriptManager != null && scriptManager.IsInAsyncPostBack)
{
//Do something
}
if(scriptManager != null && scriptManager.IsInAsyncPostBack)
{
//Do something
}
- Another way which is recommended
ScriptManager scriptManager = ScriptManager.GetCurrent(this.Page);
if(scriptManager != null && scriptManager.IsInAsyncPostBack)
{
//Do something
}
Hope it helps :)
One of the new features in ASP.NET 2.0 is the membership and role provider system. This is a nicely designed system that allows the developer to handle the storage of user information pretty much any way he likes, all he has to do is create the appropriate providers and configure his application to use these. While this is very powerful there is something else I was much more interested in and that is the fact that user and role management can be added to an application without having to do any of the implementation work. Now this is very convenient if you don’t already have a user database to work with. Also, if at all possible, I would like to be able to use these providers in my Windows forms applications as well as in my web application. Fortunately this is possible without much work at all! So let’s create a very small console application with user management.
Read the full steps written by Maurice de Beijer here http://www.theproblemsolver.nl/usingthemembershipproviderinwinforms.htm
I was trying to include my ASP.NET MVC project in a TFS team build today but the build failed so I've investigated this issue and thought it will be helpful to share it with the community.
To get the MVC project build successfully with the team build make sure of the following:
- Your build server has the WebApplication targets file located in <Program Files> \MSBuild\Microsoft\Visual Studio\v9.0\WebApplications , if not . copy this file from your development machine to the same path in the build server.
- You have installed ASP.NET MVC framework in the Build server, this is the most important step otherwise you application will not build successfully in the team build you may faces some errors like :
error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
or
Controllers\RuleController.cs(31,10): error CS0246: The type or namespace name 'AcceptVerbs' could not be found (are you missing a using directive or an assembly reference?)
** Update
This will work with Beta version of ASP.NET MVC since the installation register the MVC assembly in GAC.
For preview versions , you can reference the DLL from your build project
<AdditionalReferencePath Include="C:\Program Files\Microsoft ASP.NET\ASP.NET MVC CodePlex Preview 4\Assemblies" />
Thanks !
"
If you are a Server Core fan, and wished you could host ASP.NET websites in Server Core, then feel better, you wish had come true. Windows Server 2008 R2’s Server Core will have .NET Framework which means, ASP.NET too. This is a big news for all those wanted to deploy Server Core, but stopped because .NET Fx wasn’t there in the RTM release.
Windows Server 2008 R2’s blog details this:
“Added the following as optional features: - Subset of .NET Framework 2.0
- Subset of .NET Framework 3.0 and 3.5 – WCF, WF, and LINQ
- Windows PowerShell
- ASP.NET and additional IIS support – the only IIS feature not available in Server Core is the management GUI
- FSRM"
You can read this here too. You can also view the PDC announcement, and few more interesting things here. But, you have to live with appcmd for all IIS configuration changes as there is no GUI IIS manager would be available – after all Server Core fans don’t expect that to be available.
Happy Server Core deployments, wait for the R2 release!
"
via : rakkimk's blog
"
Now you can read the captions in Visual Studio in following languages:
Arabic, Czech, Hebrew, Hindi, Malayalam, Oriya, Polish, Tamil and Turkish.
The Microsoft Captions Language Interface Pack (CLIP) is a simple language translation solution that uses tooltip captions to display translations for English user interface terms.
CLIP is designed for those Visual Studio users who are not very fluent in English. CLIP can help those users learn and use Visual Studio 2008 by providing translation for the most common user interface elements of the Visual Studio Integrated Development Environment (IDE). CLIP is the result of the close collaboration between Microsoft and local academic communities.
To use, simply move your mouse around the screen and halt briefly over any text you want translated. Users can also add their own translations and copy and paste any translation results.
Download CLIP for VS 2008
"
Via : http://dotnetwithme.blogspot.com/2008/11/captions-language-interface-pack-for.html
More Posts