Web Forms :: Displays The First 9 Digits Of A GUID?
Apr 26, 2010
In the following question, I am using C# and ASP.NET 3.5:I am having a problem with a gift certificate program which requires a way to have the user retrieve a unique validation code consisting of the first 9 digits of a random GUID and the date and time. I have a page that has a button which creates these labels perfectly, but I can't figure out how to bind them to the certificate being validated This is the page described above:
[Code]....
I am open to calling another page called via a hyperlink like so:
In the following question, I am using C# and ASP.NET 3.5:
I am having a problem with a gift certificate program which requires a way to have the user retrieve a unique validation code consisting of the first 9 digits of a random GUID and the date and time. I have a page that has a button which creates these labels perfectly, but I can't figure out how to bind them to the certificate being validated.
This is the page described above:
[Code]....
[Code]....
I am open to calling another page called via a hyperlink like so:
i want to create a textbox which accepts only 10digits(mobile no). Any further entry should not be accpeted in the textbox i.e.; the 11th digit should not be accepted.
I can validate textbox field by RegularExpressionValidator with regex "^([0-9]{3,3})$". For the required field validation I put requiredfieldvalidator. Thus, I have two validation controls.
Can I combine them into a sigle RegularExpressionValidator? Then what does regex look like? How can I validate empty fields with RegularExpressionValidator?
how to write a regular expression that accepts no less than 10 digits and no more than 11. i need it to validate a textbox for phone number. i have searched the web but i cant seem to find any.
I have this regular expression, for currency, which only accepts number and a decimal, however it takes digits starting with zero, like 09788,08383 how can i eliminate this bug from this regular expression here is the regular expression ^d{1,9}(.d{1,2})?$
I am still new to ASP.net and it has been some time since i worked with code in general, so please forgive me for sounding stupid. I am using SQL to populate several drop down lists in a form, and later using the values selected to populate a datagrid. My issue is that the value i am trying to assign is a GUID in the database. So when I:
Do While (reader.Read()) Dim newListItem As New ListItem()Loop newListItem.Value = reader.GetGuid(0) newListItem.Text = reader.GetString(1) Stat.Items.Add(newListItem)
I get an error stating :"Value of type 'System.Guid' cannot be converted to 'String'". My solution to this was to change "newListItem.Value = reader.GetGuid(0)" to
newListItem.Value = reader.GetGuid(0).ToString
that worked to generate the drop downs which was great, but now i am trying to use that value in a sql statement to populate a listbox and since the value is now a string, i cannot use it in my where clause to against a GUID field in the database. I would prefer to not have to convert the GUID in the first place, but have no idea how i could keep it in that format for my drop down list, and if that is not possible how can i convert the data back to GUID from String?
So I'm almost finished my project but I'm stuck. In my application's database I save some records that contain the currently logged in user's userID - and so when it comes to displaying these records, I've been just been outputting the userID whilst developing the rest of the application. Through googling I've found this line of code that will get the a username based on a userID:
Dim membershipUser As MembershipUser = Membership.GetUser(New Guid(userGUID))
Which works great if I can supply it with a GUID - but I'm struggling to see how I can use this line of code if for example I want to show the usernames for comments on an article which are contained in a repeater control.Maybe it would be simpler to just merge my application's database with the asp.net membership database (ASPNETDB.mdf) so I can just select the username in SQL instead - but I'm not even sure how to do that.
I know there are about a million posts on this topic, and I have attempeted to use many of them. However, I keep getting an error when I attempt a simple SQL update. Here is my code:
I have a TextBox in a FormView that I want to make sure that the user enters exactly 9 digits. The FormView is inside an Update Panel so I want to be able to validate without a Postback. I cannot figure out which validation control can do that and how. I already have a FilteredTextBoxExtender that forces all digits.
I have a stored encryption: "dkljas84u238jidasjidoia"When I get in this instance decryption "11111111111111111"show how the combobox "****************** 1111 "Something like: SELECT RIGHT ('11111111111111111 ', 4)
We have a list of titles, some of which start with numbers (e.g. 5 Ways to Make Widgets). We would like to sort this as if it were "Five Ways..." without changing the title. We know that some movie places do this, but I can't find info online on how to do it.
I don't have a VS in front of me but i would be needing this one next week when i start working again, so I thought I would be prepared.What i want to do is put a comma "," right before the last 2 digits. So I am thinking of ajax masked edit extender but I don't have VS here so i can't do the testings. If it does not have the exact feature i was thinking of some custom javascript-jquery function . Finally a regex to clear out the wrong formats-characters again if masked extender does not work.
My formatting should be like this: 1234567 to 12345,67 , 1 to 1,00 etc. If doable, I would prefer the mask for the masked extender.