|
Hi,
If you collects the e-mail adress from a web form you can use a RegularExpressionValidator like this:
<asp:textbox id="tbEmail" runat="server">
<asp:regularexpressionvalidator id="RegularExpressionValidator1" controltovalidate="tbEmail" runat="server"
="" errormessage="Not a valid email" validationexpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">
If you would like to check at the server level you can use a simple
emailstring.Contains("@") to check before you try to send it.
|
|
|
|
|
I understand your explain!
Would you mind to give me your personal email address?
Many thanks,
Visoth
|
|
|
|
|
Hi,
That I can do, don't want to post it here though. Could you reply to this with a private message with your adress?
|
|
|
|
|
Thanks for your afford!
Hope that you'll always answer my questions.
Many thanks,
Visoth
|
|
|
|
|
Matrix style vs Table style
For grid/table display, DataGrid is the obvious choice, what about Matrix style display like this http://paperwhistle.com/shop?p=2[^]
What control should I use?
Thanks
dev
|
|
|
|
|
When all else fails, use a repeater, it gives you the most control.
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 )
|
|
|
|
|
whew our famous Christian Graus actually talked to me! I am honored!
dev
|
|
|
|
|
I'm working on some code that I am doing for a site. What I need it to do is the user can fill out 3 parts, Name, Phone, Email, and then it will redirect you to the full form page with Name, Phone, Email filled in with the values they have given.
This site does what I am looking for although it is in PHP: http://www.moveit.ca/[^]
I am very new to ASP and don't have a full grasp on it, so I apologize in advance for that. So if someone could point me in the direction that I would need to go to figure this one out that would be great, thanks.
|
|
|
|
|
The obvious way would be to pass those values on the URL and get them from the query string.
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 )
|
|
|
|
|
I sort of have that part figured out, my only problem is how to set text boxes and drop down menus to the values when loaded.
|
|
|
|
|
myTextBox.Text = Request.QueryString["Name"] ?? string.Empty;
This will grab the name from myURL.aspx?Name=Fred and if there is no value, the querystring returns null, so the ?? operator will see it's null and replace null with an empty string.
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 )
|
|
|
|
|
Awesome, I figured it out. Thanks for the quick responses =]
|
|
|
|
|
Hi,
You can also pass the value from one page to another using hidden form fields which will be better for security purposes.
Either you love IT or leave IT...
|
|
|
|
|
I have a checkboxlist that has values populated from a sql table's column. When i apply the selected values to a report within a page postback is triggered and the selected value seems to be lost.
how to set the selected to remain even after postback?
Appreciate your thoughts.
Thanks.
public ReadOnlyCollection<string> ParameterValues
{
get
{
this.EnsureChildControls();
List<string> names = new List<string>();
if (!string.IsNullOrEmpty(cName))
{
for (int i = 0; i < cBList.Items.Count; i++)
{
if (cBList.Items[i].Selected)
{
names.Add(cBList.Items[i].Value);
}
}
}
for (int i = 0; i < cBList.Items.Count; i++)
{
ListItem item = cBList.Items[i];
if (item.Value == cName.ToString())
{
cBList.SelectedIndex = i;
item.Selected = true;
}
}
ReadOnlyCollection<string> result = new ReadOnlyCollection<string>(names);
return result;
}
}
[ConnectionConsumer("Input Values")]
public void GetValues(ITransformableFilterValues values)
{
foreach (string val in values.ParameterValues)
{
this.Provider_Values = val;
this.Provider_Name = values.ParameterName;
ds = new SqlDataSource();
ds.ID = "Source ID";
ds.ConnectionString = cString;
ds.SelectCommand = this.SQLSelectCommand;
cBList.DataTextField = cName;
cBList.DataValueField = cName;
cBList.DataSource = ds;
cBList.ID = "List ID";
cBList.Attributes.Add("onclick", "FindSelectedItems(this," + tB.ClientID + ");");
cBList.DataBind();
}
}
|
|
|
|
|
If you data bind on postback, then your values will be lost
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 )
|
|
|
|
|
apparently now I've been staring at it for 2 days and getting the glazed look.
|
|
|
|
|
Just check whether the data bind function is inside the if(!IsPostBack) or not.
Either you love IT or leave IT...
|
|
|
|
|
Finally i was able to resolve the issue. The way i accomplished this was to create a list with the selected CheckBoxList values and reselect the original check box list based on the values in the new list.
public ReadOnlyCollection<string> ParameterValues<br />
{<br />
get<br />
{<br />
this.EnsureChildControls();<br />
<br />
List<string> names = new List<string>();<br />
if (!string.IsNullOrEmpty(cName))<br />
{<br />
for (int i = 0; i < cBList.Items.Count; i++)<br />
{<br />
if (cBList.Items[i].Selected)<br />
{<br />
names.Add(cBList.Items[i].Value);<br />
selectedCBListItems.Add(cBList.Items[i]);<br />
}<br />
}<br />
<br />
}<br />
for (int i = 0; i < cBList.Items.Count; i++)<br />
{<br />
ListItem item = cBList.Items[i];<br />
if (item.Value == cName.ToString())<br />
{<br />
cBList.SelectedIndex = i;<br />
item.Selected = true;<br />
}<br />
}<br />
ReadOnlyCollection<string> result = new ReadOnlyCollection<string>(names);<br />
return result;<br />
}<br />
}<br />
<br />
protected override void OnPreRender(EventArgs e)<br />
{<br />
base.OnPreRender(e);<br />
if (this.Page.IsPostBack)<br />
{<br />
cBList.DataBind();<br />
for (int i = 0; i < selectedCBListItems.Count; i++)<br />
{<br />
if (cBList.Items[i].Value == selectedCBListItems[i].Value)<br />
{<br />
cBList.Items[i].Selected = true;<br />
}<br />
}<br />
<br />
} <br />
}<br />
I am sure there might be some other elegant solution. I am yet to implement it. Please shed light on this topic. If you had the same issue, and if nothing else works, try the above method
|
|
|
|
|
Hi folks,
First of all, thanks for reading this question:
I have been working on a marketing tool that generates HTML based on input parameters from the URL. Now that was really easy but I have run into performance issues where I have to tweak my code to speed things up. that is good so far. However now every time I update the code, i have to ensure that the HTML is the same. Now the problem is that i have to ensure the result remains the same across 10-20 sites; and that has become my nightmare. Is there a tool that would call my aspx page with some parameters on different domains, and then company the return results to ensure the results are the same?
I thank you for reading my question and hope to hear back from you experts
Regards,
|
|
|
|
|
I have developed a website which i try to deploy on my local server(having some PCs and using one of them as server) i am not been able to get any information about the client machine i.e. machine i am using the application after deployment. Like for an example i have used the Response.IsLocal to know whether my application is really reaching to the client machine.. when i run the appliaction on server machine it returns True and on client machine it returns False... But i am not been able to create any file on client machine and not been able to get the IP of client machine.. when ever i try to create a file on client machine it creates the file on server machine and returns the IP address of Server machine. The problem is quit strange to me ... please help me out..
Thank You
|
|
|
|
|
you can not access client machine from the server, nor can you create files on the client machine.
You can use ActiveX to do that, but you will need the user's consent for that.
|
|
|
|
|
Is is possible any how i can get the client machine IP ??
or any unique no. .
I hava already tried with the activex object with java script and called the win32NetworkAdapter but it is also returning the server machine address
|
|
|
|
|
Hi to all,
I want to launch a windows application by website and also have to passed some values like username and password to the windows application.Launching the windows application is done by using process.start(without deployment) and response.redirect(after deployment)... i am also entering the username and password in my website so that the windows application should be launch for the authenticated user and i also have to pass these values(username and password) to the windows application.How can i do that???? And i have to deploy the combination of these to two on my local server.. plz help me out...
Thnxxx
|
|
|
|
|
Hmmm, that is not possible. Imagine if someone can write malicious web application that can access your local application.
If you are trying to develop Intranet application, consider using ActiveX. It has its own caveat through.
|
|
|
|
|
Hi All,
I am trying to set the value of a cookie in code-behind(vb.net) and reading it in javascript at the client side.
Jvascipt code in "Test.aspx" is :
if( readCookie("status") == "True")
setTimeout('Redirect()',1000);
function Redirect()
{
window.location = "Test.aspx";
}
But the value of the cookie is not set.
I think because I am writing the cookie via server-side script, then use a javascript
redirect, I am losing the server-side the cookie.
But, don't know how to fix it!
Can anyone help?
Thanks,
|
|
|
|