Is it possible to iterate through an unordered list like the following in codebehind?
[Code]....
I was hoping to iterate through all the li elements of the ul checking whether NavigateUrl is equal to the current url. If it is, I was going to add a CssClass to give it a different appearance.
I think I know how to compare it to the page's url and to how to add the css class. I'm just not quite sure how you iterate through li items using a HTML Generic control.
I have List (Of Report). Report has 90 properties. I dont want write them each and every propertiy to get values for properties. Is there any waht to get propeties values from the List
Ex:
Dim mReports as new List(Of Reports) mReport = GetReports()
For each mReport as Report In mReports 'Here I want get all properties values without writing property names next
i m new to asp.net 3.5 linq and dnt worked much on generics.i m using IEnumerable to return set of results.i m binding this IEnumerable type method directly to datagrid source then it works fine.But i dnt knw how to iterate through this collection??Same way i m using List<String> to return columns like this
I need to iterate through a server share and list every file within every folder and write each file name with all of its attributes into a database table.I assume that using the FileInfo class and all of it's properties (CreationTime, DirectoryName etc etc) is the best way but I have no idea of how to start.I'm starting to create a web app
As I iterate through a DataTable object, I need to check each of its DataRow objects against the items in a generic string List. I found a blog post using the List's Find method along with a delegate, but whereas that example has a separate class (Person), I'm attempting something like the following using an instance of the string object:
// My definition of the List object. List<string> lstAccountNumbers = new List<string>(); ... // I populate the List via its Add method. ... foreach (DataRow drCurrentRow in dtMyDataTable.Rows) { if (lstAccounts.Find(delegate(string sAccountNumber) { return sAccountNumber == drCurrentRow["AccountNumber"]; }) { Found_DoSomething(); } else { NotFound_DoSomethingElse(); } }
However, with this syntax I'm receiving "Cannot implicitly convert type 'string' to 'bool'" for the if block. what I'm doing wrong and how best to accomplish what I'm trying to do?
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'm trying to read all filenames from a specified (server- not client) folder, and insert all the filenames into a javascript Array. It should behave like the Directory.GetFiles method in ASP.NET C#. I created a new array, and I just need the loop method (Javascript or jQuery) to iterate in the specific folder, and insert all the filenames into the array.
I have an ASP.NET webservice method that returns a generics list (List'<'Construct>) serialized as JSON, using code such as this:
[WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [ScriptService] public class TestService : System.Web.Services.WebService { [WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public string GetOccupationListJSON(int SOCLevel) { Construct NewConstructList = new ConstructList(); DataContractJsonSerializer serializer = new DataContractJsonSerializer(ConstructList.GetType()); MemoryStream ms = new MemoryStream();
[Code]....
I assumed (from looking elsewhere) that accessing the JSON data through the index would provide me with access to the underlying object at that index, so that I can then work with it to access its properties. However, when i=0 and I do var Construct = data[i]; I get the character at the i position of the data array ([), and in the next iteration I get the second character ({). So clearly I am accessing the elements of a string array rather than the JSON data object.How do I make sure that the data returned by the webservice gets into proper JSON format, so that I can iterate through the object elements within it?
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" />
actually i was displaying 10 of my products images on my home page and i want that they should rotate or change one by one after 5 seconds themselves. How can i do so by using asp.net,ajax,javascript
Is it possible to edit images using a javascript library and then send the edited image to the server for saving.
Edits will be in real time, means the user can see the edit result in the same time he is editing without the need to refresh the page.
I want a javascript library to do some edits on an image on a webpage 'such as crop, resize, rotate,...' and send send the edited result to the server.
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"
in the clientside pageLoad() function im trying to get the multiview active index and postback to my updatepanel1 after 5 seconds only if active index is 2following code:
<script type="text/javascript" language="JavaScript"> function pageLoad() { if (document.getElementById('MultiViewManage').getAttribute("ActiveViewIndex") == 2) { window.setTimeout("__doPostBack('UpdatePanel1','')",5000); } } </script>
im getting null exeption or some kind of error what am i doing wrong?
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?
Now I want to attach to the click-event of every single li-element, so that if the user clicks on a div-element, detailed product-informationen should be loaded asynchronously into a details-pane. I know how I can use jQuery to invoke an action-method ajax-style and also how to display the json-result which contains the product-details, BUT I have no idea, how I could attach the onclick-event to every single div, so that I can use the productId to load the details.
Problem:in the Host(not local system) Captcha show only one image that created for first time,but in my local system every things is right,and captcha change for every page load...
i think image can't find server folder address and always show first produced image!!!
see code:
[Code]....
where is the problem?
notice:when i see server "Upload" folder and "AddIntuitionReflexRandom.gif" file,content change truly,but that can't show in my image.
I have List (of class). having 1800 of count and each object has 90 properties. When I terate earch with 90 properties taking more and more time. How to resolve this
Dim cellIntStyle As HSSFCellStyle = hssfworkbook.CreateCellStyle cellIntStyle.DataFormat = HSSFDataFormat.GetBuiltinFormat("#") Dim cellDateStyle As HSSFCellStyle = hssfworkbook.CreateCellStyle cellDateStyle.DataFormat = HSSFDataFormat.GetBuiltinFormat(Format ("dd-MMM-yyyy")) For Each mReport As Report In dtExcel row = sheet1.CreateRow(iRow) j = 0 For Each prop As PropertyInfo In props Dim value As Object = prop.GetValue(mReport, Nothing) If IsInt(value) Then CreateRow(row, j, CType(value, Integer), cellIntStyle) ElseIf IsDate(value) Then CreateRow(row, j, String.Format("{0:dd-MMM-yyyy}", value), cellDateStyle) Else CreateRow(row, j, value) End If j = j + 1 Next iRow = iRow + 1 // Coming here taking so long... how to make it fast. Next Private Sub CreateRow(ByRef row As HSSFRow, ByVal colId As Integer, ByVal value As String) row.CreateCell(colId).SetCellValue(value) End Sub Private Sub CreateRow(ByRef row As HSSFRow, ByVal colId As Integer, ByVal value As Integer, ByVal cellStyle As HSSFCellStyle) Dim cell As HSSFCell = row.CreateCell(colId) cell.SetCellValue(value) cell.CellStyle = cellStyle End Sub Private Sub CreateRow(ByRef row As HSSFRow, ByVal colId As Integer, ByVal value As String, ByVal cellStyle As HSSFCellStyle) Dim cell As HSSFCell = row.CreateCell(colId) cell.SetCellValue(value) cell.CellStyle = cellStyle End Sub
i have two drop down list in web form..for both of them i've used following code to bind with sql..but whenever i'm trying to bind second drop down list with same method..it's giving error.. the code i've used: