Skip Dashes While Grabbing Number?

Mar 25, 2011

I have a number of 0-12345-67890 and I want to capture 0123456789 in a named capture group. I got this far:

@"(?<upc>d-d{5}-d{5})"

Which captures the string as-is. How do you skip the dashes while grabbing the number as a single named group? BTW, this is ASP.NET Regex.

View 2 Replies


Similar Messages:

Error While Adding Dynamic Data To An Existing Web Site - The Method 'Skip' Is Only Supported For Sorted Input In LINQ To Entities. The Method 'OrderBy' Must Be Called Before The Method 'Skip'.

Apr 13, 2010

I am creating an Asp.net web site which will support dynamic data. When I am creating a dynamic web site from Scratch (from template in VS) all is working fine. But when I am trying to add dynamic entity (.edmx) file and running the application I am getting following error

"The method 'Skip' is only supported for sorted input in LINQ to Entities. The method 'OrderBy' must be called before the method 'Skip'. "

View 2 Replies

AJAX :: MaskedEditExtender Phone Dashes In Mask

Feb 11, 2010

I just started using the mask control. I have it working exactly the way I want with date but can't get the same behavior with Phone.

<AjaxControlToolkit:MaskedEditExtender
ID="mskTbTicketOpenedDate"
runat="server"
TargetControlID="tbTicketOpenedDate"
Mask="99/99/9999"
MessageValidatorTip="true"
OnFocusCssClass="MaskedEditFocus"
OnInvalidCssClass="MaskedEditError"
MaskType="Date"
ErrorTooltipEnabled="True" />

Date Mask Validator:

<asp:RequiredFieldValidator
ID="rfValTbTicketOpenedDate"
runat="server"
ControlToValidate="tbTicketOpenedDate"
Display="Dynamic"
ErrorMessage="required!<br />" />
<AjaxControlToolkit:MaskedEditValidator
ID="mskValTbTicketOpenedDateInvalid"
runat="server"
ControlExtender="mskTbTicketOpenedDate"
ControlToValidate="tbTicketOpenedDate"
IsValidEmpty="false"
InvalidValueMessage="Date is invalid<br />"
Display="Dynamic" />

Breaking out the required field validation helped me get the date textbox to behave the way I need. Just positioning validation messages and such. Behavior I like here is that TextBox has no mask to start (focus off of textbox). When you put the cursor in the textbox or the textbox gets focus then the mask shows up: __/__/____. As you type the underscore placeholders dissapear but the '/' chars stay in place.

And finally, this is key, when you have a correct date and take the focus away from the text box the dashes stay in place. I just realized that is because the date mask seems to fill in the blank spaces with the current date. I cannot get this behavior with a phone. Granted there is no phone mask type. Here is the phone code:

<AjaxControlToolkit:MaskedEditExtender
ID="mskTbPhone"
runat="server"
TargetControlID="tbPhone"
Mask="999-999-9999"
ClearMaskOnLostFocus="true"
MessageValidatorTip="true"
OnFocusCssClass="MaskedEditFocus"
OnInvalidCssClass="MaskedEditError"
MaskType="None"
ErrorTooltipEnabled="True" />

I have tried MaskType set to number but it doesn't change the behavior. Right now the dashes dissapear when I take the focus off of the phone textbox. One thing I noticed with date is that if it is incomplete when it loses focus it fills in the rest with the current date values. Since there is no Phone mask type that behavior is not built in. Does anyone know how to set a default behavior so if you type in 55 in would automatically finish? 555-55-5555 And when you take the focus off it would keep the dashes. But if the textbox is empty I want with no focus the mask should dissapear completely.

View 3 Replies

MVC2 Not Replacing Underscores With Dashes In HtmlAttributes?

Nov 9, 2010

I've heard from a couple of different sources that when using HTML helpers in ASP.NET MVC2, one can create custom attributes with dashes in them (e.g. <a data-rowId="5">) by using an underscore in place of the dash, and when the HTML is written to the page the underscores will be replaced by dashes.

So, something like this:

<%= HtmlActionLink(Model.Name, "MyView", null, new {data_rowId = Model.id}) %>

should render as

<a data-rowId="0" href="myURL">Row Name</a>

But... it's not. I think that maybe this feature is only enabled in the MVC3 Beta preview (as it's mentioned in the MVC3 preview release notes), but this thread is about the same thing, and it's regarding MVC2.

I know I can use the other solution presented in that thread, but I'd rather not have to resort to using the dictionary if a more elegant solution exists.

View 2 Replies

Web Forms :: >>>Remove Dashes, Hashes, Spaces Populating Dropdown?

Aug 8, 2010

I have been searching the forum for how to populate a dropdown without "spaces" or "-" but I can not find exactly what I am looking for.Actually the data input by the user contains specaial character and using datasource the dropdown is being populated with the original data but every user has different style to insert data so I want to populate dropdown(within forview) without spaces or dashes, hashes. By making this change I may be able to populate dropdown in an asc or desc order.I know it can be handle from database but I want to do it with some coding technique in vb.net or asp.net.

View 11 Replies

Grabbing Variables From URL?

Oct 12, 2010

why I couldn't get the variable from the URL.

<meta property="og:title" content="<% Response.Write(Request.QueryString["title"]); %>"/>

For some reason the code, <% Response.Write(Request.QueryString["title"]); %>, does not retrieve the data in this case. It works fine if I put it in the title tag though.

View 12 Replies

Grabbing Textbox In Javascript?

Jan 18, 2011

<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<script type="text/javascript">
function Incrementer()
{
debugger;
var txtBox = document.getElementById('ctl00_MainContent_TextBox1').value;
[code]...

I am unable to capture the textbox in JavaScript

View 2 Replies

Grabbing .net Controls In Javascript?

Feb 11, 2010

I have a page where it is getting overwhelmed with code like:ar textBox = $get("<%=textState.ClientID%>");This requires me to have my JavaScript inside the page instead of nicely tucked in a js file. Is there a better approach to this?

document.getElementById doesn't work because then I end up with code like this:
var textBox = document.getElementById("originDestinationControl_textState");
var textBox = document.getElementById("ctl00_ContentPlaceHolder_originDestinationControl_textState");

View 4 Replies

SQL Server :: Grabbing The @@IDENTITY?

Mar 30, 2011

So far it seems like I get something figured out then run into another issue... Anyways, I was finally able to grab an ID from a table and enter the value into a Label using this code:

[Code]....

Now i want to make things trickier by grabbing the last value enterd. Now there will possibly be multiple people using the application simultaneously, i think it is still possible to do this. Here is the statement that enters VALUES into the table that generates the CaseID that i want to grab from:

[Code]....

From what i have researched, I may need to do a WHERE some where to grab the @@IDENTITY. I am having trouble figuring out where the @@IDENTITY goes, and possibly the correct syntax as well.

View 1 Replies

Web Forms :: Grabbing Boolean Value Incorrectly?

Feb 26, 2011

I have a registration form which is working perfectly well, I need to enhance it slightly from where it is. As it is users are able to register for an account wether the email has been previously used/allocated in the user db.A client side call to the IsEmailAvailable function works great, just not working correctly server side. Here is the code.

My function:

[Code]....

And my if statement:

[Code]....

So my question is, how can I pass the end value of the IsEmailAvailable function to my if statement correctly.

View 4 Replies

Web Forms :: Grabbing Information From Another Website?

Jan 31, 2011

I'm using asp.net - I need to grab live data from a website. Here's an example:

[URL]

That website provides live data share prices. I need code to retrieve the share price from the website and display it in my own page. I know you can get share price widgets online but all I need is a simple way to retrieve the share price values.

View 5 Replies

Security :: Grabbing UserId From ASPNETDB.MDF?

May 2, 2010

In one of my web app's pages, the code behind needs to grab the UserId of the person logged in, so that it can then be inserted into a table which was added to the original aspnetdb.mdf. This table contains a column with a uniqueidentifier primary key which is in direct relationship with the aspnet_Users table; however I seem to have trouble retrieving the UserId. This table contains the additional information of a user which is not included in the provider, and it has a one-to-one relationship with aspnet_Users.

I hope this makes sense. I haven't written any code for it yet; I'm only at the thinking part of this stage. But my mind keeps going blank.(perhaps I need a break from the solution???).

I am using C# in my Web app's code behind.

View 9 Replies

MVC :: Grabbing ViewData In Master View?

Jun 29, 2010

I created a base Controller for the other Controllers to derrive from, and in that controller I overrode the OnActionExecuting method so that each time any Controller executes a method, I can run some code. In that code I added a value to ViewData, and in the Master View I want to either display certain items or not based on the value of the ViewData item set. The problem is, once I get to the Master View, the ViewData doesn't have anything in it. I am not sure what I'm doing wrong.

View 1 Replies

.net - Grabbing Data From Controls In Code Behind?

Apr 22, 2010

I have a drop down list control that I need to pull the value from in the code behind of the page, modify it and redisplay it. The modifying and redisplaying I've got no problem with, it's grabing the value from the drop down control.

View 1 Replies

Web Forms :: Grabbing String From Stored Procedure

Apr 9, 2010

I am having a bit of trouble pulling from a stored procedure of mine. I want to return a string, for this example I tried to grab the mail address which is a varchar in my database.

View 7 Replies

.NET Grabbing Individual Items For Stored Procedure?

Jan 18, 2011

DataTable siteParams = new DataTable();
using (SqlConnection con = new SqlConnection(conString))
{
using (SqlCommand cmd = new SqlCommand("siteParametersGetAll", con))
using (SqlDataAdapter da = new SqlDataAdapter(cmd))

Now, I want to be able to grab certain rows without using 0,1,2,3

View 1 Replies

Name Or Number Search In Textbox While Entering The First Letter Or Number Charactor Or Number?

Feb 2, 2010

I am using the asp.net and framework 2.0 with Ajax enable web.i have a text box and when user will enter "a" or number in this will search the name started from "a" character or number if he or she enter the number basically we can say live-search.

Employee search: Textbox.In this text box she/he will enter the first character of name or first number of employeeno and according to the a character name will search in list.

View 1 Replies

IF.. ELSE.. END IF, Skip 1 And Go To The Next?

Oct 27, 2010

I have the following:

[Code]....

How can I get the commented part to just look at the one underneath.

View 2 Replies

Forms Data Controls :: Grabbing Cell Value From Selected Gridview Row

Jul 16, 2010

I have a Gridview where some columns are populated with numbers of type nvarchar() and some columns are filled with numbers of type int I am trying to grab the a cell from a selected row that corresponds to a Table's KeyID and assign it to a label like so:

Label1.Text = MyGridview.SelectedRow.Cells(8).Text.ToString

Problem: If the Gridview column 8 has numbers of type nvarchar() it works fine But if column 8 has numbers of type int , it does not work. It's probably simple, but I dont see it.

View 7 Replies

Forms Data Controls :: Grabbing Child GridView Cell Value?

Mar 12, 2010

We have a GridView2 in GridView1 EditTemplate.And we have a button (commandname="Update") on GridView2.When Button1 is clicked GridView1 goes into edit mode and displays GridView2.Now when Button2 is Clicked, we want the cell[0] value of GridView2 to be displayed as Label1 Text on GridView1 and comeout of the GridView1 edit mode.Basically we want to capture gridView2 cell[0] value and display that on Label1 of GridView1.We have written the below code. But we are unsure on how to grab GridView2.cell[0] value and display it as Label1 text.Can someone please assist us with this?Also, we are not sure if we can use rowupdated event for this. Please also guide us which events we should be using to achieve the functionality.

[Code]....

[Code]....

[Code]....

View 2 Replies

How To Add Skip Button To Wizard

Nov 6, 2010

I know how can I skip steps programmatically but I need "Skip" button too.

View 1 Replies

DataSource Controls :: MS SQL Skip First 10 Rows?

Feb 14, 2010

I've got data in a xml document.The xml document is generated by a stored procedure.I like to change the stored procedure so i can skip a lot of rows.The count of rows, i like to add as a Parameter.With a top of 20 i get 20 rows.But after i show the 20 rows there is some kind of paging on de website so the user can put next, and get the next 20 rows.But how can i skip in that case the first 20 rows?, and after that 20 rows, i want the next 20 rows....So i like to add it as a parameter.

But how?With linq its quite easy, but i don't want ms sql resultss the complete rows to the xml file, becasue it would be lots of them (100.000...)

View 2 Replies

SQL Server Select Top N Values But Skip M Results

Apr 7, 2010

I'm working on an ASP.Net project to display information on a website from a database. I want to select the top 10 items from a news table but skip the first Item and I'm having some problem with it.

<asp:SqlDataSource ID="SqlDataSource1"
runat="server" ProviderName="System.Data.SqlClient"
ConnectionString="<%$ ConnectionStrings:ClubSiteDB %>"
[code]....

This is what I have so far but I can't find any info online about how to skip a record

View 3 Replies

ADO.NET :: Codebehind Skip First Row Of Data When Binding To Gridview?

Sep 20, 2010

I'm making the switch from vb.net to c#, and am just trying to bind some data from a reader in my c # codebehind, but no matter what, the gridview always skips the first row returned from my stored procedure. What am I doing wrong?

[Code]....

View 1 Replies

Make Calendar Control Skip Years?

Dec 2, 2010

By default, it seems that the standard Asp.NET calendar control can only scroll on a month-by-month basis (using the back and forward link buttons on the control).Is there a way to customise this control to add paging links which will skip by a year in either direction?

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved