|
I have a RequiredFieldValidator on a fileupload control that tests for a filename ending in 'daily.txt' or 'Daily.txt' or 'DAILY.TXT' or any other similar mixed upper/lowercase format of the filename 'daily.txt'. The validation expression I created is as follows:
ValidationExpression="[Dd][Aa][Ii][Ll][Yy]\.[Tt][Xx][Tt]$"
This tests out perfect in the many online regex validators. It even works in Firefox, but for some reason, IE won't validate a match. Is there something wrong with the validation expression with respect to how IE handles it?
The full markup for the fileupload is as below:
<asp:fileupload id="FileUploadImport" runat="server" />
<asp:button id="btnUpload" runat="server" text="Upload" validationgroup="ImportUpload" />
<asp:requiredfieldvalidator
ID="rfvFileUploadImport"
Display="Dynamic"
ControlToValidate="FileUploadImport"
SetFocusOnError="true"
Text="Please select Import File."
ValidationGroup="ImportUpload"
runat="server" />
<asp:regularexpressionvalidator
id="revFileUploadImport"
ControlToValidate="FileUploadImport"
SetFocusOnError="true"
ErrorMessage="Please select the location for the 'daily.txt' file"
ValidationExpression="[Dd][Aa][Ii][Ll][Yy]\.[Tt][Xx][Tt]$"
ValidationGroup="ImportUploadr" runat="server" />
Please Help. I am using both IE 7 and IE 6
-Ali
modified on Wednesday, March 12, 2008 12:19 PM
|
|
|
|
|
Which version of IE do you use?
M. Gouda
foreach(Minute m in MyLife)
{
myExperience++;
}
|
|
|
|
|
IE 7
I also tested in IE 6 for kicks
|
|
|
|
|
Really, I am not so familiar with Regular Expressions
If I faced such a problem, I would write my own validator
You can use
String.Compare(firstString,secondString,true);
where firstString will carry the last 9 characters of the file name
And secondString will carry the word "daily.txt"
And true means to ignore the case
M. Gouda
foreach(Minute m in MyLife)
{
myExperience++;
}
|
|
|
|
|
does anyone know how to enable STARTTLS in the mailsetting of the web.config file in asp.net. I keep getting the following error: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first e33sm3474460ugd.80.
Been stuck on this for days can anyone help??
cheers!!
|
|
|
|
|
Hi All,
I have an ASP application which is sending out mails (an html page) with mailto link in it. But the subject line fo this mail is dynamically created.
I want that when someone clicks on mailto link in mail sent by the application to them, it should open a reply window with same subject and body defaulting the address, exactly like when you reply to mails in outlook with the same subject line prefixing Re: and containing the body of the recevied mail.
I hope i am clear enough.
Appreciate your help.
Its a bit urgent too guys.
Thanks.
|
|
|
|
|
Azi Qaiser wrote: Its a bit urgent too guys.
Well let me drop everything I'm doing, and give you the shirt off my back. Would you like me to grill you a steak as well?
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
i'm sure there is some sort of irony with him wanting it urgent and the subject being an e-mail
|
|
|
|
|
So, if I understand it correctly, you want to programmatically trigger a "reply" action in the user's email client. Is this for an intranet scenario, where you can limit the number of email clients supported, or are you looking for this functionality regardless of what email client a user has?
|
|
|
|
|
Apparently it's not urgent enough to answer you. Or he didn't understand you. Or he copied and pasted your reply and it would not compile
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hey.
I have a anthem:PlaceHolder inside a asp:Repeater that contains an asp:RadioButtonList
something like
<br />
<asp:repeater id="rp" runat="server" gt;<br="" mode="hold" />HeaderTemplate> table></HeaderTemplate<br />
ItemTemplate><br />
td><anthem:ImageButton id="ibPt" runat="server"></anthem:ImageButton><br />
<anthem:PlaceHolder id="phPt" runat="server"><br />
<asp:Literal ID="liPt" Runat="server"></asp:Literal><br />
<asp:RadioButtonList ID="rblPt" Runat="server" Visible="False"></asp:RadioButtonList><br />
</anthem:PlaceHolder></td
And I have added a click event on my anthem:ImageButton that shall fill the RadioButtonList with items and make it Visible="true"
something like
private void OnPt(object sender, ImageClickEventArgs e)<br />
{<br />
MiBlo.Product bloProduct = null;<br />
Anthem.ImageButton aibtnPartType = (Anthem.ImageButton)sender;<br />
try <br />
{ <br />
System.Web.UI.WebControls.RepeaterItem riSL = (System.Web.UI.WebControls.RepeaterItem)aibtnPartType.Parent;<br />
<br />
int lngProductID = int.Parse(aibtnPartType.CommandName);<br />
int lngCatalogID = int.Parse(aibtnPartType.CommandArgument);<br />
<br />
bloProduct = new MiBlo.Product();<br />
<br />
DataView dvProductPartTypes = bloProduct.GetProductPartTypes(lngProductID, lngCatalogID);<br />
<br />
aibtnPartType.UpdateAfterCallBack = true;<br />
aibtnPartType.Visible = false;<br />
<br />
Anthem.PlaceHolder phPt = (Anthem.PlaceHolder)riSL.FindControl("phPt"); <br />
Literal liPt = (Literal)phPt.FindControl("liPt");<br />
liPt.Text = "";<br />
liPt.Visible = false;<br />
<br />
RadioButtonList rblPt = (RadioButtonList)phPt.FindControl("rblPt");<br />
rblPt.Visible = true;<br />
rblPt.RepeatColumns = 1;<br />
<br />
<br />
for(int i = 0; i < dvProductPartTypes.Count; i++)<br />
{<br />
RadioButton rb = new RadioButton();<br />
rb.Text = dvProductPartTypes[i]["dblNumberInUnit"].ToString();<br />
rb.GroupName = "rblPt"; <br />
<br />
rblPt.Controls.Add(rb);<br />
}<br />
<br />
phPt.UpdateAfterCallBack = true;<br />
}<br />
catch (Exception err) <br />
{<br />
lblMessage.Text += err.Message;<br />
}<br />
}
It enters the code and everything seems OK, but it won't show. I tryed just to set the Literal liPt.Text = "Test" and not setting it
to liPt.Visible = false and that is shown correctly.
But I have no idea why the RadioButtonList won't show.
I have allso tried an anthem:RadioButtonList insted of an asp:RadioButtonList inside an anthem:PlaceHolder but it gave the same
result.
Anyone know the RadioButtonList won't show?
Thanks
Thomas
|
|
|
|
|
It's not RadioButton one should add, but ListItems
as in:
for(int i = 0; i < dvProductPartTypes.Count; i++)<br />
{<br />
ListItem li = new ListItem();<br />
li.Text = dvProductPartTypes[i]["dblNumberInUnit"].ToString();<br />
rblPt.Items.Add(li);<br />
}
|
|
|
|
|
How do we connect to a database from .aspx page?
Regards,
LEE
|
|
|
|
|
There are thousands of articles in the web including codeproject.
Use Goole[^] to find it.
*jaans
|
|
|
|
|
http://aspnet.4guysfromrolla.com/articles/032702-1.aspx
http://msdn2.microsoft.com/en-us/library/ms178371.aspx
check these out
|
|
|
|
|
Hi
I have 20 different textboxes on a page
I need to make them all disabled.
IS there a way I can do this e.g. in a loop rather then writing out each textbox in the c# code?
thanks inadvance!
|
|
|
|
|
Iterate through the Page.Controls collection, check whether the control is a textbox, if yes set Enabled=false .
|
|
|
|
|
thanks for the reply
I have this so far
for (int x = 0; x < Page.Controls.Count; x++)
{
if (Page.Controls
}
How would I check if the control is a button and then set enable to false
would it be something like
Page.controls.Button.Enabled = false?
thanks!!
|
|
|
|
|
foreach (Control c in Page.Controls)
{
if(c is TextBox)
c.Enabled = false;
}
|
|
|
|
|
Hi
it says attrivute enabled is not recognised, I can make it invisible but not disabled
what would be the reason for this?
thanks so far!
|
|
|
|
|
Try this
foreach (Control c in form1.Controls)
{
if (c is TextBox)
(c as TextBox).Enabled = false;
} where form1 is your form name.
|
|
|
|
|
Hi
The syntax built this time but none of the textboxes are disabled.
Am I missing something?
thanks
|
|
|
|
|
It's working here. Put break point and check it is executing.
|
|
|
|
|
ive got the code in the page _load, its def running but not working:
foreach (Control c in form1.Controls)
{
if (c is TextBox)
(c as TextBox).Enabled = false;
}
|
|
|
|
|
I think you are doing little bit mistake in foreach line. Please try below code
foreach (Control c in this.Page.Form.Controls )
{
if (c is TextBox)
((WebControl)c).Enabled = false;
}
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|