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):
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>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"<asp:Button ID="btnSearch" UseSubmitBehavior="False" ValidationGroup="submit" runat="server" Text="Search" CssClass="submitButton" OnClick="btnSearch_Click" />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>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(); ListItem li = new ListItem("select one ", "");
this.ddlItemType.Items.Insert(0,li);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.
this C# function will convert an comma separated string in to an array of integers
private int[] commaStrToArray(string strIntComma)
{
string [] strArray;
strArray = strIntComma.Split(new char[] {','});
int [] intArray = new int [strArray.Length];
for (int i = 0; i < strArray.Length; i++)
intArray[i] = int.Parse(strArray[i]);
return intArray;
}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)
Adding a referece of Javascript files in Master Pages is a pain. Because the location of Javascript can be in directory, you can simply write this:
<script type="text/javascript" src="../Scripts/some.js /><script type="text/javascript" src='<% = ResolveUrl("~/Scripts/some.js") %>' />