|
Hello,
In my internet site, i have to proivde search functionality within the website domain. Could you please give some light where should i look for related articles,sample code, ideas etc....
Thanks,
Thanks
|
|
|
|
|
|
I have a string
bobby@yahoo.com (Bobby Gill)
I want to parse it and want to get the substring "bobby@yahoo.com" before space.
Could you please give me code.
thanks
seema
|
|
|
|
|
I didn't quite understand what you want. Can you explain a bit more
|
|
|
|
|
string s="bobby@yahoo.com (Bobby Gill)"<br />
int indx=s.IndexOf(' ');<br />
string val=s.Substring(0,indx);
OR
string s="bobby@yahoo.com (Bobby Gill)"<br />
string[] ss=s.Split(' ');<br />
int count=0;<br />
string val;<br />
foreach(string s1 in ss)<br />
{<br />
if(count==0)<br />
{<br />
val=s1;<br />
}<br />
count=1;<br />
}
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
Hi all,
I'm trying to make an asp.net data entry table work like they do in access. what i want is a one line table with 3 columns (a time picker, a drop down, and a comments section). When the line is fully populated, I'd like a new empty line to appear below so the user can continue to add any number of lines.
I can't figure out any easy way to do this, and that usually means i'm missing something simple any help is greatly appreciated!
thanks in advance,
Craig
|
|
|
|
|
try repeater control or datagrid and add template columns
Shujaat
|
|
|
|
|
have a AutoCompleteExtender and I bound it to a textbox. It is the list of
all email address and last name and first name
nMultani@dov.gc.ca (nancy Multani)
bGill@dov.gc.ca (babay Gill)
I want to validate this text box. I want to create new validation control
the text box I type only that item which appear in drop down list or select
valid item or type whole string.
How can I do that.
seema
|
|
|
|
|
I have a gridview that, depending on the information being passed to it, needs to flag the Visible attribute of a textbox control in one of the template columns. so here is a quick snippet of the datarow as it is being built:
dr[4] = "";
dr[5] = s;
dr[6] = "false";
the datatable columns it references:
dt.Columns.Add("filler");
dt.Columns.Add("key");
dt.Columns.Add("Vis");
and the line in the gridview that is having issues:
<asp:TextBox ID="txtItmQty" runat="server" Text='<%# Bind("filler") %>' Width="42px" Visible='<%# Bind("Vis") %>'></asp:TextBox>
every time i run it, i get this:
<b>Specified cast is not valid.</b>
how or what do i have to pass to the Visible attribute to set this dynamically?
-- modified at 18:14 Thursday 13th September, 2007
______________________
Mr Griffin, eleventy billion is not a number...
-- modified at 18:14 Thursday 13th September, 2007
|
|
|
|
|
try <%# Eval("filler") %> Instead of <%# Bind("filler") %>
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
i m assuming that u store bool value in your "Vis" Field.According to that below solution is given...
public string GetValue(bool Vis)
{
if (Vis)
return "true";
else
return "false";
}
Visible='<%# GetValue(Convert.ToBoolean(DataBinder.Eval(Container.DataItem,"Vis"))) %>'
i thinks this will work
-- modified at 1:56 Friday 14th September, 2007
Jintal Patel
|
|
|
|
|
When i store a cookie, id doesn't remeber even if i use refresh
Using VS2005 SP1
Thank's in advance
|
|
|
|
|
How do you store the cookie, and how do you try to read it?
---
single minded; short sighted; long gone;
|
|
|
|
|
To Write
Response.Cookies["UserName"].Value = txtUserName.Text;
Response.Cookies["UserName"].Expires = core.cookieExpire();
Response.Cookies["Password"].Value = txtPassword.Text;
Response.Cookies["Password"].Expires = core.cookieExpire();
public DateTime cookieExpire()
{
DateTime dt = DateTime.Now;
dt.AddYears(Convert.ToInt32(ConfigurationManager.AppSettings["CookieExpireYear"]));
dt.AddMonths(Convert.ToInt32(ConfigurationManager.AppSettings["CookieExpireMonth"]));
dt.AddDays(Convert.ToInt32(ConfigurationManager.AppSettings["CookieExpireDay"]));
dt.AddHours(Convert.ToInt32(ConfigurationManager.AppSettings["CookieExpireHour"]));
dt.AddMinutes(Convert.ToInt32(ConfigurationManager.AppSettings["CookieExpireMinutes"]));
return dt;
}
<configuration>
<appSettings>
<add key="CookieExpireYear" value="1"/>
<add key="CookieExpireMonth" value="0"/>
<add key="CookieExpireDay" value="0"/>
<add key="CookieExpireHour" value="0"/>
<add key="CookieExpireMinutes" value="0"/>
</appSettings>
<connectionStrings>
To Read
HttpCookie cookieUserName = Request.Cookies["UserName"];
HttpCookie cookiePassword = Request.Cookies["Password"];
|
|
|
|
|
Saksida Bojan wrote: public DateTime cookieExpire()
{
DateTime dt = DateTime.Now;
dt.AddYears(Convert.ToInt32(ConfigurationManager.AppSettings["CookieExpireYear"]));
dt.AddMonths(Convert.ToInt32(ConfigurationManager.AppSettings["CookieExpireMonth"]));
dt.AddDays(Convert.ToInt32(ConfigurationManager.AppSettings["CookieExpireDay"]));
dt.AddHours(Convert.ToInt32(ConfigurationManager.AppSettings["CookieExpireHour"]));
dt.AddMinutes(Convert.ToInt32(ConfigurationManager.AppSettings["CookieExpireMinutes"]));
return dt;
}
The methods in the DateTime structure doesn't change the value, they return the new value. That means that the cookieExpire method returns DateTime.Now , which will make your cookies expire immediately.
This will give you a better result:
public DateTime cookieExpire() {
return DateTime.Now
.AddYears(Convert.ToInt32(ConfigurationManager.AppSettings["CookieExpireYear"]))
.AddMonths(Convert.ToInt32(ConfigurationManager.AppSettings["CookieExpireMonth"]))
.AddDays(Convert.ToInt32(ConfigurationManager.AppSettings["CookieExpireDay"]))
.AddHours(Convert.ToInt32(ConfigurationManager.AppSettings["CookieExpireHour"]))
.AddMinutes(Convert.ToInt32(ConfigurationManager.AppSettings["CookieExpireMinutes"]));
}
---
single minded; short sighted; long gone;
|
|
|
|
|
|
I have a textBox Where I type date. I want to validate it. Im using customValidate controls. I have this function in my code behind page
void DatesValidate(object source, ServerValidateEventArgs e)
{
if (Convert.ToDateTime(e.Value) <= DateTime.Now)
{
e.IsValid = false;
this.lblAddUsers.Text = "The Proxy is already expired";
}
}
<asp:customvalidator id="cvEndDate" runat="server" onservervalidate="DatesValidate"
="" controltovalidate="txtTo" errormessage="error" display="Dynamic">
It is not working it is giving the follo2ing error
'Proxy.DatesValidate(object, System.Web.UI.WebControls.ServerValidateEventArgs)' is inaccessible due to its protection level
seema
|
|
|
|
|
I have a textBox Where I type date. I want to validate it. Im using customValidate controls. I have this function in my code behind page
void DatesValidate(object source, ServerValidateEventArgs e)
{
if (Convert.ToDateTime(e.Value) <= DateTime.Now)
{
e.IsValid = false;
this.lblAddUsers.Text = "The Proxy is already expired";
}
}
<asp:customvalidator id="cvEndDate" runat="server" onservervalidate="DatesValidate"
="" controltovalidate="txtTo" errormessage="error" display="Dynamic">
It is not working it is giving the follo2ing error
'Proxy.DatesValidate(object, System.Web.UI.WebControls.ServerValidateEventArgs)' is inaccessible due to its protection level
seema
|
|
|
|
|
Use the protected access modifier in front of the method declaration. By default, methods are private when specified without an access modifier.
Jon Sagara
Once again, the conservative sandwich-heavy portfolio pays off for the hungry investor! *slurp* Oh, I'm ruined!
-- Dr. Zoidberg
.NET Blog | Personal Blog | Articles
|
|
|
|
|
Hi,
I have a asp pase. I have one text box, txtName, txtStartDate, txtEndDate. and a button Submit.I have a grid view hand it has edit, delete and cancel buttons. I want to validate my page.
I have three RequiredValidation controls for three text boxes. I want that error message should only appear when I click on button. But when I click on some where in grid view or when I select any row in grid view it should not show error message.
Thanks.
seema
|
|
|
|
|
You will need to toggle the Page_ValidationActive javascript variable similar to what I just outlined here[^].
Only in your case, you probably want to set it to false in the body OnLoad event, and then set it to true in the button's onclick event.
|
|
|
|
|
hi,
u set ValidationGroup Property of RequiredValidation controls and also for that button on which you want the error message.ValidationGroup should be same for all control
Jintal Patel
|
|
|
|
|
Hey guys, I'm trying to make a contact us page for my website and I was reading an article about
that matter http://www.codeproject.com/useritems/EmailApplication.asp
I did exactly as was explained in the article I've added a valid pop3 and SMTP address and
the account which I'm sendin the mail to is also created in my website ! but when I click send I
get this error !
string Name = TextBox1.Text;<br />
string Address = TextBox2.Text;<br />
string Message = TextBox3.Text;<br />
<br />
SmtpClient SC = new SmtpClient();<br />
MailMessage Msg = new MailMessage();<br />
<br />
try<br />
{<br />
MailAddress FromAddress = new MailAddress(Address, Name);<br />
SC.Host = "mail.mla.ir";<br />
SC.Port = 25;<br />
Msg.From = FromAddress;<br />
Msg.To.Add("keivan@mla.ir");<br />
Msg.Subject = "FeedBack";<br />
Msg.Body = Message;<br />
SC.Send(Msg);<br />
}<br />
catch (Exception ex)<br />
{<br />
Label4.Text = ex.ToString();<br />
}
System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable.
The server response was: Verification failed
for at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)
at System.Net.Mail.SmtpClient.Send(MailMessage message) at ContactMe.Button1_Click(Object sender, EventArgs e)
in (My file)
please help me out !
Thaqnx
Mr.
K
|
|
|
|
|
I don't know if this would help.
I read somewhere that the FROM field can not be a variable and must be set to an existing email address in the server.
Try using your email address in the from (the one registered in the server you use to send the email). Also find out if your server needs to validate user and password.
If it does you might need to supply them.
And if this works and you need to register the sender's email just add it to the sender message.
Hugo
Hugies.....
|
|
|
|
|
Hey there,
i have a gridview inside my repeater.
Why cant i directly access it from my code?
what do i need to do, and what have i overlooked?
Christian
cbm.dk
|
|
|
|