|
Hi,
I am new to asp.net,I would like to know if a user enters his e-mailid in my form,
How to check whether it is fake or not?
Plz help.
|
|
|
|
|
Hi, I think you should definitely use a regular expression. A quick google search for "valid email regular expression" leads to a good example here: http://www.codetoad.com/asp_email_reg_exp.asp[^]
That source is in the older ASP (not .NET), but the function should still work.
--EDIT -- actually you'll need to change around the function a bit but you get the idea.
|
|
|
|
|
|
//java script
function isValidEmailID(emailid)
{
var regex = new RegExp("\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*");
var matches = regex.exec(emailid);
return (matches != null && emailid == matches[0]);
}
//aspx.cs
email = txtEmail.Text.Trim();
if (!IsValidEmail(email))
{
custVal.ErrorMessage = "Valid EmailID : Must be Entered";
custVal.IsValid = false;
return;
}
Padmanabhan
|
|
|
|
|
You can't, actually. There is no way of doing this. You can tell if an email address is possible, but not if it's real.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
There is no way to know for sure, but you're close if you connect to the users smtpserver to find out if it accepts mail to the recipient.
Here's[^] how to do it.
|
|
|
|
|
Hi,
You can check email format by using validation & if you want to check it is exist or not
then you should use any webservice or free dll.
Farogh Haider
Web developer
|
|
|
|
|
My problem is when i populate data in the Gridview using collapsible control extender its populating data on collapse and expand both.
But i dont want it populate data on Collapse.
Please suggest solution
Thanks
Danish
|
|
|
|
|
You have to remove the postback.
Either you love IT or leave IT...
|
|
|
|
|
Hi All,
How to disable repair option in .net wensetup. please help me regarding this.
Pradeep Reddy
|
|
|
|
|
How is this an ASP.NET question ?
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Hi All,
I don't have too much confidence in asp & I encounter difficulty to attach a csv file in my code, could you help me please?
Thanks
<pre>namespace SendProductData
{
classSendProductData
{
staticvoidMain(string[] args)
{
string upload_file = @"d:\BLABLA\prod.csv";
string url_link = "https://BLABLA.com/index.php?d=webServices_Server&c=ServerRest&rm=importFileContr&rf=importProduct&sl=e3068BLABLABLABLAbf8d04&FILENAME=";
HttpWebRequest WebReq = WebRequest.Create(url_link + upload_file) asHttpWebRequest;
WebReq.ContentType = "UTF-8";
WebReq.Method = "POST";
WebReq.ContentLength = 0;
WebReq.Credentials = newNetworkCredential("LOGIN-BLABLA", "MDP-BLABLA");
using (HttpWebResponse response = WebReq.GetResponse() asHttpWebResponse)
{
// Get the response stream
StreamReader reader = newStreamReader(response.GetResponseStream());
// Console application output
Console.WriteLine(reader.ReadToEnd());
response.Close();
}
}
}
}
|
|
|
|
|
What the hell ? I assume you mean ASP.NET, but this C# code has nothing to do with ASP.NET.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Hi Christian,
Thanks for your reply. Well I am not sure of which code is it. So far, I just know that I have a problem with this code because I cannot attach the csv file.
Do you have any idea to solve my problem?
|
|
|
|
|
Hello
I have learn asp.net(c#).Using this i am creating an online examination website.
I have selected few question from database and assign it to dataset.Now i want to show all the question with their objectives which are in dataset on one page in different
labelbox and radiobuttuonlist
I am not able to understand how to create new labelbox and radiobuttonlist every time data is selected from the dataset
please Help!!!.
You can visit the following page which definitely give an idea about how I want the question arrange
http://www.nseindia.com/content/ncfm/fmm.htm[^]
|
|
|
|
|
Say you need to add a dropdownlist to the gridview,
DropDownList dr1= new DropDownList();
dr1.Items.Add("new");
dr1.Items.Add("newOne");
GridView1.Rows[1].Cells[1].Controls.Add(dr1);
If you want to add a control in every row, use GridView1_RowDataBound event in gridview
add like this,
e.Row.Cells[1].Controls.Add(new TextBox());
further if you google you will get.
|
|
|
|
|
Thanks you for your reply Baran M
But i don't want to use dropdownlist from where user select the correct the objectives.What I am trying "is display all question with their objective in radiobuttonlist and when the user over selecting the objectives it click on submit button and result will be displayed".
What you have saying about is one of the sample project which is in the official site of asp.net, a tutorial video.In which they uses the gridview to show the
Question No
Question Text
It's $ objectives
and a dropdownlist from where user have to choose the correct objectives like(A,B,C,D)
If you can give any other advice it well be very greatfull
AGAIN, THANKS FOR THE REPLAY
|
|
|
|
|
If you add controls to gridview while page_load, it will be created even while postback action. So if you check now you will get status of the checkbox which you have added to gridview. I have tried it but I doubt whether this is a best approach.
|
|
|
|
|
thank you for your reply sir..
You are talking about using gridview but
instead of using grid view i am using datalist to display the question like this
Q1. Here is the first question
a) Option a
b) Option b
c) Option c
d) Option d
Q2. Second question
a) Option a
b) Option b
c) Option c
d) Option d
Next..
SubMit Button which led the result page
Here is the code through which i bind the question with the label and radiobuttonlist
<br />
<asp:DataList ID="DataList1" runat="server" DataSourceID="AccessDataSource1"><br />
<AlternatingItemStyle BackColor="#CCCCCC" /><br />
<ItemStyle BackColor ="#EEEEEE" /><br />
<ItemTemplate><br />
<p><%#Eval("QuestionNo") %>. <asp:Label ID="TextLabel" runat="server" Text='<%#Eval("QuestionText") %>'></asp:Label></p><br />
<asp:AccessDataSource ID="AccessDataSource2" runat="server"<br />
DataFile="~/App_Data/dbstudent.mdb"<br />
SelectCommand='<%# Eval("QuestionNo", "SELECT OptionA,OptionB,OptionC,OptionD FROM [BankQuestionBiology] WHERE QuestionNo = {0}") %>'><br />
</asp:AccessDataSource><br />
<asp:RadioButtonList ID="RadioButtonList1" runat="server"<br />
DataSourceID="AccessDataSource2"><br />
</asp:RadioButtonList><br />
</ItemTemplate><br />
</asp:DataList><br />
But it is giving a Syntax error
Syntax error (missing operator) in query expression 'QuestionNo = QB 10001'.
Could you help with this code or hint about a better approach
Again thanks for the reply
|
|
|
|
|
Can you share the code and database sneha or
send me on mkclrakesh@gmail.com
Rakesh Gaur
Mumbai
|
|
|
|
|
hi sneha
Can you send me the code and database of this project .
on mkclrakesh@gmail.com
Rakesh Gaur
|
|
|
|
|
I have a regular expression where i enter an image path with certain extention:
if i enter C:\Image.jpg it works fine but i enter \\sam\Image.jpg it doesnt work.
here is the validation expression:
ValidationExpression="[a-zA-Z0_9].*\b(.gif|.GIF|.jpeg|.JPEG|.jpg|.JPG|.bmp|.BMP)\b"
how can i add to validation expression to accpt \\ at the beginning.
thanks
|
|
|
|
|
|
I am currently hosting in a shared environment with no access to the servers IIS, configs or anything. All I have is FTP.
Ive searched and have found lots of URL rewriting techniques that will only work if you have access to the server.
So how do I do it?
Thanks
|
|
|
|
|
That not true. You can do the url rewritting in a number of ways even without changing IIS settings.
Here [^]is good article on how to do it.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|