|
One method would be to add a column to your table like, "Next Update DateTime".
Your service would do something like this:
1)Read a row from the table.
2)Call the webservice, do your compare, etc, take the current datetime and add the ScheduleType+Time and set the "Next Update DateTime" to that value.
3) Wait 5 min
4) Loop through the table to see if the "Next Update dateTime" has been reached, if so do your update thing.
That is a very basic idea. As you add rows to the table, you don't have to change your core logic. It may not be the best solution, but it is straight forward.
Good luck. 
|
|
|
|
|
Hi,
Thanks for the reply i completed the task
|
|
|
|
|
hi
Is it possible to run a asp.net web application run without web.config file if i provide all setting in machine.confg file?
|
|
|
|
|
YES : Because all the configuration settings will be available under MACHINE.CONFIG file, by default these settings will be applied to all asp.net applications. The MACHINE.CONFIG file will be automitacally loaded when .net framework is installed.
Thanx and regards,
Tash
|
|
|
|
|
hi guys
i want to give a download in asp.net for mobile
this code is true for computer but in mobile not true
in computer show download form but in mobile show the content of file
such as a html page open page a txt file show content of file a zip file show binery code and such
whats problem
|
|
|
|
|
 my code is
<br />
{<br />
string filepath = Server.MapPath("test.bhd");<br />
<br />
FileInfo file = new FileInfo(filepath);<br />
<br />
if (file.Exists)<br />
{<br />
Response.ClearContent();<br />
<br />
Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);<br />
<br />
Response.AddHeader("Content-Length", file.Length.ToString());<br />
<br />
Response.ContentType = ReturnExtension(file.Extension.ToLower());<br />
<br />
Response.TransmitFile(file.FullName);<br />
<br />
Response.End();<br />
}<br />
}<br />
private string ReturnExtension(string fileExtension)<br />
{<br />
switch (fileExtension)<br />
{<br />
case ".htm":<br />
case ".html":<br />
case ".log":<br />
return "text/HTML";<br />
case ".txt":<br />
return "text/plain";<br />
case ".doc":<br />
return "application/ms-word";<br />
case ".tiff":<br />
case ".tif":<br />
return "image/tiff";<br />
case ".asf":<br />
return "video/x-ms-asf";<br />
case ".avi":<br />
return "video/avi";<br />
case ".zip":<br />
return "application/zip";<br />
case ".xls":<br />
case ".csv":<br />
return "application/vnd.ms-excel";<br />
case ".gif":<br />
return "image/gif";<br />
case ".jpg":<br />
case "jpeg":<br />
return "image/jpeg";<br />
case ".bmp":<br />
return "image/bmp";<br />
case ".wav":<br />
return "audio/wav";<br />
case ".mp3":<br />
return "audio/mpeg3";<br />
case ".mpg":<br />
case "mpeg":<br />
return "video/mpeg";<br />
case ".rtf":<br />
return "application/rtf";<br />
case ".asp":<br />
return "text/asp";<br />
case ".pdf":<br />
return "application/pdf";<br />
case ".fdf":<br />
return "application/vnd.fdf";<br />
case ".ppt":<br />
return "application/mspowerpoint";<br />
case ".dwg":<br />
return "image/vnd.dwg";<br />
case ".msg":<br />
return "application/msoutlook";<br />
case ".xml":<br />
case ".sdxl":<br />
return "application/xml";<br />
case ".xdp":<br />
return "application/vnd.adobe.xdp+xml";<br />
default:<br />
return "application/octet-stream";<br />
}<br />
}<br />
|
|
|
|
|
Hi guyss.. Actually in my web page a person-X can assign a task to another person-Y and on the dash board of Y that task will be displayed on opening the task it will show him the details of the task. the task can be completed by a series if activity. Now i have a button called add activity on clicking the button it redirects to the activity page. Now here i need some help actually the activity page has a status dropdownlist which has two options which is open and closed.. a person can create an activity with status open and later when the activity is over he can edit the activity and change the status to close.. Now when a person changes the activity status to close i need a confirmation box to popup asking the user whether the TASK IS COMPLETED (Not the activity) if the user clicks ok then the task is closed otherwise wen he clicks cancel button it should just update the activity status. Now i have made the confirmation box to popup but the problem is i am using javascript for the confirmation box when user clicks ok it closes the task but wen i click cancel i cant make it to just update the activity status.. Im confused wher do i write the code when the user clicks cancel button.. please guide me.. My code is as follows:
When the status is changed to close:
private void ddlStatus_SelectedIndexChanged(object sender, System.EventArgs e)
{
if(ddlStatus.SelectedValue.ToString() == "Closed")
{
btnAdd.Attributes.Add("onClick","javascript:return(confirm('Are you sure you want to close the Activity?'));");
}
}
When user clicks ok the button click event gets fired:
private void btnAdd_Click(object sender, System.EventArgs e)
{
if(ds.Tables.Count > 0)
{
if(ds.Tables[0].Rows.Count > 0)
{
int id = Convert.ToInt32(ds.Tables[0].Rows[0].ItemArray[0]);
UpdateTextField(id,1,txtDesc.Text.Trim().Replace("'","''"));
UpdateTextField(id,2,txtIssues.Text.Trim().Replace("'","''"));
UpdateTextField(id,3,txtBusTechAdv.Text.Trim().Replace("'","''"));
}
}
}
but where do i place my code when the user clicks cancel button bcoz on clicking cancel idont think any event gets fired.. Please advise me..
Thanx in advance,
Tash.
|
|
|
|
|
Hi,
I have a huge page with around 10 custom controls which are shown/hidden depending on what the user chooses in certain drop-down lists. (Please don't ask why the design is like this).
Now each of these controls have ASP.Net validators such as RequiredFieldValidator , CompareValidator , etc.
Now I'm having a problem of tracing which validator failed if the parent control is hidden in the page (Visible = false; ).
Is there an easy way to test this? The only way I can think of is to change the code temporarily and show all the controls all the time just to actually see which one has the problem. But maybe there's a better way.
Thanks in advance.
Rafferty
Rafferty
|
|
|
|
|
You can have better approach on this. You can create several validation group based on the dropdownlist value. And validate only the groups that are visible. So the validators in different group, would not be fired.
Another way, you can enable and disable the validators based on the dropdown selection, as you must be what all validators you need to fire , according to dropdown value.
You can have a look one of my article on ASP.NET validators.
Exploring ASP.NET Validators
|
|
|
|
|
Hi Brij!
Thanks for the reply. That's a good idea... I think I'll do that for the newer pages.
However, I don't have the budget to change the validation group of this page that we're tracing.
Do you know of a quick (maybe dirty) way of tracing and knowing which validation control is failing?
Thanks again.
Rafferty
|
|
|
|
|
Hi,
I had a procedure which returns 5 result sets. Now i want to export 3 results sets in 1 excel sheet and the remaining 2 resultsets in another excel sheet. Can we do this in C#.net code and how.
Thanks,
Ram
|
|
|
|
|
|
|
Dear sir,
==>I had A login Page.
==> Every User Will Access the application After The Successfull Login.
==> After Successfull Login Im Storing The Username In a Sesssion.
==> Because I Have To Use The Username In Several Pages in my webapplication.
==> until this i had no problem.
==> now the probelm arised because of the following case..
==> let the user 'A' be logged on to the application and working.
==> the the session will store the username of 'A'.
==> the problem is If another user 'B' logged on to the application,then the session is overwritted by the by the 'B's user name and i m losing the 'A's user name which is stored previously in the session.
==>Now what i have to know is Is there Any Way to create a dynamic session which means if a user logged on then a session to be created for him independent of othe users..
thanks in advance.
vishnu.
|
|
|
|
|
Sessions are independent, for each user in each browsing session. Try logging in as user A in IE, then as user B in Firefox and you'll see all is well. But of course only one user can be logged in on the same computer using ther same browser at the asme time.
|
|
|
|
|
Dear Sir,
First Of All Thanks For Replying me. Now Actually My Problem Is Suppose If The User 'A' Is logged on to the system "A"(for ex). Now If The Same User 'A' HAs Logged On to Another System say "B" then Im Prompting That "You are Already logged on another system.do you want to end that session?" if the user clicks ok then i have to end the session of user "A" who is logged on to the system "A". now he should logged on to the system "B". Is there Any way to solve my problem?
Thanking You Sir,
vishnu.
|
|
|
|
|
First thing, you have very wrong Idea about session.
Session object is unique for every user.means, data stored by a user in session would not be override by another user's session data data.
You must be doing something wrong.
For details, have a look one good link on CP itself.
Exploring Session in ASP.Net
|
|
|
|
|
vishnukamath wrote: the problem is If another user 'B' logged on to the application,then the session is overwritted by the by the 'B's user name and i m losing the 'A's user name which is stored previously in the session
Hi,
Are you sure that you are using Session object (which is for each users) and not Application state (which is common for all users or sessions)
Eg:
Session["UserName"] = txtUserName.Text;
Application["Message"] = "Message to All users";
|
|
|
|
|
Hi,
Where can I downloadthe UFrame from? there is not download release available on CodePlex? any idea? or any idea of simillar control?
Thanks
|
|
|
|
|
jrahma wrote: Where can I downloadthe UFrame from? there is not download release available on CodePlex? any idea? or any idea of simillar control?
Do you mean this[^] one? If yes then the page has link for Codeplex too. Nice one.
thatraja |Chennai|India|
Brainbench certifications Down-votes are like kid's kisses don't reject it Do what you want quickly because the Doomsday on 2012
|
|
|
|
|
I have the following code which simply display a timer within the UpdatePanel but the problem, I have another UpdatePanel [LoginPanel] in the page which should also Update always but with a different criteria .. here is the problem.. the LoginPanel is getting refreshed withthe time of the CurrenTTimePanel as well? why is that?
<dxt:ASPxTimer ID="timerClock" runat="server" Interval="1000" OnTick="timerClock_Tick" />
<asp:UpdatePanel runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="timerClock" />
</Triggers>
<ContentTemplate>
<asp:Table runat="server" Width="120" BorderWidth="0" CellPadding="0" CellSpacing="0">
<asp:TableRow>
<asp:TableCell HorizontalAlign="Center" VerticalAlign="Middle"><dxe:ASPxImage ID="imageFlag" runat="server" ImageUrl="~/images/flags/ar-BH.gif" /></asp:TableCell>
<asp:TableCell HorizontalAlign="Center" VerticalAlign="Middle" Width="100%"><dxe:ASPxLabel ID="lblCurrentTime" runat="server" Font-Bold="true" Text="Loading.." /></asp:TableCell>
</asp:TableRow>
</asp:Table>
</ContentTemplate>
</asp:UpdatePanel>
|
|
|
|
|
Change the value for Mode Always to Conditional to LoginPanel
thatraja |Chennai|India|
Brainbench certifications Down-votes are like kid's kisses don't reject it Do what you want quickly because the Doomsday on 2012
|
|
|
|
|
Hi,
I am developing a simple web application in ASP.net.
I would like to know in database connection if I face with error how I should show it. do I have to use java script? because unlike desktop application can't use message box.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Data;
using System.Data.Sql;
using System.Configuration;
namespace Test.DataAccessLayer
{
public class PersonDataAccess
{
SqlConnection Conn = new SqlConnection(ConfigurationManager.ConnectionStrings["HostelConnectionString"].ConnectionString);
public void insert()
{
try
{
Conn.Open();
}
catch (Exception ex)
{
????????????????????????????????????????????????????????????????????????????
}
}
}
}
|
|
|
|
|
you don't have to use javascript, you can catch the exception and assign ex.message to a label's text.
if you still want to use a message box, you do have to use javascript(you can download a exist class)
|
|
|
|
|
you can show your message, by using Java script alert Message
as
Response.Write("<script>alert('Your Message')</script>");
or you can also use custom error concept to show your message while a error generate
follow link Custom Errors in ASP.NET[^]
|
|
|
|