|
1. you can use javascript setTimeout to call a function to post back automatically after a set time. or
2. you can add a meta tag for refresh=time
-----
|
|
|
|
|
WHICH WILL BE MOST PRACTICAL BECASUE I WANT IT TO POST BACK AS SOON AS NEW DATA IS FOUND IN A DATABASE. wILL IT NOT BE TOO MESSY TO JUST KEEP REFRESHING THE PAGE??HAVE YOU GOT ANY SAMPLE CODE FOR THE JAVASCRIPT SOLUTION OR ANY RESOURCES I CAN RESEARCH? THANKS
|
|
|
|
|
afaik, the client (browser) has no way to know if the data has changed on the server (database) unless you go post back the page to the server.
in the head section of asp page type this
setTimeout(postbackPage, 60000); // call postbackPage after 1 minute
function postbackPage() {
// submit the form
document.formname.submit();
// OR you can call click event of submit button
document.submitbutton.click();
}
-- modified at 15:11 Friday 19th October, 2007
-----
|
|
|
|
|
U are a Genius!!!I take it this refreshes the whole page...in order to reduce time it refreshes can i just refresh the table that holds the information.
|
|
|
|
|
in that case you have to use AJAX, if you know AJAX then convert your page to AJAX enabled page otherwise whole page has to be refreshed.
-----
|
|
|
|
|
ur requirement is growing as and when u find the solution for the previous question.
Regards
Sean
http://www.codepal.co.nr
|
|
|
|
|
I have an asp page wichh submit two fields, title and contents. Now if user types single code ('), or semi-colon (;) and replace (the word REPLACE) then on submitting the form, page crashes.
Any help please..
Note: it is working fine on development server (win 2003) but crashing on production server (win 2000)
-----
|
|
|
|
|
Please don't cross post.
I replied in the web development forum.
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
since single quote is a reserved character in SQL, u need to replcae it with some other character before inserting into the DB.u can easily use a simple 'replace' method.
like
replace("'","~")
Regards
Sean
http://www.codepal.co.nr
|
|
|
|
|
Thanks Sean. But this is not the problem, please see this for complete details.
-----
|
|
|
|
|
hi to all,
i have used this code wht is wrong with it plz tell me.
try
{
System.Web.Mail.MailMessage mail = new System.Web.Mail.MailMessage();
mail.To = "yogesh_softeorld@yahoo.co.in ";
mail.From = "yogeshdewangan97@gmail.com";
mail.Subject = "subjectdfsdfsdfdsfdsfd";
mail.Body = "bodygfsdffds";
mail.Fields["http://schemas.microsoft.com/cdo/configuration/smtpserverport"] = 25;
mail.Fields["http://schemas.microsoft.com/cdo/configuration/sendusing"] = 2;
mail.Fields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"] = 1;
mail.Fields["http://schemas.microsoft.com/cdo/configuration/sendusername"] = "yogeshdewangan97@gmail.com";
mail.Fields["http://schemas.microsoft.com/cdo/configuration/sendpassword"] = "*********";
mail.Fields["http://schemas.microsoft.com/cdo/configuration/smtpusessl"] = "true";
//SmtpMail.SmtpServer = "smtp.gmail.com";
System.Web.Mail.SmtpMail.SmtpServer = "smtp.gmail.com";
SmtpMail.Send(mail);
}
catch (Exception ex)
{
litStatus.Text = ex.ToString();
}
there is an exception generated....
System.Web.HttpException: The transport failed to connect to the server. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80040213): The transport failed to connect to the server. --- End of inner exception stack trace --- at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture) at System.Web.Mail.SmtpMail.LateBoundAccessHelper.CallMethod(Type type, Object obj, String methodName, Object[] args) at System.Web.Mail.SmtpMail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) --- End of inner exception stack trace --- at System.Web.Mail.SmtpMail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) at System.Web.Mail.SmtpMail.CdoSysHelper.Send(MailMessage message) at System.Web.Mail.SmtpMail.Send(MailMessage message) at _Default.Button1_Click(Object sender, EventArgs e) in e:\Yatra\Default.aspx.cs:line 44
wht can i do for sending email to client using coding
thank u (adv)
yogesh
|
|
|
|
|
|
hi
add namespace -using System.Net.Mail;
MailMessage Msg = new MailMessage();
SmtpClient MailObj = new SmtpClient('Gmail host name[like mail.gmail.com]');
MailObj.Credentials = new System.Net.NetworkCredential(username, password);
MailObj.DeliveryMethod = SmtpDeliveryMethod.Network;
Msg.From = new MailAddress("yogeshdewangan97@gmail.com", "yoges");
Msg.To.Add(new MailAddress("yogesh_softeorld@yahoo.co.in");
Msg.IsBodyHtml = true;
Msg.Subject = " cxczx";
Msg.Body = "zxcxzczc";
MailObj.Send(Msg);
Jintal Patel
|
|
|
|
|
hi friend
i have edting the value of app.config in windows application. code work properly its not give any error but its not change the value of app.config
plese help code:-
Public Sub asaas()
Dim XmlDoc As New XmlDocument()
'XmlDoc.Load(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile)
Try
XmlDoc.Load(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile)
' Navigate Each xml Element of app.Config file
Dim NodeList As System.Xml.XmlNode = XmlDoc.SelectSingleNode("/configuration/applicationSettings/filesave.My.MySettings/setting/value")
' Save app.config file
NodeList.InnerXml = TextBox1.Text
XmlDoc.Save(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
app.config:-
(?xml version="1.0" encoding="utf-8" ?)
(configuration)
(applicationSettings)
(filesave.My.MySettings)
(setting name="filesave_localhost5_Service" serializeAs="String")
(value)http://localhost/file/Service.asmx(/value)
(/setting)
(/filesave.My.MySettings)
(/applicationSettings)
(/configuration)
plese help argent
Piyush Vardhan Singh
|
|
|
|
|
Did you tried to get what is in InnerText, before assining a value, the problem coud be before assaining value. Note that i can't try, because i dont have accsess to my pc.
Did you checked you gave app.config write permision?
|
|
|
|
|
I am trying to post information from a form to a database but i keep getting the following error:
ADODB.Recorset: The connection cannot be used to perform this operation. It is either closed or invalid
error on line 9.
heres the code
<%
DIM objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath ("guestbook.mdb")
objConn.Open
DIM objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
'objRS.Open "tblusers", adLockOptimistic, adCmdTable
objRS.AddNew
objRS("Email") = Request.Form("Email")
objRS("Name") = Request.Form("Name")
objRS("Comments") = Request.Form("Comments")
objRS.Update
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
<%
DIM strName
strName = Request.Form("Name")
Response.Write strName
%>,
|
|
|
|
|
solarthur01 wrote: The connection cannot be used to perform this operation. It is either closed or invalid
solarthur01 wrote: 'objRS.Open "tblusers", adLockOptimistic, adCmdTable
you've commented out the line that opens the recordset - does the error make more sense now?
|
|
|
|
|
i commented it because it came up with another error : ADODB.recordset arguements are of the wrong type, are out of acceptable range, or are in conflict with one another. Any ideas???
|
|
|
|
|
You haven't told the recordset to use the connection you've just opened...
|
|
|
|
|
is that not the adoCon.Open??? i thought i did that??
|
|
|
|
|
Yep, you opened a connection and then tried to open a recordset but you didn't associate the connection with the recordset. I forget the asp syntax off the top of my head.
|
|
|
|
|
so how can i correct that???do you know the syntax i can put in or where i can get from???thanks mate
|
|
|
|
|
objRS.Open "tblusers",objConn, adLockOptimistic, adCmdTable
this shud be the way to open the Recordset.ie the second parameter shud be the conenction object rather tan Locktype etc.
by the way u shud use an open sqwl statement other than the tblUsers in open statement ok.
Regards
Sean
http://www.codepal.co.nr
|
|
|
|
|
Hi,
I have a ContentPlaceHolder that is in a masterpage. I have a drop down in my masterpage, and this I am using to try and change certain details in the page(contentplaceholder). My issue is that when the dropdown's selected index event causes the postback (event in master page), it goes into the placeholder code first, before moving out into the masterpage, which seems highly incorrect to me 0_o.
any help on this would be greatly appreciated.
|
|
|
|
|
My sugesstion is to put the code in the content page (since you are trying to change the content page) and add a handler for the dropdownlist's event in the content page.
<br />
<br />
protected void Page_Init(object sender, EventArgs e)<br />
{<br />
DropDownList ddl = (DropDownList)this.Master.FindControl("DropDownList1");<br />
ddl.SelectedIndexChanged += new EventHandler(DropDownList1_SelectedIndexChanged);<br />
}<br />
<br />
<br />
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)<br />
{<br />
<br />
}<br />
<br />
I didn't get any requirements for the signature
|
|
|
|