|
You attribute's Match method got hit?
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
No it does not get hit.
ClientName="dd";
|
|
|
|
|
|
this is good thanks but data i will have is something like this
RA01XYZ 201401231445012345611012345678998765432101234DESTINATIONNAMESIZEIS70
RA is one field
01 is one field
XYZ is on and so on
so i will have to extract and then validate
any suggestions
|
|
|
|
|
With regex you can validate without breaking it apart...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
yeah but then we will have to validate through regex and store it in property separately
i guess this is what they call catch 22
|
|
|
|
|
I think not.
You should pass the regex as a property to your new attribute...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
that's what i am doing
but see
i need to first
extract
validate
store
[RegexValidator(@"[a-zA-Z@$^-9\s\S]{2}", ErrorMessage = "ok")]
public string RecordType { get; set; }
[RegexValidator(@"[a-zA-Z@$^-9\s\S]{2}",ErrorMessage="ok1")]
public string VersionNumber { get; set; }
[StringLengthValidator(1, 50, MessageTemplate = "Last Name must be between 1 and 70 characters")]
public string ClientName { get; set; }
-----------------
string Line="RA01XYZ 201401231445012345611012345678998765432101234DESTINATIONNAMESIZEIS70 SENDINGENTITYIDENTIFIER SENDERNAMESIZE70 ";
p.RecordType = Line;
p.VersionNumber = Line;
Now issue is that it will always start from 1 character it will not increment
RecordType will start from 1 to 2
so VersionNumber should start from 3 to 4
and ClientName from 5 to 50
i guess i'll try mentioning this using StringLength validator but then datatype validation will be a case
|
|
|
|
|
|
thanks
now i guess i cant do evs in one step so i am extracting first using substring
and then validating and storing using attributes [EL]
[RegexValidator(@"[a-zA-Z@$^-9\S]{2}", MessageTemplate = "RecordType Validation failed")]
|
|
|
|
|
Just attaching a custom attribute to the property doesn't automatically cause some validation.
You must have something that looks for an "appropriate" attribute, using Reflection, typically, and causes the actual validation.
|
|
|
|
|
|
I see...
However, the OP didn't derive from ValidationAttribute , they derived directly from Attribute :
public class ValidateProperty : Attribute
and that's NOT going to work.
|
|
|
|
|
|
I have one html document . I want to highlight text in html document but which text I want to highlight that is repeated text in html document . But I want to highlight only exact text according to my requirement then how can I determine the exact text which I want to highlight . Manually, I know that this text should have to highlight but how programmatically determine exact text to highlight between duplicates.
Please some one can help to me.
My exact scenario is giving below-
I want explain my scenario I have some pdf and converting in epub file.After converting some text font name or font style missing then I have to compare with pdf and epub and highlight the exact text which font is missing.But because of duplicates I am not able to determine the text for highlight.
modified 28-Jan-14 5:01am.
|
|
|
|
|
If you don't know which text to highlight then how do you expect anyone else to know?
Veni, vidi, abiit domum
|
|
|
|
|
I want explain my scenario I have some pdf and converting in epub file.After converting some text font name or font style missing then I have to compare with pdf and epub and highlight the exact text which font is missing.But because of duplicates I am not able to determine the text for highlight.
|
|
|
|
|
I wish I could, but my brain melted trying to work out exactly who does know which text you want to highlight...
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
I want explain my scenario I have some pdf and converting in epub file.After converting some text font name or font style missing then I have to compare with pdf and epub and highlight the exact text which font is missing.But because of duplicates I am not able to determine the text for highlight.
|
|
|
|
|
Take the text in differnt differnt span or table. And each span and table specify the ID. And write the javascript function.This function will for highlighting the section.For that javascript jsut pass the span or table id. Based on your condition ,just pass the id to javascript and it will help for you.
|
|
|
|
|
Thanx for your suggestion but I already tried same way.But its not helping to me. so I am explaining my scenario to you what exactly i want -
I want explain my scenario I have some pdf and converting in epub file.After converting some text font name or font style missing then I have to compare with pdf and epub and highlight the exact text which font is missing.But because of duplicates I am not able to determine the text for highlight.
|
|
|
|
|
Which of the following methods and attributes are NOT part of the VB.NET Exception class API?
TargetSite
StackTrace
InnerException
SourceLink
|
|
|
|
|
You do realise that this is the C# forum don't you?
|
|
|
|
|
Aside from being in the c# forum, this looks very much like a school/interview question in which case you need to do the research yourself. If it has relevance then supply some context for the question.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Whoever the interviewer is, I can't figure out what he/she hopes to gain by asking this, other than a insight into your knowledge of a very specific (but important) .net class. Or actually, your ability to find out the information givem you've managed to post this on the Internet.
Also, wrong forum.
|
|
|
|