|
Hi,
I am using DevEpress textbox and I want to make validation expression for it.
I want the entry to be MINIMUM 10 digits no matter what is it, characters, numeric, special characters or mix BUT not SPACES
how can I make sure thing?
|
|
|
|
|
|
Hello,
plz help me i want to send email from asp.net web application in our godaddy server.
.......................
|
|
|
|
|
|
For GoDaddy, you need to use:
servername: relay-hosting.secureserver.net
port: 25
Thus, email code should be something like:
MailMessage msg = new MailMessage();
msg.From = new MailAddress("myEmail@abc.com","My Company");
msg.To.Add("toFriends@abc.com");
msg.Subject = "My Subject";
msg.Body = "My Message";
msg.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient("relay-hosting.secureserver.net", 25);
smtp.Send(msg);
Try!
|
|
|
|
|
this code have some chinese,if you know
#region :Send Email
///
/// Send Email(Success return true, faile retuan false)
///
/// <param name="strBody" />content
/// <param name="strSubject" />theme
/// <param name="strFrom" />send email
/// <param name="strFromPwd" />send keys/param>
/// <param name="strTo" />get email
/// <returns>Success return true, faile retuan false
public static bool SendMail(string strBody, string strSubject, string strFrom, string strFromPwd, string strTo, string strSmtp)
{
bool b = false;
// 邮件信息(属性)
MailMessage mm = new MailMessage();
mm.From = new MailAddress(strFrom);
mm.Subject = strSubject;
mm.SubjectEncoding = Encoding.UTF8;
mm.Body = strBody;
mm.BodyEncoding = Encoding.UTF8;
mm.IsBodyHtml = true;
mm.Priority = MailPriority.Normal;
//// 获取 SMTP 服务器
//string Smtp = string.Empty; // smtp 地址
//// 取得后部分的 smtp地址
//string strSmtp = strFrom.Substring((strFrom.IndexOf("@") + 1));
//Smtp = "smtp." + strSmtp;
// 发送邮件
SmtpClient sc = new SmtpClient(strSmtp);
// 用户凭证 (email 地址和密码)
sc.Credentials = new NetworkCredential(strFrom, strFromPwd);
if (strSmtp == "gmail.com")
{
sc.EnableSsl = true;
}
sc.Timeout = 5000;
mm.To.Clear();
mm.To.Add(strTo);
try
{
sc.Send(mm);
b = true;
}
catch (ArgumentNullException ex)
{
b = false;
}
catch (SmtpException smtpEx)
{
b = false;
}
catch
{
b = false;
}
// 释放资源
mm.Dispose();
return b;
}
#endregion
|
|
|
|
|
Try this..I hope this what you want..Let us know if this doesn't solve your problem..
string strNoReplyEmail = "noreply@hotmail.com";
private void SendEMail(string strLastName, string strFirstName, string strEmail)
{
MailMessage objMail = new MailMessage(strNoReplyEmail, strEmail);
objMail.Subject = "Test Email";
objMail.Body = @"Dear " + strFirstName + " " + strLastName + ", \n\n"
+ "This is the test email. Please do not reply to this email."
+ " \n\n"
+ "Thank you,"
+ "\n"
+ "Administrator";
SmtpClient sc = new SmtpClient();
sc.Host = "www.hotmail.com";
sc.Send(objMail);
}
Dhyanga
|
|
|
|
|
Hi
I've been working the past three years with Java programming language, but recently for a master thesis project i would prefer to use a different language such as ASP.NET(C#) to extend my Knowledge.
I would like to know what kind of tools are available to build enterprise applications? in this case i will build a Portal with Human Resources Functionalities.
Im looking for something such as SmartClient (http://www.smartclient.com) or somethinng similar.
Can some expert give me advice on the available tools? the portal is planned to be used by a lot of users at the same time so i want to follow good pratices aswell.
Thanks for any help
|
|
|
|
|
|
Are you planning to build the application from scratch or just want to use a ready-to-use solution?
|
|
|
|
|
Hi thanks for the reply
I want to build the application from scratch. Mainly it will be a web portal where users can register and run human resources processes.
Will have a look at devexpress tools, thanks for the link
Thanks for any input
|
|
|
|
|
in fact! ASP.NET is not well with this.
and the php is better,you can try it
|
|
|
|
|
public partial class _Default : System.Web.UI.Page
{
DataSet ds = new DataSet();
protected void Page_Load(object sender, EventArgs e)
{
grd_bind();
}
private void grd_bind()
{
SqlDataAdapter adp = new SqlDataAdapter("select * from tbdep; select * from tbemp7", ConfigurationManager.ConnectionStrings["cn"].ConnectionString);
adp.Fill(ds);
GridView1.DataSource = ds.Tables[0];
GridView1.DataBind();
}
public DataSet getdata(Int32 dno)// public because we access it in HTML
{
string qry = "select * from tbemp7 where edno=" + dno.ToString();// we can't use it as performance low as it execute much a times
DataView dv;//to sort data, to filter data, to navigate data on dataset we use it
dv = ds.Tables[1].DefaultView;
dv.RowFilter = "edno=" + dno.ToString();
return dv;
}
}
IN HTML :
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
Width="778px" BackColor="LightGoldenrodYellow" BorderColor="Tan"
BorderWidth="1px" CellPadding="2" ForeColor="Black" GridLines="None"
Height="281px">
<AlternatingRowStyle BackColor="PaleGoldenrod" />
<Columns>
<asp:TemplateField HeaderText="department">
<ItemTemplate>
<b>
dep no:</b><%#Eval("dno") %><br />
<b>dep name:</b><%#Eval("dname") %></ItemTemplate></asp:TemplateField>
<asp:TemplateField HeaderText="emp detail">
<ItemTemplate>
<asp:GridView ID="Gridview1" DataSource='<%#getdata(Convert.ToInt32(Eval("dno"))) %>' AutoGenerateColumns="false" Width="100px" runat="server"/>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="EMPNO" DataField="empno" />
<asp:BoundField HeaderText="NAME" DataField="ename" />
<asp:BoundField HeaderText="ADDRESS" DataField="eadd" />
<asp:BoundField HeaderText="SALARY" DataField="esal" />
</Columns>
|
|
|
|
|
That's pretty bad programming:
1. You populate a dataset and assign it to grid in code behind file without IsPostback condition leading to data load on every postback
2. You again populate a dataset, use dataview to filter and assign again to another grid with same ID as previous one in aspx
3. You use wrong table index while assigning it to dataview.
4. You assign a number to datasource of inner grid instead of a view!
Try:
1. Make sure you have different names of the grids.
2. While fetching a table from database, only one table is returned for a select statement, so you use ds.Tables[0]
3. Look at this article on how to use Nested Grid:
MSDN: Walkthrough: Creating a Nested GridView Control[^]
Editable Nested GridView (All-in-One)[^]
|
|
|
|
|
I'm using a FormView that is bound to an ObjectDataSource. My ObjectDataSource is bound to a Linq2Sql table object. Update and delete are working fine. I'm having problems with insert. When I try and insert the DataItem that the FormView is bound to is null. How do I set the DataItem to a new entity object?
|
|
|
|
|
i tried to load pages from database and make numbers down the page loader but it does not work and it change the style of masterbage right side of master page show down the page loader
|
|
|
|
|
Your question makes no sense: try to rephrase or get someone who speaks English to translate or you won't get an answer.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
Based on the words used in your question, you have page-design issue. You need to share the related code to get some insight.
Surely English is not your first language. Please get someone who can write/frame a proper question for you such that you can get some help. For now, it's difficult to make much out of what you ask.
|
|
|
|
|
hello.
I have design a form with asp.net4 which is binded to Sqlserver 2008r2 , my form is made by Asp.Net formview that has to insert data into the database . i have also included my formview inside an UpdatePanel , but when press the insert button this exception in the is generated:
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Input string was not in a correct format.
this exception occures in a locked dynamic page: ScriptResource.axd
but whenever i remove the UpdatePanel from my form this exception doesn't occure again , but the other Unhandled exception occures :
(in fact i don't want to remove UpdatePanel)
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
<div style="display: block;" id="premain0" class="pre-action-link" width="100%">[FormatException: Input string was not in a correct format.] System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +9591147 System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +119 System.String.System.IConvertible.ToInt32(IFormatProvider provider) +46 System.Convert.ChangeType(Object value, TypeCode typeCode, IFormatProvider provider) +297 System.Web.UI.WebControls.Parameter.GetValue(Object value, String defaultValue, TypeCode type, Boolean convertEmptyStringToNull, Boolean ignoreNullableTypeChanges) +126 System.Web.UI.WebControls.Parameter.GetValue(Object value, Boolean ignoreNullableTypeChanges) +63 System.Web.UI.WebControls.SqlDataSourceView.AddParameters(DbCommand command, ParameterCollection reference, IDictionary parameters, IDictionary exclusionList, String oldValuesParameterFormatString) +550 System.Web.UI.WebControls.SqlDataSourceView.ExecuteInsert(IDictionary values) +306 System.Web.UI.DataSourceView.Insert(IDictionary values, DataSourceViewOperationCallback callback) +89 System.Web.UI.WebControls.FormView.HandleInsert(String commandArg, Boolean causesValidation) +377 System.Web.UI.WebControls.FormView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +612 System.Web.UI.WebControls.FormView.OnBubbleEvent(Object source, EventArgs e) +95 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37 System.Web.UI.WebControls.FormViewRow.OnBubbleEvent(Object source, EventArgs e) +112 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37 System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +125 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +167 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563</div>
someone said to me i should convert string datatype to int, but i don't know how & where should i modify the code ?
|
|
|
|
|
It's seems something issue with Data conversion. So check carefully for all data types wherever converting any input data.
One more thing:
Try to set the page attribute :
EnableEventValidation="false"
Parwej Ahamad
|
|
|
|
|
Hi,
As per my understanding, its a data convertion issue, its trying to convert from a string to int.
you can try below:
CAST(MyVarcharCol AS INT))
or
CONVERT(INT, MyVarcharCol)
|
|
|
|
|
You'll need to see what the actual value is. Step through with a debugger and/or add a try/catch to log the value somewhere.
|
|
|
|
|
I have a C# 201o web form application that I just deployed to a test server that is similar to the production server running iis 7. The entire website works fine but the screens only stay active for an inconsistent amount of time. The entire website throws you back to the main logon screen. Thus can you tell me what kind of a setting for the entire web site and/or iis server that needs to be changed so the server and /or application does not throw you out to the logon page after being on the website for 5 minutes or less?
|
|
|
|
|
|
This article says the default timeout for asp.net is 20 minutes. However, my website closes down after 3 to 5 minutes at the most.
Thus do you think something else could be wrong? Do I just need to set the session timeout value since I do not have the value set?
|
|
|
|