|
Hi everyone.
I'm building a web portal and i have a question.
I want to add the content of two TextBoxes in one page and show the result in another textbox, but i don't want the textchange event to make postback because the page has a lot of controls and data. I think i have to make a javascript function for that but i dont know how to raise the events on the client side and i dont know how to pass the controls into the the javascript function so that i can some the values.
Thanks programing brothers.
|
|
|
|
|
So maybe a google for a javascript tutorial might be reasonable next step...
|
|
|
|
|
I have already done that reasonable step before i post my question here LOL. But i couldn't understand so i decided to ask you guys because i think that codeproject is one of the best sources of programming ideas and knowledge.
|
|
|
|
|
many option for your question.
(1)If you want to add textboxes content on server:
Make autopostback property of both the textbox is false. when you submit form the textchange event raise first then button click event raised.
(2) If you want to add textbox content in client: Then you must write javascript like this.
function add()
{
document.getElementbyId("Textbox3").value=document.getElementbyId("Textbox1").value + document.getElementbyId("Textbox2").value
}
you can call this function on lostFocus of textbox2.
One thing note down, Asp.net changes the ID and name of the control specailly when master paged are used. Check control ID from output of the page from(view\pagesource)and use that id in place of textbox1 2 or 3.
The miracle is this--the more we share, the more we have.
|
|
|
|
|
Cool i understood that thanks, but what about raise events in the client side?
I don't want a postback to happen, I wish only to execute an action on the client-side when a textBox is changed.
By the way, the textbox is in a FormView, within a UpdatePanel, on a page that has a MasterPage.
|
|
|
|
|
If you want to use javascript, my suggestion is use html textbox, menas
make it run at server. Now you can find lots of event. You can use control and event like this
If you use master pages, Update panels etc the again, first check the name of the control from (view\source)in IE.
The miracle is this--the more we share, the more we have.
|
|
|
|
|
How to remove checked nodes in a treeview
|
|
|
|
|
|
i want to remove the checked nodes from a treeview.It is not there in the forum.
|
|
|
|
|
|
Hi,
hope this helps:
public void clear(TreeNodeCollection nodes)
{
foreach (TreeNode tn in nodes)
{
tn.Checked = false;
clear(tn.ChildNodes);
}
}
clear(mytree.Nodes);
Let me know , It helped u or not..
|
|
|
|
|
Hi ,
This will remove the entire parent node but i want to delete all checked node whether it is parent node or child node that does'nt matters
|
|
|
|
|
if (TreeView1.Nodes.Count > 1) {
int i = TreeView1.Nodes.Count - 1;
do {
if (TreeView1.Nodes(i).Checked) {
TreeView1.Nodes(i).Remove();
}
i -= 1;
}
while (!(i == 0));
}
Try this.. And give feed back
|
|
|
|
|
Thanks for ur Reply..
Treeview1.Nodes[i].Remove() will remove only the parentnode.if i want to select one childnode from a parent and another chilnode from another parent means what should i do...i think it is only possible with javascript wat is ur opinion...
|
|
|
|
|
How to make edit,Update,Delete in datagrid in windows application Using C#
|
|
|
|
|
see this
http://www.codeproject.com/KB/cs/N-Tier22.aspx[^]
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswam@its.co.za
|
|
|
|
|
Booma wrote: How to make edit,Update,Delete in datagrid in windows application
Then why are you asking this in asp.net forum?
Apurva Kaushal
|
|
|
|
|
Hello,
I want to create a mail application which include sent,inbox,delete message,get message etc.
Plz. help me.
Thanks in advance
Jitendra
send message on jitendramcu@gmail.com
jitendra kumar
|
|
|
|
|
That is too vague. What area you are facing problem? What have you tried? Come with specific questions.
|
|
|
|
|
Jitendra_Web_Developer wrote: want to create a mail application which include sent,inbox,delete message,get message etc.
Plz. help me.
What help, to create the whole application for you.
Apurva Kaushal
|
|
|
|
|
Hi,
How we can send webmail to Yahoo id. can i get some source code for this?.
|
|
|
|
|
hi
i am not getting clear about your question, do you want to send mail to yahoo id
|
|
|
|
|
it is a contact us form. so users want to send mail to my yahoo id.
|
|
|
|
|
use this function in vb.net
Imports System.Net.Mail
Public Function sendMails(ByVal toEmail As String, ByVal toName As String, ByVal fromEmail As String, ByVal fromName As String, ByVal subject As String, ByVal mailBody As String, ByVal host As String) As String
Try
Dim msg As MailMessage = New MailMessage
msg.From = New MailAddress(fromEmail, fromName)
msg.To.Add(New MailAddress(toEmail, toName))
'msg.To.Add(new MailAddress("destination2@domain.com","Addressee 2's Name"));
msg.Subject = subject
msg.Body = mailBody
msg.IsBodyHtml = True
msg.Priority = MailPriority.High
Dim c As SmtpClient = New SmtpClient("" & host & "")
c.Send(msg)
Return "Mail send successfully."
Catch ex As Exception
Return ("Send Email Failed.<br>" + ex.Message)
End Try
Return "Mail send successfully."
End Function
The miracle is this--the more we share, the more we have.
|
|
|
|
|
I Used this and different code from google also. but am getting the following error.Should i do some setting changes or something in the email account?
Send failure: System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 216.239.59.109:587 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) --- End of inner exception stack trace --- at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout) at System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) at System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpClient.GetConnection() at System.Net.Mail.SmtpClient.Send(MailMessage message) --- End of inner exception stack trace --- at System.Net.Mail.SmtpClient.Send(MailMessage message) at Mail.btSend_Click(Object sender, EventArgs e) in e:\Uzhavoor_Project\Mail.aspx.cs:line 46
|
|
|
|