|
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
|
|
|
|
|
try this:
<br />
GridView gv = (GridView)dataRepeaterId.Items[X].FindControl("gridViewId");<br />
where dataRepeaterId and gridViewId correspond with how you have them labeled in the markup and X is the index of the item you wish to get the gridview out of.
The problem is your gridview is inside another control so you have to pull it out.
|
|
|
|
|
Hi all,
I am using GridView in one ASP.NET, VB.NET application. I want to select data using select command of SqlDataSource but I don't want to do other operations like deleting and updating using SqlDataSource. So I am using RowDeleting() and RowUpdating() event handler of GridView. But When I click on Delete link in GridView it goes to event handler, do delete operation using my custom query and then it gives me error like "Deleting is not supported by data source (SqlDataSource1) unless DeleteCommand is specified". Any way to get rid out of this DeleteCommand?
Thanks in advance,
Priyank
|
|
|
|
|
Protected Sub GridView1_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GridView1.RowDeleting
e.Cancel = True
End Sub
I hope it should work.
http://www.tsspltd.com
|
|
|
|
|
Hi,
When manually binding an SqlDataSource, sorting and paging does not work on the GridView. Is there some kind of settings or code to make the sorting and paging work?
SqlDataSource1.SelectCommand() = sSQL
GridView1.DataSource = SqlDataSource1
GridView1.DataBind()
Note that when the SqlDataSource1 and the GridView is bind at design, the sort and paging work fine.
Thank you.
|
|
|
|
|
My problem is that I can't put the html that is rendered by my .aspx file into a pdf file using itextsharp.
the aspx file does not contain any pictures.
BiG RaLpH
|
|
|
|
|
i have a document library (named: Outstandings) which contain word cosuments, i searched a document (named: Balance_343,35725.doc) within this library , i ahve some columns in this library, i want to change the value of column/filed(named: Document Library) , how can i change the value of field? (actually i want to show a library name as link in the clumns in front of document)
This is my code:
SPSite sitecollectiont = SPControl.GetContextSite(Context);
SPWeb sitet = sitecollectiont.OpenWeb();
sitet.AllowUnsafeUpdates = true;
SPListCollection lists = sitet.Lists;
foreach (SPList list in lists)
{
if (list.Title == "Outstandings") //this D. library
{
SPListItemCollection items = list.Items;
foreach (SPListItem item in items)
{
SPFile file = item.File;
string docName = file.Name;
if (docName.Equals("Balance_343,35725.doc"))
{
SPField field = item.Fields.GetField("Document Library"); //this is column name
field.DefaultValue = "1234";
field.Update(true);
return;
}
}
}
but setting its value by defaultValue necver worked.
Please help to set the value as a link to Library.
Thanks
Needo
|
|
|
|
|
hi
i'd like to know how can i only get date part of a variable not the time part
for example i have a variable that its value is "1/1/2000 12:00AM" and i only want "1/1/2000"
thank you
|
|
|
|
|
myDate.ToShortDateString()
|
|
|
|
|
how can i specify certain file formats to be browsed by file upload control?
for example i just like my file upload control to browse JPG and GIF files
thank you
|
|
|
|