Community Blogs

Browse by Tags

Related Posts

  • How To Embedded StyleSheet File with Custom Control.

    How to embedded StyleSheet file with custom control? Question has been opened many time on ASP.NET forum. So in this article, I will try to demonstrate how to achieve this task. In General In general, if you want to embedded any thing with custom control, you need first to make its "Build Action" property to be "Embedded Resource", and then you need to add to the custom control assemblies using the <Assembly> attribute typically above class name, and finally you need to register in the page so it can be rendered. I will illustrate all these things in details through the article. Step One: make it as Embedded Resource After you added the StyleSheet file to your Custom Control Class Library project, first thing you need...


  • How to fix this .. The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

    Sometimes when you write inline code inside Javascript tag or inside style sheet tag within the header of the page just like code 1 , the yellow error page will explode in your face telling you that The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). Code 1 Normal 0 false false false EN-US X-NONE AR-SA MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso...


  • RadioButton inside GridView, How to get it work as normal.

    As we all know, RadioButton control used in a situation when you want end-users to select only one option at a time from group of options. Did you tried before to drag a RadioButton control inside a Gridivew templatefield, and then you attempt to select these RadioButtons , you will notice that the behavior of RadioButton control will be changed and it will work just like the behavior of checkbox control! the user will be able to select more than one radiobutton in the grid! O.k you can use html radiobutton element instead of server radiobutton control in the templatefield, this will do the trick and the behavior will get back again, but what if you want to do some event in codebeind and collect the selected Radiobutton?! this time you need...


  • Displaying Arabic Number.

    Well, most applications that I worked with was multilingual that supports English UI and Arabic UI. And one of the major issue that we have faced is displaying Arabic numbers without the need of changing the regional settings of the PC. So the code below will help you to display Arabic number without changing any regional settings. Code 1: the HTML code: < form id ="form1" runat ="server"> < asp : TextBox ID ="TextBox1" runat ="server"></ asp : TextBox > < br /> < asp : Label ID ="Label1" runat ="server"></ asp : Label > < br /> < asp : Button ID ="Button1" runat ="server" Text ="Convert to Arabic" /> <...


  • Adding ToolTip for each List Item.

    In Some cases, you have a restricted design that forces you to place a DropDownList control inside a "td" or "div" element, which has a fixed width. if that DropDownList contains long pieces of text then the user will not be able to read the whole text as you can see in Figure1. Figure 1 The best solution to overcome this problem is to add a ToolTip for the item to display the whole text. As we know the regular DropDownList does not support that which is the main goal of this post. Lest us say that we have a DropDownList that contains three list items. Code 1 Normal 0 false false false MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size...


  • VS Debug Problem with IE8

    Normal 0 false false false MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} Since this is my first post on Weblogs, I decide to write about a problem that has been opened frequently on ASP.NET official forum which is VS debugger crashes with IE8. I had answered the same problem 4 times, so I hope that some one will found...


  • C# Dynamic Function Factory

    The functional programming features of the latest versions of C# allow developers to harness a very expressive programming paradigm to solve challenges in new, elegant ways. Two of the very interesting new features are the “Func<>” delegate and the Lamda expression. A Lamda expression is a simple expression that is interpreted by the compiler as either a delegate or an expression tree, depending on the Type called for in the given context. You see them used often in LINQ. For example: 1: var bostonPeople = people.Where( p => p.City == "Boston" ); .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*...


  • ASP.NET MVC 1.0 Release Candidate now available in Web Platform Installer

    ASP.NET MVC 1.0 RC can now be installed with Web Platform Installer: http://www.microsoft.com/web/channel/products/WebPlatformInstaller.aspx Here is a quick description of Web Platform Installer from the Web Platform Installer website: “The Web Platform Read More......( read more ) Read More...


  • Data Controls 101

    I’ve worked with asp.net a bit at school before I came to Microsoft. Being the “data dev” as you would imagine, I get lots of bugs that have to do with the data (datasource/databound) controls. I also scan the internal and external forums and try to help customers find solutions to their problems. This blog post is the first of a series on common scenarios using data controls, that I call Data Controls 101. When new developers come to asp.net from other web technologies/backgrounds the tendency is to continue doing things as they did before, when in fact they should learn the paradigms we expect in asp.net webforms (mvc is kind of different). These posts will be scenario driven with tidbits of information here and there. Let’s start with a simplest...


  • Troubleshooting ASP.NET MVC Routing

    One thing I absolutely love about the ASP.NET MVC framework is that there isn't too much "magic". Magic can be nice if you are able to adhere to a framework's "Golden Path", but as soon as some customization becomes necessary you find that the magic can get in the way (DataContractSerializer anyone?). One of the places in the ASP.NET MVC framework (and now part of .NET SP1) where magic is happening is routing. Routing takes a url, looks for the best fit from the pre-defined list of routes, breaks it up into parameters and feeds the whole thing to a handler. Pretty sweet, but if you have done something wrong it'll be tough to tell since all that is happening behind the scenes. I've created a personal checklist...


Page 1 of 11 (102 items) 1 2 3 4 5 Next > ... Last »
Microsoft Communities