Stop BackSpace key from going back in IE and Firefox

While using AJAX some users would press the backspace button on their keyboard and the browser would go back so they would loose what they where doing in the ajax refreshed page ..... the SOLUTION (keep reading):

Add SVN Revision Macro for Visual Studio 2005/2008

Objetive:
*Update automatically the revision number in the web.config file of a website in my project.
(I wanted to show the users looking at the remote server the revision they are looking at)
Environment
* SVN installed in my local (c:\svn)
* Remote Windows Server that updates the trunk every X minutes
* Make sure your web.config has a section like: (inside the configuration branch)

<appSettings>
  <add key="version" value="1.2." />
  <add key="revision" value="138" />
</appSettings>

Solutions:
I created two macros.... one for adding the revision number on demand (selected project and press of a button) and the other one will write it every time the build command is called.
for the macro code click Read more....

Ajax ControlToolKit and Firefox default button PostBack - Server Click Event

Symptoms:
Default button not does not fire when enter key is pressed using Firefox. (using the ajax ControlToolkit)
Fix:
add this property to the ASP button

UseSubmitBehavior="False"

So it looks like:
<asp:Button ID="btnSearch" UseSubmitBehavior="False" ValidationGroup="submit" runat="server" Text="Search"    CssClass="submitButton" OnClick="btnSearch_Click" />

"The problem wasn't that it didn't do a postback. That it did. What it didn't do was hit the server side event (the button click event)."

Regular expression validate name asp.net using RegularExpressionValidator

this will allow names like:
Jon Doe ---- Jørn ---- Mc'Neelan
match names and dis-allow any attempts to send evil characters. In particular, it tries to allow non-english names by allowing unicode characters.
^([ \u00c0-\u01ffa-zA-Z'])+$
example of use:

<asp:RegularExpressionValidator  ValidationGroup="submit" ID="revLName" runat="server" meta:resourceKey="revLName"
ErrorMessage="invalid name" ControlToValidate="txtLName" Display="None" ValidationExpression="^([ \u00c0-\u01ffa-zA-Z'])+$"></asp:RegularExpressionValidator>

How to populate DropDownList ASP .net with EntitySpaces in code behind

this is how to populate a dropdown ASP.net 3.5 control with entity spaces in code behind
c#: (Item is tha name of my entity)

           ItemCollection i = new ItemCollection();
            i.LoadAll();
            this.ddlItemType.DataSource = i;
            this.ddlItemType.DataTextField = ItemMetadata.PropertyNames.Description;
            this.ddlItemType.DataValueField = ItemMetadata.PropertyNames.ItemTypeID;
            this.ddlItemType.DataBind();

if you add this after the databind it will add a list item at index zero (pre-selected)
  ListItem li = new ListItem("select one ", "");
  this.ddlItemType.Items.Insert(0,li);

How to Use Page Methods with visual Studio 2008

to Use PageMethods for Vs 2005 with visual studion 2008
pageMethods website: http://metasapiens.com/PageMethods/
all you need to do is apply this registry entry after installing Page Methods for 2005.

Resource Localization asp.net of pages and custom controls in subfolders

If you need to localize asp pages or custom controls that are located in subfolders you will need multiple App_LocalResources folder.....
So Create a App_LocalResources folder inside each sub-folder of your webproject where pages are accessed. And put the proper file translations inside of it.

Cpanel mysql5 and php5 how to

I updated today to mysql5 and php5 .. and I ran into one problem.... the sql server would not start
after installing I was getting:
Starting MySQLCouldn't find MySQL manager or server [FAILED]
.....
1st! how to install mysql5 and php5 with cpanel (with out having cpanel downgrade you automatically)
(read below)

how to: drupal Garland theme and Flatforum problem fix

After following all the instructions in the readme of the flatforum things didn't look good at all... and there were problems.... So I made some changes which are below....
(example of patched flatforum in use)
I used a different CSS.
I used a different node-forum.tpl.php
Also I changed the way flatforum checks if is a forum or not.. the one that came with flatforum I think it was messing up the colors on the forum if you used a custom one ... this is the patch works against drupal 5.1 (there is no more _is_forum() )
at the bottom you can download all the files in case you want to make it exactly as this forum
Instructions for the download file:
1. put the forum.css in the /modules/flatforum/ folder
2. put the node-forum.tpl.php in the /themes/garland/ folder
3. now have a choice:
* you can use the ff.patch file to patch the /themes/garland/template.php
or
* replace the /themes/garland/template.php file with the template.php provided

EasyObject C# ASP.Net 2.0 GridView and AJAX template

I created a new template that uses ajax for inline edit and required validation on the client side..
generates an aspx page derived from a Master Page of your choice and the CodeFile (codebehind file)
it puts inline calendars for datetime editing...
check it out:
EasyObject C# ASP.Net 2.0 GridView and AJAX

Syndicate content