How To Display Items Of Datalist One At A Time And Automaticaly Change After Few Seconds
Feb 15, 2011
I have to display customer's details in my home page. Now I am using datalist and marquee for it. But client's requirement is display one customer's details some seconds then next (dont want moving).
I have a label of time taken in datalist and i want to calculate the total time af all user in footer of datalist i have do this but i got the following error
Unable to cast object of type 'System.TimeSpan' to type 'System.IConvertible'. An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System .Invalid CastException: Unable to cast object of type 'System.TimeSpan' to type 'System.IConvertible'.Source Error:
Line 25: if(e.Item.DataItem!= null) Line 26: { Line 27: time_taken_total += Convert.ToDecimal(DataBinder.Eval(e.Item.DataItem, "Timer")); Line 28: } Line 29:
Means if i have a person name asim which is working on project and on same project he start n stop time (2 time) so how can i calculate the total time of only that person on that particular project ?
Means if i have a person name asim which is working on project and on same project he start n stop time (2 time) so how can i calculate the total time of only that person on that particular project ?
I have an ImageButton where I want to change Image every 3:rd second. (When pressing the button a browser will open with an URL with is the functionality I am after also) For the moment I do use this method with a Timer and it works fine except for one thing.
Every time the image change you can see in the bottom of the browserwindow, this message: "Downloading http://...... 1.jpg" etc....
It just "blinks" and it goes very fast but still it is kind of annoying in the long run...
So I wonder if I can find a better solution or if it is possible to Turn off this message to not be seen ?: "Downloading http://...... 1.jpg"
I had implemented the Ajax timer control to update Gridview data(along with Progress bar inside Gridview) after some interval of time.Below is the full code:
HMTL:
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"> <%--style & Script for progress bar in Gridview --%> <script type="text/javascript" src="//code.jquery.com/jquery-1.10.2.js"></script> <script type="text/javascript" src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script> <link href="css/jquery-ui.css" rel="stylesheet" />
I am trying to get my head around the ASP timer control. What I am trying to achieve is to get a page to reload every 60 seconds but change the url querystring everytime between 3 values
i.e. scroll through server/page.aspx?value=1 server/page.aspx?value=2 server/page.aspx?value=3
how I have though to do this is to use ASP code to grab the querystring value, and then create the next url. But I am having trouble passing that newly created url to a refresh control. im guessing HTML meta refresh is out of the question as I am using a variable. So from what I can see my option is to use the ASP timer control to count down (after the page has loaded) and after 60seconds load the next url.
If I enter the a location of: Latitude = 28 Degrees, 45 Minutes, 12 Seconds Longitude = 81 Degrees, 39 Minutes, 32.4 Seconds. It gets converted into Decimal Degrees format to be stored in the database with the following code:
Coordinates coordinates = new Coordinates(); coordinates.LatitudeDirection = this.radLatNorth.Checked ? Coordinates.Direction.North : Coordinates.Direction.South; coordinates.LatitudeDegree = this.ConvertDouble(this.txtLatDegree.Text); coordinates.LatitudeMinute = this.ConvertDouble(this.txtLatMinute.Text); coordinates.LatitudeSecond = this.ConvertDouble(this.txtLatSecond.Text); coordinates.LongitudeDirection = radLongEast.Checked ? Coordinates.Direction.East : Coordinates.Direction.West; coordinates.LongitudeDegree = this.ConvertDouble(this.txtLongDegree.Text); coordinates.LongitudeMinute = this.ConvertDouble(this.txtLongMinute.Text); coordinates.LongitudeSecond = this.ConvertDouble(this.txtLongSecond.Text); //gets the calulated fields of Lat and Long coordinates.ConvertDegreesMinutesSeconds(); In the above code, ConvertDouble is defined as: private double ConvertDouble(string value) { double newValue = 0; double.TryParse(value, out newValue); return newValue; } and ConvertDegreesMinutesSeconds is defined as: public void ConvertDegreesMinutesSeconds() { this.Latitude = this.LatitudeDegree + (this.LatitudeMinute / 60) + (this.LatitudeSecond / 3600); this.Longitude = this.LongitudeDegree + (this.LongitudeMinute / 60) + (this.LongitudeSecond / 3600); //adds the negative sign if (LatitudeDirection == Direction.South) { this.Latitude = 0 - this.Latitude; } else if (LongitudeDirection == Direction.West) { this.Longitude = 0 - this.Longitude; } }
If I don't make any change to the latitude or longitude and I click Apply Changes which basically does the above calucation again, it generates a different latitude and longitude in the database. This happens every time I go to edit it and don't make a change (I just click Apply Changes and it does the calculation again with a different result). In the above scenario, the new Latitude and Longitude is: Latitude = 28 Degrees, 45 Minutes, 12 Seconds Longitude = 81 Degrees, 40 Minutes, 32.4 Seconds If I do it again, it becomes: Latitude = 28 Degrees, 45 Minutes, 12 Seconds Longitude = 81 Degrees, 41 Minutes, 32.4 Seconds The other part of this is that when I go into edit, it takes the decimal degrees format of the latitude and longitude and converts it to the degrees minutes seconds format and puts them into their respective textboxes. The code for that is:
From the above examples, you can see that the Minute kept increasing by 1, which would indicate why it is generating a different latitude and longitude in decimal degrees in the database, so I guess the problem is more in the above area, but I am not sure where or why it is doing it?
For eg..in Stackoverflow site, after giving answer, if we are refreshing the page, it displays the answer with orange color and turns to white beautifully?
How we have to do this ? Can it is possible in asp.net - C# ?
I am trying to implement a license in which we will provide a license file which will be placed on the server root directory.This license file contain encrypted strings which have ServerName, Concurrent Sessions , Timeperiod.n this i have two issue.How could i calculate time as user can change server time.How could i maintain the concurrent login sessions [because i can't catch the event hen user close the browser].I will welcome any tehcnique otehr then javascript solution.[even polling] but i can't save session information in database
For example in my datalist if Eval("OptionJ").Tostring = Null I would like the function GetVisible to set visibility of the radio button to false like so:
I have a datalist, this datalist control is bind, when user select control filters,i am looking a way to sort this datalist control for example like asc or desc or price.
What I'm trying to do is on page load display either of two controls based on how many items are in a datalist. For instance, if the datalist only contains 1 item I want it to display
Literal1.Visible = true;
If there is more than 1 item in the datalist, show
Find if the current time falls within hourly ranges and display the start hour and end hour of that range in labels.
Examples:
If the current time is 8:46am, label startTime would return "8am" and label endTime would return "9am" If the current time is 10:01pm, label startTime returns "10pm" and label endTime returns "11pm" If the current time is 12:59am, label startTime returns "12am" and label endTime returns "1am"
I have been working with the C# TimeRange class but not getting what I need.
i want to use a Datalist to list products from sqldatasource. When i select the Product i would like to retrieve the associate Product value in the code behind page so that i may use it to display data in Grid.