C#: Is numeric

Posted by Unknown On Friday, July 31, 2015 0 comments
C# code

Regex.IsMatch(ddlCustomer.SelectedValue, @"^\d+$")


JavaScript: client side event on RadioButtonList

Posted by Unknown On Thursday, July 16, 2015 0 comments
ASP.NET Code

       <asp:RadioButtonList runat="server" ID="radReportType" onchange="displayReportType();" RepeatDirection="Horizontal">
           <asp:ListItem Text="Shipment" Value="Fruit" Selected="True">
           <asp:ListItem Text="Customer" Value="Vegetable">
           <asp:ListItem Text="Carrier" Value="Meat">
       </asp:RadioButtonList>

jQuery

   var radio = $("[id*=radFruits] input:checked");
   var value = radio.val();

JQuery: Get Selected Value from RadioButtonList

Posted by Unknown On Wednesday, July 15, 2015 0 comments
Asp.net Code

  <asp:RadioButtonList ID="radFruits" runat="server">
     <asp:ListItem Text="Mango" Value="1" />
     <asp:ListItem Text="Apple" Selected="True" Value="2" />
     <asp:ListItem Text="Banana" Value="3" />
     <asp:ListItem Text="Guava" Value="4" />
  </asp:RadioButtonList>

JQuery

   var radio = $("[id*=radFruits] input:checked");
   var value = radio.val();

C#: Get text between two strings

Posted by Unknown On Friday, July 10, 2015 0 comments
String between two Strings

string input = "Exemple of value between two string FirstString text I want to keep SecondString end of my string";
var match = Regex.Match(input, @"FirstString (.+?) SecondString ").Groups[1].Value;
All Number between two Strings

string input = "Exemple of value between two string FirstString 1234 I want to keep SecondString end of my string";
var match = Regex.Match(input, @"FirstString (\d*) SecondString ").Groups[1].Value;