Click here to Skip to main content
15,895,746 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionSmall Query help needed Pin
siddisagar10-Dec-09 19:11
siddisagar10-Dec-09 19:11 
AnswerRe: Small Query help needed Pin
Dinesh Mani10-Dec-09 19:26
Dinesh Mani10-Dec-09 19:26 
AnswerRe: Small Query help needed Pin
Blue_Boy10-Dec-09 20:54
Blue_Boy10-Dec-09 20:54 
Questionis it possible? Pin
Hema Bairavan10-Dec-09 18:51
Hema Bairavan10-Dec-09 18:51 
AnswerRe: is it possible? Pin
Anurag Gandhi10-Dec-09 19:24
professionalAnurag Gandhi10-Dec-09 19:24 
AnswerRe: is it possible? Pin
Dinesh Mani10-Dec-09 19:38
Dinesh Mani10-Dec-09 19:38 
AnswerRe: is it possible? Pin
farogh haider14-Dec-09 19:20
farogh haider14-Dec-09 19:20 
QuestionCustom Validator for DataGrid Template Column Pin
Graham Baxter10-Dec-09 14:15
Graham Baxter10-Dec-09 14:15 
Hi,

I have a DataGrid that has a textbox within a template column that will populate a SQL DB.

The user can click on the edit button(s) to modify 3 different types of data in this column:

Account No
FirstName, LastName
Email Address

I have a custom validator that does server validation but I cannot work out (I am new to this) how to validate the 3 different types of data using a regular expression.

Although the validator correctly highlights the textboxes that do not match a single regex I would like to have a different regex for each textbox row within the grid. Is there any way I can do that. I have included the relevant bits of code below.

Thanks!

Graham

<asp:datagrid id="CPYInsert" runat="server"
="" autogeneratecolumns="False" backcolor="lightyellow" bordercolor="black" showfooter="false" cellpadding="3" cellspacing="0" font-size="12pt" headerstyle-backcolor="darkorange" headerstyle-forecolor="white">
<columns>
<asp:templatecolumn headertext="DataField">c
<itemtemplate>
<asp:label id="txtParam" width="100px" runat="server"
="" text="<%# DataBinder.Eval(Container.DataItem,"rtSchema") %>">



<asp:templatecolumn headertext="Parameter">
<itemtemplate>
<asp:textbox runat="server" id="txtParamData"
="" text="<%# Container.DataItem("Parameter") %>">
<asp:customvalidator id="WorkDateValidator" runat="server" display="Dynamic" controltovalidate="txtParamData" onservervalidate="ValidateEntry">*



<asp:boundcolumn datafield="Guidelines" headertext="Guidelines">




Sub ValidateEntry(sender As Object, args As ServerValidateEventArgs)


dim mymatch as match = System.Text.RegularExpressions.Regex.Match(args.value, "[0-9]{10}") 'I need to have 1 of these for each args.value returned

If Not myMatch.Success

args.IsValid = false

else

args.IsValid = true

End If


End Sub
AnswerRe: Custom Validator for DataGrid Template Column Pin
sashidhar10-Dec-09 18:57
sashidhar10-Dec-09 18:57 
GeneralRe: Custom Validator for DataGrid Template Column Pin
Graham Baxter11-Dec-09 1:52
Graham Baxter11-Dec-09 1:52 
AnswerRe: Custom Validator for DataGrid Template Column Pin
Dinesh Mani10-Dec-09 18:58
Dinesh Mani10-Dec-09 18:58 
GeneralRe: Custom Validator for DataGrid Template Column Pin
Graham Baxter11-Dec-09 1:41
Graham Baxter11-Dec-09 1:41 
AnswerRe: Custom Validator for DataGrid Template Column Pin
Dinesh Mani11-Dec-09 2:13
Dinesh Mani11-Dec-09 2:13 
GeneralRe: Custom Validator for DataGrid Template Column Pin
Graham Baxter11-Dec-09 2:20
Graham Baxter11-Dec-09 2:20 
QuestionInsert image with html editor Pin
Richard Blythe10-Dec-09 8:50
Richard Blythe10-Dec-09 8:50 
AnswerRe: Insert image with html editor Pin
Abhishek Sur10-Dec-09 11:21
professionalAbhishek Sur10-Dec-09 11:21 
GeneralRe: Insert image with html editor Pin
farogh haider14-Dec-09 19:24
farogh haider14-Dec-09 19:24 
Questionupdate global.asax variable from javascript Pin
Munteanu Ciprian10-Dec-09 8:12
Munteanu Ciprian10-Dec-09 8:12 
AnswerRe: update global.asax variable from javascript Pin
Petr Pechovic10-Dec-09 10:36
professionalPetr Pechovic10-Dec-09 10:36 
GeneralRe: update global.asax variable from javascript Pin
Munteanu Ciprian10-Dec-09 18:17
Munteanu Ciprian10-Dec-09 18:17 
GeneralRe: update global.asax variable from javascript Pin
Petr Pechovic10-Dec-09 19:58
professionalPetr Pechovic10-Dec-09 19:58 
GeneralRe: update global.asax variable from javascript Pin
Munteanu Ciprian11-Dec-09 1:46
Munteanu Ciprian11-Dec-09 1:46 
GeneralRe: update global.asax variable from javascript Pin
Petr Pechovic11-Dec-09 2:48
professionalPetr Pechovic11-Dec-09 2:48 
GeneralRe: update global.asax variable from javascript Pin
Munteanu Ciprian11-Dec-09 2:53
Munteanu Ciprian11-Dec-09 2:53 
GeneralRe: update global.asax variable from javascript Pin
Munteanu Ciprian11-Dec-09 3:15
Munteanu Ciprian11-Dec-09 3:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.