Unnamed: 0
int64
302
6.03M
Id
int64
303
6.03M
Title
stringlengths
12
149
input
stringlengths
25
3.08k
output
stringclasses
181 values
Tag_Number
stringclasses
181 values
5,099,548
5,099,549
How to use array value in getElementById?
<p>I have php array like this :</p> <pre><code>&lt;form name="qwerty"&gt; &lt;? foreach ($products as $product)?&gt; &lt;input type="text" name="price1[]" id="&lt;? $product['id']?&gt;" value="&lt;? $product['price1']?&gt;" onkeyup="copy()"/&gt; &lt;input type="text" name="price2[]" id="&lt;? $product['id']?&gt;" value="&lt;? $product['price2']?&gt;" /&gt; &lt;? end foreach?&gt; &lt;/form&gt; </code></pre> <p>how to use that id value in this javascript code:</p> <pre><code>&lt;script type="text/javascript"&gt; function copy() { var cc1 = document.getElementById('???????'); var cc2 = document.getElementById('???????'); cc2.value = cc1.value; } &lt;/script&gt; </code></pre>
php javascript
[2, 3]
2,916,796
2,916,797
How to determine usercontrol selected child
<p>I have a user control, a dropdown list, that's comprised of many component controls. The main HtmlInputText will post back on an enter but on loss of focus it doesn't and I need that to update other controls. I added an onblur function, and it gets called, but I only want to postback when the element getting focus isn't part of the user control. </p> <p>How do I determine what is selected and if it's a child of the control? </p> <p>Markup:</p> <pre><code> &lt;%@ Register Assembly="MultiDropDown" Namespace="MultiDropDownLib" TagPrefix="MultiDropDownLib" %&gt; &lt;asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"&gt; &lt;/asp:Content&gt; &lt;asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"&gt; &lt;table style="width: 328px"&gt; &lt;tr&gt; &lt;td&gt; ProductClass &lt;/td&gt; &lt;td&gt; &lt;MultiDropDownLib:MultiDropDown ID="MultiDropDown1" runat="server" TextBoxClass="textboxDD" PostOnBlur="true" /&gt; &lt;/td&gt; ... </code></pre> <p>And in the control:</p> <pre><code>if (PostOnBlur) { txtItemList.Attributes.Add("onblur", string.Format("PostBack();", this.ClientID)); } </code></pre> <p>In the PostBack I want to determine what has focus and if it's part of the control. The original control came from: <a href="http://www.codeproject.com/Articles/219977/MultiDropDown-A-multiple-selection-Dropdown-contro/%20%22MultiDropDown" rel="nofollow">http://www.codeproject.com/Articles/219977/MultiDropDown-A-multiple-selection-Dropdown-contro</a></p>
javascript asp.net
[3, 9]
586,100
586,101
Using c# to give different access to some users based on the physical machine they're accessing the website from
<p>In brief, we have a website built in asp.net c# that we're adding a login area to for people to see some paid for content. There will be different levels of account, one which when logged in can download say 10 documents a day, another that can download 20 etc....</p> <p>What the client has also now asked for is can they sell unlimited access to this facility to a customer, where that customer will only be able to get this unlimited access when using some specific computers.</p> <p>Really don't know if there is an elegant solution to this? I'm thinking MAC addresses must be the key, but as far as I know the c# code doesn't have direct access to that? Have read that JavaSript will be too unreliable in it's getting of the MAC adddress...and that writing a Java applet may be the only way.</p> <p>Does anyone else have a better suggestion than this?</p> <p>Any help would be greatly appreciated.</p>
c# asp.net
[0, 9]
62,231
62,232
Looking for C# - Java feature equivalence cheat sheet
<p>I'm looking for a resource that should help C# developer learning Java. I would like to have a fast reference that says, for instance:</p> <pre><code>C# | Java | Suggested alternative Extension Method | NA | ... Attributes | Annotations | ... </code></pre> <p>such a cheat sheet would be great resource in order to me, because he would help to break a thin barrier between the two world.</p>
c# java
[0, 1]
1,974,775
1,974,776
how to get data from another server in php
<p>i want to make pages like this server1 sends request to server2 using Jquery Autocomplete plugin. server 2 receive request from server 1 and get data itself from data base and send data to server 1 plz help me out of this will be thankful to u.</p>
php javascript
[2, 3]
944,642
944,643
show message when like button is clicked?
<p>I am using the following code to alert the user when he click the facebook like button. It is alerting the user only on Opera browser. How do I fix this problem and make it work with all browsers ?</p> <pre><code>&lt;script&gt; FB.Event.subscribe('edge.create', function(response) { alert("You liked the URL"); } ); &lt;/script&gt; </code></pre> <p>I can also use Jquery.</p>
javascript jquery
[3, 5]
1,353,588
1,353,589
How can I determine the direction of a jQuery scroll event?
<p>The title basically says it all. I'm looking for something to this effect:</p> <pre><code>$(window).scroll(function(event){ if (/* magic code*/ ){ // upscroll code } else { // downscroll code } }); </code></pre> <p>Any ideas?</p> <p>Thanks</p>
javascript jquery
[3, 5]
3,563,434
3,563,435
Regular expression behaving different on in c# code behind and on aspx
<p>Note: question has been edited to stay in sync with what I have tried from the commenters</p> <p>I am trying to match an email, however when put the same expression in the code behind, vs the aspx, I seem to be getting different matches for email address. The aspx regex validator seems to be working correctly, however I need to validate for my webservice as well. Im sure Im missing something simple here, does anyone have any ideas.</p> <pre><code> Regex regExEmail = new Regex(@"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"); if (!regExEmail.IsMatch(contact.emailAddress)) { //do something } </code></pre>
c# asp.net
[0, 9]
293,227
293,228
Use a variable in a URL object in Android
<p>Can I use a variable in the following code?</p> <pre><code>String Var = "\"http://dl.dropbox.com/u/44966/xml%20roma.xml\""; URL url1 = new URL(Var); </code></pre> <p>Is it only allowed to use a literal string, as in the following line?</p> <pre><code>URL url1 = new URL("http://dl.dropbox.com/u/44966/xml%20roma.xml"); </code></pre> <p>In my application it is imperative that I use a variable.</p>
java android
[1, 4]
2,938,191
2,938,192
Javascript function scope
<p>I'm trying to call an instance method a() from within a jQuery ajax call. But when I do so, it says that the method is not defined. I think it's because a() is not within the scope of $. But I thought it would be part of the scope chain. How can a() be within scope?</p> <pre><code>function Z() { this.x = 0 this.a = function() { return this.x; } this.b = function() { $.ajax({ ... success: function(data, textStatus, xhr) { this.a(); //a() is not defined }, ... }); } } z = new Z(); z.b(); </code></pre>
javascript jquery
[3, 5]
3,517,880
3,517,881
how to get the value against the value selected in text box?
<p>i want to know that when i select any value from dropdown box it shows it's price in next field example: if i select snacks from the dropdown menu then it show its price in next field by fetching its price from database in php items are also fetched from database plz help me urgently</p> <p><img src="http://i.stack.imgur.com/D58EJ.png" alt="Here is how i want when select a particular value"></p> <p>here is the code for fetching data from db</p> <pre><code>&lt;?php $eb = "SELECT EmployeeID,FirstName,LastName FROM employees"; $res = mysql_query($eb); $no_records = mysql_num_rows($res); if($no_records &gt; 0){?&gt; &lt;select name="EnteredBy" id="EnteredBy"&gt; &lt;?php while($row = mysql_fetch_array($res)) { echo '&lt;option value='.$row['EmployeeID'].'&gt;'.$row['LastName'].",".$row['FirstName'].'&lt;/option&gt;'; } } ?&gt; &lt;/select&gt; </code></pre>
php javascript
[2, 3]
5,641,320
5,641,321
Count number of divs inside a div
<pre><code>&lt;div id="full"&gt; &lt;?php $i=0; $j=1; foreach ($array as $image){ ?&gt; &lt;div id="image&lt;?php echo $i;?&gt;" class="img bg-img&lt;?php echo $j;?&gt;"&gt;&lt;img src="&lt;?php echo $image['image']; ?&gt;" &gt;&lt;/img&gt;&lt;/div&gt; &lt;?php $j++; $i++;} ?&gt; &lt;/div&gt; </code></pre> <p>How do i get the number of divs contained by div id="full"?.</p>
javascript jquery
[3, 5]
2,934,581
2,934,582
How to execute javascript in specifci time in .cs?
<p>If i have script like this :</p> <pre><code>&lt;script type="text/javascript" src="//www.gmodules.com/ig/ifr?url=http://hosting.gmodules.com/ig/gadgets/file/100080069921643878012/facebook.xml&amp;amp;up_useNewFB_p=1&amp;amp;up_showPopUp2_p=true&amp;amp;synd=open&amp;amp;w=320&amp;amp;h=500&amp;amp;title=Facebook&amp;amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;amp;output=js"&gt;&lt;/script&gt; </code></pre> <p>and i wanna to execute this script in specific time in my .cs code how to do this?</p>
c# javascript jquery asp.net
[0, 3, 5, 9]
5,480,742
5,480,743
How do i check after .hover has started in jQuery that the mouse is still hovering?
<p>I have li boxes that make this jQuery call when an end user hovers on them with his cursor:</p> <pre><code>$('.boxgrid.slidedown').hover(function(){ $(".cover", this).stop().animate({top:'-150px'},{queue:false,duration:300}); }, function() { $(".cover", this).stop().animate({top:'4px'},{queue:false,duration:300}); }); </code></pre> <p>Now i want to wait half a second after the user points his cursor so i could stall the slidedown effect. if the mouse is still hovering then the slidedown will continue, if not then nothing should happen.</p> <p>i tried using settimeout() without any luck. thank you.</p>
javascript jquery
[3, 5]
3,472,302
3,472,303
How to disable a menu item on page load in asp.net 4.0
<pre><code>&lt;Items&gt; &lt;asp:MenuItem NavigateUrl="~/Default.aspx" Text="Home"/&gt; &lt;asp:MenuItem NavigateUrl="~/About.aspx" Text="About"/&gt; &lt;/Items&gt; </code></pre> <p>I have this menu How can I disable it during page load</p> <pre><code>page load If (Userrole==Something) { hide menu item 2 } </code></pre> <p>How can I do that.</p>
c# asp.net
[0, 9]
2,594,089
2,594,090
Do I have to buy phone service to write applications for android/iphone?
<p>I am interested in building applications for mobile devices, but concerned about the cost of having multiple lines of service. I would like to be able to test applications on multiple devices with varying screen resolutions without having to always use an emulator.</p> <p>Will I be able to get by on new-or-used devices for which I have not purchased phone service?</p>
iphone android
[8, 4]
3,504,165
3,504,166
Understanding .Single()
<p>[This is a really tough one to Google.]</p> <p>Browsing sample code i'm seeing a usage i don't understand:</p> <pre><code>var orderRow = order.Rows.Single(); </code></pre> <p>Rows is an enumerable and usually one would iterate using a foreach loop. Is the .Single a workaround for cases where, for whatever reason, the foreach can't be (or need not) be used?</p> <p>thx</p> <p>In the time since the OP i've learned a bit more about usage that'll help other hits to this question:</p> <pre><code>var option = options.OfType&lt;AdditionalLocationsOption&gt;().SingleOrDefault(); if (option != null){ ...stuff } </code></pre>
c# asp.net
[0, 9]
2,260,481
2,260,482
Better way to implement a shake animation?
<p>I am trying to implement a "shake animation" using jQuery. The idea is that you can make an element shake to draw attention to it. Below is what I came up with:</p> <pre><code> function DrawAttention(item, count) { $(item).animate({top: '+=5'}, 50, function(){ $(item).animate({top: '-=10'}, 100, function(){ $(item).animate({top: '+=5'}, 50, function(){ if(count&gt;0) { DrawAttention(item,count-1); } }); }); }); } </code></pre> <p>I thought this was a little verbose and was wondering if anyone can see a more elegant way to achieve what I want.</p> <p>Fiddle <a href="http://jsfiddle.net/uaWkj/" rel="nofollow">here</a>.</p>
javascript jquery
[3, 5]
1,977,911
1,977,912
Use JQuery to set css file body background url
<p>I'm trying to change my body's background dynamically in a jQuery window resize event. The below is a simplified example that attempts to set the body background url property when the page loads, but its not the right syntax. Any ideas?</p> <p>test.css:</p> <pre><code>body { margin: 0px auto; font-family: HelveticaNeue; } </code></pre> <p>test.html's JavaScript:</p> <pre><code> $(document).ready(function() { $("body").css("background", "url('image/setme.png')"); }); </code></pre>
javascript jquery
[3, 5]
1,972,053
1,972,054
Add dropdownlist value to database which items add from page load functions
<pre><code>protected void Page_Load(object sender, EventArgs e) { //skipped foreach(pair item in al) { pid.Items.Add(new ListItem(item.getTitle(), item.getId())); } } protected void Button1_Click(object sender, EventArgs e) { insertUser.Parameters.AddWithValue("@parent_id", Convert.ToInt32(pid.SelectedValue)); } </code></pre> <p>From the above code there is a dropdownlist that all items are added from Page_Load function, and the bug is that, whatever items i choose from dropdownlist, only the first item is added to database.</p> <p>anyone know what's the problem?</p> <p>thanks!</p>
c# asp.net
[0, 9]
2,592,243
2,592,244
Onload clear all text fields jquery js
<p>How do I clear all text fields on a page, deselect buttons etc? I simply want to refresh the page when it loads.. like holding Shift + Refresh?</p>
javascript jquery
[3, 5]
3,247,808
3,247,809
Detect Visitor Browser view port size with Javascript and Save to a PHP variable
<p>I almost sure that PHP can't detect the View port size of a browser right?</p> <p>But since that, can someone teach me how can i do it with Javascript and then gather that size from a Javascript variable to a variable in PHP?</p> <p>Regards</p> <p>PS: Sorry if there is another post with the same question.</p>
php javascript
[2, 3]
5,625,190
5,625,191
Refresh page when directory content changes
<p>I am working on an online jQuery slideshow for showing the latest scores for a local sport community. The slides are images, made from a Powerpoint presentation, which are automatically synced with a directory on my Centos6 server using the Windows program Autover.</p> <p>For a good user experience it would be great when the page is refreshed when the images are updated (or show some text that the scores are updated and let the user refresh). I could set a meta refresh, for refreshing the page every 10 minutes but thats not an ideal solution.</p> <p>Browsing other topics I found out that it is not possible to monitor a server directory using only Javascript.</p> <p>My idea is now to make a php script to which returns true (changed) or false (not changed), and call this script from the slideshow webpage every 5 minutes using javascript. </p> <p>For the php script I read some topics using these solutions:</p> <ul> <li>Inotify-tools (which is not installed by default on Centos)</li> <li>FAM (could be outdated?)</li> <li>Making a md5 hash of the directory, and compare this with a previous hash.</li> </ul> <p>Which of the solutions above is the best way to go? Could someone provide me with an php example? Unfortunately my php skills are not so good.</p>
php javascript
[2, 3]
1,999,012
1,999,013
expandableListView children with text and image
<p>I have an expandableListView where each group has two children. The child rows are for editing or deleting the group. How do I insert images for the child rows?</p> <pre><code>Group 1 &lt;image here&gt; Edit &lt;-- child 1 &lt;image here&gt; Delete &lt;-- child 2 </code></pre> <p>I use a SimpleExpandableListAdapter</p> <p>Hope someone can help :)</p>
java android
[1, 4]
3,960,225
3,960,226
Opening Network Path and Local Drives using Java Script in windows explorer and URL in new window
<p>I have a form on which I have a textbox and a button or anchor link.</p> <p>My user can enter a network path or a local drive path or an Internet Url in a textbox.</p> <p>When the user clicks on the button or anchor link, a javascript method will be called which will pickup the value from the textbox and take the required action.</p> <p>That means if the user entered a URL such as www.google.com , the page would open up in a separate browser.</p> <p>If the user enters a network path such as \NetworkMachine\Folder\ the network folder will open up.</p> <p>If the user enters a local drive path such as D:\MyFolder\Images then his local Images folder will open up.</p> <p>The form I intend to implement won’t be exact but the above example is an image of how I intend to achieve the functionality. I am using Internet Explorer 8 and above.</p>
javascript jquery
[3, 5]
3,243,253
3,243,254
change text of <a> element in javascript array
<p>I have a javascript array with contains a bunch of anchor elements like this:</p> <pre class="lang-js prettyprint-override"><code>["&lt;a href="#" id="id1"&gt;First anchor&lt;a&gt;", "&lt;a href="#" id="id2"&gt;Second anchor&lt;a&gt;", "&lt;a href="#" id="id3"&gt;Third anchor&lt;a&gt;"] </code></pre> <p>I would like to change just the text in the last anchor element (Third anchor) while keeping the attributes of the anchor element itself unchanged (meaning I want to keep my id and href attributes intact). How would I do this and returned the changed array?</p>
javascript jquery
[3, 5]
661,334
661,335
Pages of same website opened in multiple instance of browser should refer to same variable using javascript
<ol> <li>I have website www.xyz.com and it is having 3 pages a, b and c. </li> <li>I open one page a in Internet Explorer instance 1 (i.e. www.xyz.com/a )</li> <li>I open the page b in new IE window instacne 2 (i.e. www.xyz.com/b )</li> <li>I open the page c in the new tab of IE window instance 3(i.e. www.xyz.com/c) </li> </ol> <p>I need a method using javascript <strong>ONLY</strong>, via which I will be able to refer to a variable which I have defined for the website xyz and all three pages a,b and c will use the same variable. If the variable does not exsist I should be able to create the variable using <strong>javascript</strong>.</p>
javascript jquery
[3, 5]
5,310,136
5,310,137
how to increment between a range of dates using javascript
<p>I need to increment between a range of dates using javascript. I have start_date and end_date in the following format.</p> <pre><code>var start_date = Fri Nov 09 2012 var end_date = Thu Nov 15 2012 </code></pre> <p>I need to call a function which accepts all the dates by looping between start dates and end dates as parameter. Something like this</p> <pre><code>for (date = start_date; date &lt; end_date; date++) { getCellFromDate(date, calInstance); } </code></pre> <p>I need to provide the parameters to getCellFromDate in the same date format(Fri Nov 09 2012) . How do I achieve this..I am new to javascript.. Please help</p>
javascript jquery
[3, 5]
1,750,238
1,750,239
working with tabindex and multiple forms
<p>I want to change the order in which certain checkboxes are tabbed to. The problem is, my application can have multiple tabs open, each with the same form. In addition, I have other fields before the checkboxes. How can I change the tab-index of those specific checkboxes without affecting the rest of the inputs in the DOM?</p> <p><strong>EDIT:</strong></p> <p>Here's the form I'm using.</p> <p><img src="http://i.stack.imgur.com/OnYr1.jpg" alt=""></p> <p>The form will start by being focused on the first input (the one with "the last book" as it's value) and should tab normally till you get to the grades. Then it should tab DOWN. Same with the subjects. As you can see, there can be multiple tabs containing this form.</p>
javascript jquery
[3, 5]
1,908,070
1,908,071
How to clear a input array all elements using jQuery
<p>I have defined my form elements using the html array method like this:</p> <pre><code>&lt;input type="text" maxlength="45" name="Apikey[key]"&gt; &lt;select name="Apikey[developer]"&gt; </code></pre> <p>How can I clear all Apikey array using jQuery?</p> <p>The question is how to clear them? All possible forms fields must be cleared.</p>
javascript jquery
[3, 5]
5,760,126
5,760,127
Any idea how to write code that can be easily ported to iphone, android and blackberry?
<p>I'm looking for a way to easily port content driven applications from one mobile platform to another. Currently HTML5+js seems to be the only language that can be easily reused.</p> <p>Can you share your experience? I'm looking for a way to go forward.</p>
iphone android
[8, 4]
5,629,836
5,629,837
Page.IsValid always return false
<p>I have cause validation true on button. And I am checking the <code>Page.IsValid</code> in c# code. But its always returning false value?</p>
c# asp.net
[0, 9]
468,726
468,727
How to get the first element of LinqToEntities result?
<p>I want to get the first element of the LinqToEntities request. </p> <p>Here is my code: </p> <pre><code>var para = (from param in context.Parameters where param.Code == paramCode select param.ValueDecimal); </code></pre> <p>Does anyone know how to do that?</p> <p>Thanks</p> <pre><code>**Edit:** </code></pre> <p>Thanks for your responses. It works. </p>
c# asp.net
[0, 9]
2,364,442
2,364,443
Using $.get to print page Elements
<p>I'm trying to print the elements of a page using this code:</p> <pre><code>$('#some_button').click(function(){ var url = window.location.href; var contents = $.get(url); alert(contents.responseText); }); </code></pre> <p>but this returns a blank string, and trying to print <code>contents.status</code> gives me the error:</p> <pre><code>Uncaught Error: INVALID_STATE_ERR: DOM Exception 11 </code></pre> <p>This code works just fine from the browser console so it would seem this is a load state issue. But because this is in a click listener I don't know how to solve this.</p>
javascript jquery
[3, 5]
1,219,475
1,219,476
select datetime in gridview and change next textbox value upon date selection in gridview
<p>Scenario is i have a date time column in grid view, upon selection on date time column i need to show calculated value in next column's text box in gridview</p> <p>i am not able to calculate value on basis of date selection, although i am able to select the date through jquery and place it in textbox. but it is not changing the next textbox value upon basis of selection. code is as under</p> <pre><code> &lt;asp:TemplateField HeaderText="Issue Date"&gt; &lt;ItemStyle Width="140px" /&gt; &lt;ItemTemplate&gt; &lt;asp:TextBox ID="txtIssueDate" runat="server" Width="110px" Text='&lt;%#Eval("RequirementIssueDate") %&gt;' ReadOnly="true" class="Calender" OnTextChanged="txtIssueDate_TextChanged"&gt;&lt;/asp:TextBox&gt; &lt;img id="imgIssueDate" src="../KelshawImages/calender.png" /&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;asp:TemplateField HeaderText="Expiration Date"&gt; &lt;ItemStyle Width="140px" /&gt; &lt;ItemTemplate&gt; &lt;asp:TextBox ID="txtExpiration" runat="server" Text='&lt;%#Eval("RequirementExpirationDate") %&gt;' ReadOnly="true" class="Calender" Width="110px"&gt;&lt;/asp:TextBox&gt; &lt;img src="../KelshawImages/calender.png" /&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; </code></pre>
javascript asp.net
[3, 9]
4,279,358
4,279,359
Run code at specific time, every day
<p>I want to disable service at [user choice] and enable it at [user choice] for every day. What is the best way to accomplish that?</p> <p>Should i use Calendar? (Calculate start and end times, or something else? )</p>
java android
[1, 4]
3,118,714
3,118,715
Learn java development
<p>I want to gave you a question. First of all plans is to learn create Java programs and<br> forward learning creating games. Then Make android applications an so on.<br> So, I have already learned P-H-P, touched Object-Oriented-Programming, also i learned basics of C++ language. Sorry about my bad English because my main language is Lithuanian, But can some one share tips of learning Java. Where is better to start, what directions to look, also i have a minimum of algorithms practice. </p>
java android
[1, 4]
4,782,019
4,782,020
Library to write PHP web service for android consumption
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4603975/framework-for-providing-api-access-to-website">Framework for providing API access to website?</a> </p> </blockquote> <p>I need to write a service in PHP. The server will be used by android/iphone clients through the url for example like this</p> <pre><code>http://www.myservice.com/query.php?param1=a&amp;param2=2... </code></pre> <ul> <li>The server will return data back </li> <li>The client will push data to server </li> <li>There can be large num of clients simultaneously accessing so the performance is key</li> </ul> <p>I want to use the data format that is easily understood by my android client. In other words, I do not want to reinvent the wheel and create my own format and parsing, instead I would prefer to use any library if it exists. Is there a framework that I can use to abstract the communication mechanism for data get and push ?</p> <p>Thanks, Ahmed</p>
php android
[2, 4]
5,461,567
5,461,568
How to get the value which is selected in gridview?
<p>When I click on a row I should get the value on which the user is clicked </p> <p>How do I get that?</p>
c# asp.net
[0, 9]
1,369,343
1,369,344
Find the Empty excel file when upload to datatable
<p>User upload the inputs through the Excel file. I want to find that excel file is empty or else.I check the content length and file size for find empty file..size is vary between empty files(without type and user type data and delete the all data to make an empty)For example content length for emptyfile 8714 but user type any data and delete all the data then the content length is 8104 like that</p> <p>So I convert the excel file to datatable and check the datatable is null or not.when convert empty file to datatable the datatable have the default column F1.so datatable =null not work.Pls help me</p> <p>My code:</p> <pre><code>string dirpath = Server.MapPath("~") + "uploadfile\\"; string LocalFilePath = dirpath + fileName; fileUpload.PostedFile.SaveAs(LocalFilePath); string fileType = Path.GetExtension(fileName); string SourceConstr = string.Empty; var Inputs = ProjectAttributeMasterService.GetInputAttributes(7); if (fileType == ".xls" || fileType == ".xlsx") { if (fileType == ".xls") { SourceConstr = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" + LocalFilePath + "';;Extended Properties= 'Excel 8.0;HDR=Yes;IMEX=1'"; } OleDbConnection con = new OleDbConnection(SourceConstr); con.ResetState(); con.Open(); System.Data.DataTable dtl = new DataTable(); System.Data.DataTable dts = con.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); OleDbDataAdapter da = new OleDbDataAdapter("select * from [Sheet1$]", con); da.Fill(dtl); if ((dtl.Rows.Count &gt;= 1 || dtl.Columns.Count &gt;= 1) &amp;&amp; !dtl.Columns.Contains("F1")){ } else { /empty file } </code></pre> <p>dtl.Columns.Contains("F1")..If i use this condition even the Excel contain Data in cell "F1" then return Empty..and F1 is not default column for all server...So Its also not fine.</p>
c# asp.net
[0, 9]
3,734,124
3,734,125
jQuery , bind a callback to any function
<p>I would like to be able to bind a callback function to a previously defined function and being able to use two variables defined in the scope of that function.</p> <p>It should look like this: </p> <pre><code>function mainFunction(){ var localForMain; } $(document).ready(function(){ // bind a call back method to the 'mainFunction' $(mainFunction).bindCallback(function(){ // ...use the localForMain variable HERE; }); }); </code></pre> <p>Is it possible to achieve something like this?</p>
javascript jquery
[3, 5]
3,824,556
3,824,557
Retrieving exact clients time in C#
<p>Till today I am using <code>DateTime.Now;</code> function to save the time and data of users. Well, at later stage I used JavaScript to get the client's date and time to maintain Time Zone. But when I change my system's date and time and try that JavaScript. It show the changed time of my computer. I need how to get clients correct current date and time value. How to get it.</p> <p>Please do not exceed answer more than C# &amp; JavaScripts.</p>
c# javascript
[0, 3]
4,867,951
4,867,952
Extracting number from a string
<p>What is the best way to get the number from a string.</p> <p>The string will always start with <code>n</code> and end with any number i.e.:</p> <pre><code>n1 n2 n3 n10 n100 n1000 n99999 n9999999999999 </code></pre> <p>and so on.</p>
javascript jquery
[3, 5]
178,802
178,803
Remove illegal URL characters with JavaScript
<p>I have an array filled with strings, a value can for example be "not updated for > days". I use the values in the array to create some url's and need to remove the /\&lt;> and other illegal URL characters. How do I easiest do this?</p> <p>I started with</p> <pre><code>var Name0 = title[0].substring(1).replace(" ", "%20").replace("/", "") + '.aspx'; var Name1 = title[1].substring(1).replace(" ", "%20").replace("/", "") + '.aspx'; and so on but can I do this in a better way? </code></pre> <p>Thanks in advance.</p>
javascript jquery
[3, 5]
826,061
826,062
put content inside a div with class
<p>i have an easy question, i have a div with some id, and inside there some different contents, that ends with some span separator, i want them to put in a div with class slide, anyway here is the structure to make it more clear:</p> <pre><code>&lt;div id="adv"&gt; content 1 &lt;span class="separator"&gt;&lt;/span&gt; content 2 &lt;span class="separator"&gt;&lt;/span&gt; etc... &lt;/div&gt; </code></pre> <p>but i want it to have this structure:</p> <pre><code>&lt;div id="adv"&gt; &lt;div class="slide"&gt; content 1 &lt;span class="separator"&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="slide"&gt; content 2 &lt;span class="separator"&gt;&lt;/span&gt; &lt;/div&gt; etc... &lt;/div&gt; </code></pre> <p>BTW, there is no need in spans with class separator, just content is enough for me, inside a div with class slide</p> <p>Thank you all for the help!</p>
javascript jquery
[3, 5]
2,095,903
2,095,904
Which technology should i use to develop a high performance web application
<p>HellO Everyone,</p> <p>I have couple of ideas in my brain which i would like to bring out before its too late. Basically i want to develop a web application which i could sell it to clients. So which technology shall i use to accomplish this. I have been a C and C++ software developer but its been a very long time since i have developed one. So the things i would like to know is</p> <p>1) Scalability and Performance ? 2) Easy way to develop web application in a faster manner ? 3) Any Framework ? 4) Application server ? 5) and which programming language ?</p> <p>Thank You</p>
c# java python
[0, 1, 7]
234,625
234,626
.focusout() only reading through first if() statement
<p>Why is this not reading through both if statements even though they are both true?</p> <p><strong>HTML</strong></p> <pre><code>&lt;textarea name="test"&gt; Focus out to test prompts &lt;/textarea&gt; </code></pre> <p><strong>jQuery</strong></p> <pre><code>var disableA = 1; var disableB = 1; $('textarea[name="test"]').focusout(function() { if (disableA == 1) { disableX(); } if (disableB == 1) { disableY(); } }); function disableX() { alert('A is disabled'); } function disabledY() { alert('B is disabled'); } </code></pre> <p>Right now it will call for <code>disableX();</code> but not <code>disableY()</code></p> <p><strong>jsFiddle:</strong> <a href="http://jsfiddle.net/nCQQm/" rel="nofollow">http://jsfiddle.net/nCQQm/</a></p>
javascript jquery
[3, 5]
351,872
351,873
Position a relative layout below a listview element
<pre><code>RelativeLayout item = (RelativeLayout)findViewById(R.id.catalogParent); View child = getLayoutInflater().inflate(R.layout.detailedcatalog, null); RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); layoutParams.addRule(RelativeLayout.BELOW,view.getId()); item.addView(child, layoutParams); </code></pre> <p>Above is the code for placing a layout below a listview element. The view.getId() function is always returning a -1. The relative layout is being inflated programmatically during runtime.</p> <pre><code>lv.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView&lt;?&gt; arg0, View view, int position, long arg3) { ...}} </code></pre> <p>The view object is obtained from the onItemClick function. Can you please help me with this. Thanks in advance.</p>
java android
[1, 4]
558,310
558,311
how do I force users to download image (like downloading pdf)?
<p>So I wrote an image gallery with an option to download the original image (by default, it displays a resized version of the image). I would love to know how to I </p> <p>The following code will force users to save pdf rather than viewing it with browser, I would love to achieve the same effect for the images (jpg, gif, png) by binding the click action with jQuery, how will I be able to do that?</p> <p>Taken from php.net</p> <pre><code>&lt;?php // We'll be outputting a PDF header('Content-type: application/pdf'); // It will be called downloaded.pdf header('Content-Disposition: attachment; filename="downloaded.pdf"'); // The PDF source is in original.pdf readfile('original.pdf'); ?&gt; </code></pre> <p>html:</p> <pre><code>&lt;div class="download"&gt; &lt;a href="http://www.xyz/abc.jpg"&gt; Download original image&lt;/a&gt; &lt;/div&gt; </code></pre> <p>js:</p> <pre><code>$(".download").click(function(){ // call a php to download the image }); </code></pre> <p>Is it possible to do so? </p> <p>Edit: What should I do in javascript code?</p>
php jquery
[2, 5]
445,337
445,338
get set access in javascript object literals
<p>Using object literals for the first time and it seems I don't quite understand them right. What I need is private variables with the scope of the object and therefore accessible to all functions in the object literal.</p> <p>Here's the issue:</p> <p>I have a simple object literal for a map object</p> <pre><code>var mapObj = { init: function (lat, lng, documentID) { var myOptions = { center: new google.maps.LatLng(lat, lng), zoom: 18, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById(documentID), myOptions); return map; }, setMarker: function (lat, lng, map, contentObj) { var myLatlng = new google.maps.LatLng(lat, lng); var marker = new google.maps.Marker({ position: myLatlng, map: map, title: "Hello World!", content: contentObj }); } }; </code></pre> <p>This is all fine, and I get to use it as mapObj.init(....) and mapObj.setMarker(...) which work perfectly.</p> <p>What I want to be able to do is store some of these variable values - like 'map' in the init() method, and then have it accessible for other methods. For e.g. I should not need to pass 'map' in the setMarker, as the mapObj should hold the map internally after the init method.</p> <p>Similarly I'd like to be able to do mapObj.getMap() to access the map object created in init.</p> <p>I'm unable to figure out how it works. Declaring var map as</p> <pre><code>var mapObj { var map } </code></pre> <p>for e.g throws errors. </p> <p>Am I expecting this to work too much like C#? Should I be using the classic javascript 'class' constructions? Any pointers will help so I can move on.</p> <p>Thanks</p>
javascript jquery
[3, 5]
4,092,147
4,092,148
calculate data transfer download+uploaded data
<p>I want to calculate the total data download and upload in a particular interval of time, and store it to a database so that it can be viewed later on. Thus, this particular user logged in at this time and downloaded and uploaded this much data.</p> <p>I want to do this in C#.</p>
c# asp.net
[0, 9]
5,255,865
5,255,866
asp.net auto generated textboxes ID on webform
<p>I am using <strong>C#</strong> on <strong>Visual Studio</strong>. I want to generate a <strong>webform</strong> with auto numbered <code>Textboxes</code> depending on the input from the previous page. What is the best way to do this loop?</p> <p>For example:</p> <p>Input is 4</p> <p>The next page should generate textboxes with ID of </p> <ul> <li>"name1"</li> <li>"name2" </li> <li>"name3"</li> <li>"name4"</li> </ul> <p>Something like this :</p> <pre><code>&lt;asp:TextBox ID="name1" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;asp:TextBox ID="name2" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;asp:TextBox ID="name3" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;asp:TextBox ID="name4" runat="server"&gt;&lt;/asp:TextBox&gt; </code></pre> <p>Part 2 of my question is that if I want to call them when a <code>Button</code> is click, how should I use a loop the get those ID?</p>
c# asp.net
[0, 9]
3,327,950
3,327,951
Problem with condition statement in c#
<pre><code>if (txt_SendAt.Text != null) { //string SendAt_date = txt_Respondby.Text; DateTime Send_date = Convert.ToDateTime(txt_SendAt.Text); param[15] = new MySqlParameter("@SendDate", MySqlDbType.DateTime); param[15].Value = Send_date; command.Parameters.AddWithValue("@SendDate", Send_date); } else { param[15] = new MySqlParameter("@SendDate", MySqlDbType.DateTime); param[15].Value = now; command.Parameters.AddWithValue("@SendDate", now); } </code></pre> <p>I have a text box where i select date and time from a calender. When I leave the text box empty it should execute the statements in else condition but it executes the statement in if. Where am I going wrong</p> <p>I am getting this error if i leave it blank String was not recognized as a valid DateTime.</p>
c# asp.net
[0, 9]
4,219,134
4,219,135
Consolidating jQuery functions with multiple named selectors
<p>I'm looking for a techniuqe similar to a switch function in PHP so I can use a single function for multiple named selectors. Additional code would be added based on which selector calls the function.</p> <p>My example is a 'Save' button along a 'Save And Close' button where the latter has additional code to close an accordion.</p> <p>If the 'Save' button is clicked it calls this:</p> <pre><code> $('form[name=experienceForm]').submit(function(eve) { eve.preventDefault(); tinyMCE.triggerSave(); var FormData = $(this).serialize(); var requestThis = $(this); var inputCom = $(this).find('input[name=inputCom]').val(); var inputTitle = $(this).find('input[name=inputTitle]').val(); $.ajax({ type : 'POST', url : '&lt;?php echo site_url('resume/update'); ?&gt;', data: FormData, dataType: "html", context : $(this), success : function(msg){ requestThis.closest('.item').children('h3').children('a').text(inputCom+' : '+inputTitle); if(msg != '') { showNotice(msg); } }, error: function(msg){ alert('FAIL '+msg); } }); }); </code></pre> <p>I would like the 'Save and Close' button to do the same as above with this added:</p> <pre><code> $('input[name=experienceClose]').click(function(eve) { eve.preventDefault(); tinyMCE.triggerSave(); $(this).parent().parent().parent().parent().parent().parent().parent().parent().parent().accordion({active:"false"}); }); </code></pre>
javascript jquery
[3, 5]
972,750
972,751
convert server side vb.net to client side javascript
<p>I've got a function I wrote quite some time ago that works fine, but I'd like to speed up the process and lessen server load by doing the same job in Javascript.</p> <p>I seem to be able to GET textbox values ok, but I can't seem to SET textbox values (I'm'-a JS noob). Can anyone lend a hand in converting my VB.NET code to it's JS equivalent?</p> <pre><code>Protected Sub txtSellingPrice_TextChanged(ByVal sender As Object, ByVal e As EventArgs) _ Handles txtSellingPrice.TextChanged Dim SellingPrice As Double = Double.Parse(txtSellingPrice.Text.Replace("$", "")) Dim BallanceSheet As Double = If(txtBalanceSheet.Text = "", 0, Double.Parse(txtBalanceSheet.Text.Replace("$", ""))) Dim DownPayment As Double = If(txtDownPayment.Text = "", 0, Double.Parse(txtDownPayment.Text.Replace("$", ""))) txtGoodWill.Text = SellingPrice - BallanceSheet txtBalance.Text = SellingPrice - DownPayment txtSellingPriceMult.Text = SellingPrice End Sub </code></pre> <p>I've got this so far, but I'm not sure how to get much further.</p> <pre><code>function txtSellingPrice_OnChange() { var txtSellingPrice = document.getElementById('&lt;%=txtSellingPrice.ClientID %&gt;') var txtBalanceSheet = document.getElementById('&lt;%=txtBalanceSheet.ClientID %&gt;') var txtDownPayment = document.getElementById('&lt;%=txtDownPayment.ClientID %&gt;') } </code></pre>
asp.net javascript
[9, 3]
4,236,801
4,236,802
strip out a portion of url
<p>Does anyone know how to strip out a portion of url.</p> <p>For example I have 3 img sources each residing in it's own div class called "showimage".</p> <pre><code>&lt;div class="showimage"&gt;&lt;img src="http://www.mydomain.com/image1-thumb.JPG" /&gt;&lt;/div&gt; &lt;div class="showimage"&gt;&lt;img src="http://www.mydomain.com/image2-thumb.JPG" /&gt;&lt;/div&gt; &lt;div class="showimage"&gt;&lt;img src="http://www.mydomain.com/image3-thumb.JPG" /&gt;&lt;/div&gt; </code></pre> <p>I want all the urls to remove the "-thumb" so the img sources reads;</p> <pre><code>&lt;div class="showimage"&gt;&lt;img src="http://www.mydomain.com/image1.JPG" /&gt;&lt;/div&gt; &lt;div class="showimage"&gt;&lt;img src="http://www.mydomain.com/image2.JPG" /&gt;&lt;/div&gt; &lt;div class="showimage"&gt;&lt;img src="http://www.mydomain.com/image3.JPG" /&gt;&lt;/div&gt; </code></pre> <p>I only have access to CSS, javascript or jQuery.</p> <p>thanks for helping.</p>
javascript jquery
[3, 5]
2,268,160
2,268,161
How to pass multiple value in one query string?
<p>I have a grid. there is multiple values in the grid. suppose there is candidate Id column in grid and there is check box in each row. I want to select multiple values of candidate Id through check box and pass this multiple selected values in the single query string to another page after passed it i will split the values using <code>split()</code> function and keep in array. because i have to perform some operation on target page using this multiple candidate ids. please give to some solution for this problem.</p> <p>There is my grid. <strong><em>i have not include check box in this code</em></strong> </p> <pre><code>&lt;asp:GridView ID="grdReq" runat="server" AutoGenerateColumns="false" CssClass="SimpleGrid" OnRowDataBound="grdReq_RowDataBound"&gt; &lt;Columns&gt; &lt;asp:BoundField DataField="CandidateID" HeaderText="Candidate Id" /&gt; &lt;asp:BoundField DataField="Candidate Name" HeaderText="Candidate Name" /&gt; &lt;asp:BoundField DataField="Current Organization" HeaderText="Current Organization" /&gt; &lt;asp:BoundField DataField="Current Designation" HeaderText="Current Designation" /&gt; &lt;asp:BoundField DataField="Overall Exp" HeaderText="Overall Exp" /&gt; &lt;asp:BoundField DataField="Qualification" HeaderText="Qualification" /&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt; </code></pre>
c# asp.net
[0, 9]
1,466,662
1,466,663
Help with js function explanation - Why $this = $(this)...?
<p>A user called "mu" as provide me the following answer that I really like. However, I do have some questions here, and I hope anyone could help me out.</p> <p>Given the following:</p> <pre><code>function() { var $this = $(this); $this.data('orig', $this.html()).html('&lt;a href="blabla.org"&gt;go here&lt;/a&gt;'); }, function() { var $this = $(this); $this.html($this.data('orig')).removeData('orig'); } </code></pre> <p><strong>1) Why do we have the need, and what does it do: var $this = $(this) - Why can't we use $(this) all over the place?</strong></p> <p><strong>2) Why do we need the 'orig' thing there?</strong> </p> <p>Please, :) provide as much detail as possible, really, I'm quite new on all this.</p> <p>Thanks a lot in advance, MEM</p>
javascript jquery
[3, 5]
3,469,339
3,469,340
Check if mail already exist when register new user
<p>I need some feedback on this code:</p> <pre><code>protected void RegisterUser_CreatingUser(object sender, LoginCancelEventArgs e) { var mail = RegisterUser.Email.ToString(); if (mail == "already existing mail") { e.Cancel = true; } } </code></pre> <p>I want stop new users to register with an email that is already registered. What is the best way to go??</p>
c# asp.net
[0, 9]
4,369,518
4,369,519
converting this function from Javascript to jQuery
<p>I've tried over and over to change this function to jQuery but I can't seem to get it to run properly. Could anyone give me any help with it at all?</p> <pre><code>window.onresize = resizeImage; function resizeImage(){ var newHeight = document.documentElement.clientHeight; var newWidth = document.documentElement.clientWidth; document.getElementById('crofthouse').width = (newHeight / 2) * 1.33; document.getElementById('crofthouse').height = (newHeight / 2); document.getElementById('main').style.width = (newHeight / 2) * 1.33; document.getElementById('main').style.height = (newHeight / 2); var margin = (newHeight - document.getElementById('crofthouse').height) / 2; document.getElementById('main').style.margin = margin + ',auto,' + margin + ',auto'; } </code></pre> <p>here's my attempt at converting it window.onresize = resizeImage;</p> <pre><code>function resizeImage(){ var newHeight = document.documentElement.clientHeight; var newWidth = document.documentElement.clientWidth; $("#crofthouse").css("width, (newHeight /2) * 1.33") $("#crofthouse").css("hegiht, (newHeight /2)") $("#main").css("width, (newHeight /2) * 1.33") $("#main").css("height, (newHeight /2)") var margin = (newHeight - $('#crofthouse').css("height) / 2"); $('main').css("margin = margin + ',auto,' + margin + ',auto'"); } </code></pre>
javascript jquery
[3, 5]
805,738
805,739
Fast way to get the min/max values among properties of object
<p>I have an object in javascript like this:</p> <pre><code>{ "a":4, "b":0.5 , "c":0.35, "d":5 } </code></pre> <p>Is there a fast way to get the minimum and maximum value among the properties without having to loop through them all? because the object I have is huge and I need to get the min/max value every two seconds. (The values of the object keeps changing).</p>
javascript jquery
[3, 5]
2,658,366
2,658,367
why user AlternatingItemTemplate on listview
<p>why user AlternatingItemTemplate on listview and copy code from ItemTemplate to AlternatingItemTemplate? i can't see logic? You can alternate with css too...</p>
c# asp.net
[0, 9]
4,587,558
4,587,559
Visit link when triggering click
<p>I have some links that have events bound to them and some links that do not. </p> <p>These links are having their click event triggered by a change in a select box. </p> <p><a href="http://jsfiddle.net/qjEWQ/" rel="nofollow">See this fiddle</a></p> <p>Is there a way for jquery to visit a link if there is no event bound that link?</p> <p><strong>I do not want to reference the url within the select box vlaue attribute, I want to reference the url in the anchor tag.</strong> </p> <p>something like (pseudo code) - </p> <pre><code> if (link.hasEventHandler('click')){ trigger click } else { window.location = link.attr('href') } </code></pre> <p>EDIT - There's a plugin that does exactley what I need to do here - <a href="https://github.com/sebastien-p/jquery.hasEventListener" rel="nofollow">https://github.com/sebastien-p/jquery.hasEventListener</a></p> <p>File size is an issue, so I'd like to avoid using it. </p> <p>I'm using the latest jquery so cannot use .data('events')</p>
javascript jquery
[3, 5]
3,409,845
3,409,846
redirect from javascript function is not working
<p>I have one js file in which there is one function</p> <pre><code>function deleterec(delid) { if(confirm('Are you sure you want to "'+jQuery("#action").attr('value')+'" the selected record(s)?')) { document.location.href = siteroot+"/admin/products/delete_store.php?delid="+delid; } else { return false; } </code></pre> <p>In which delid are comma seperated id passed to function. But in confirmation it does redirect to delete_store.php file in which i write this code</p> <pre><code>if($_GET['delid']!="") { mysql_query("delete from store where id in (".$_GET['delid'].")"); $_SESSION['msg'] = "&lt;span class='success'&gt;Record deleted successfully&lt;/span&gt;"; } </code></pre> <p>But it not works,I think from js fuction it does not redirect to delete_store.php.</p>
php javascript jquery
[2, 3, 5]
2,655,465
2,655,466
Catch "DONE" key press from soft keyboard
<p>I'm looking for code that can catch key press of "DONE" button from soft keyboard. When done button is pressed, I need to change button state to enabled and user then can move on to the next activity.</p> <p>I found this piece of code, here on stackoverflow, but I can't implement it without errors. Can you help me please?</p> <pre><code>editText = (EditText) findViewById(R.id.edit_text); editText.setOnEditorActionListener(new OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if (actionId == EditorInfo.IME_ACTION_DONE) { // do your stuff here } return false; } }); </code></pre> <p>Here is entire .java file</p> <pre><code>package com.example.start201; import android.app.Activity; import android.content.Context; import android.os.Bundle; import android.view.KeyEvent; import android.view.View; import android.view.inputmethod.InputMethodManager; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; public class FirstActivity extends Activity { private EditText editText; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.layout_firstactivity); editText = (EditText) findViewById(R.id.editText2); editText.setOnEditorActionListener(new OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if (actionId == EditorInfo.IME_ACTION_DONE) { // do your stuff here } return false; } }); } } </code></pre>
java android
[1, 4]
2,554,113
2,554,114
Finding all the visible elements using the given root
<p>Given the following code</p> <pre><code>var a = $('&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;'); a.css("visibility", "visible"); a.find("* :visible"); </code></pre> <p>I receive an empty array <code>[]</code> as a result instead of a <code>div</code>. What am I doing wrong?</p>
javascript jquery
[3, 5]
5,960,174
5,960,175
How can I explicitly change the RowState?
<p>How i can change dataset rows state from added to modified or delete using c# asp.net. I tried this but its not working</p> <pre><code>dsDataSet.Tables[0].Rows[0].RowState = DataViewRowState.ModifiedOriginal; </code></pre>
c# asp.net
[0, 9]
4,236,971
4,236,972
Can't find R. layout - app name. Only android layout
<p>For some reason, when i started up eclipse today, it couldn't find my main XML in my</p> <pre><code>setContentView(R.layout.main); </code></pre> <p>When i write R. it can only find "Layout - Android.R" - and not my "Layout - com.your.app"</p> <p>Anyone who knows how to solve this problem?</p> <p><strong>I just realised my Java file in the /gen folder is missing, how do i retrieve it again?</strong></p> <p><strong>Cleaning project doesn't work</strong></p>
java android
[1, 4]
2,957,126
2,957,127
How to iterate through all checkboxes on the page?
<p>How do I can iterate through all checkboxes on the page with JQuery?</p> <p>I.e. I have those <code>checkboxes</code> above...</p> <pre><code>&lt;div&gt; &lt;input checked="checked" type="checkbox" name="option_1" id="checkbox_1" value="1" /&gt;35 MM &lt;input checked="checked" type="checkbox" name="option_2" id="checkbox_2" value="2" /&gt; DIGITAL &lt;input type="checkbox" name="option_3" id="checkbox_3" value="3" /&gt; 3D DIGITAL &lt;/div&gt; </code></pre> <p>Have I use </p> <pre><code> $('input[id^="checkbox_"]').each(function() { }); </code></pre> <p>Is it correct? Thank you!</p>
javascript jquery
[3, 5]
3,604,039
3,604,040
Stop div scrolling once it reaches another div
<p>Basically I currently have a div which stays fixed and follows the user down as they scroll until it reaches a certain point. I can easily make it stop at a fixed pixel position as I have done in the below example, but because I'm a jQuery idiot I have no idea how to make it stop at a div instead. </p> <p>Here's what I've used so far: </p> <pre><code>var windw = this; $.fn.followTo = function ( pos ) { var $this = this, $window = $(windw); $window.scroll(function(e){ if ($window.scrollTop() &gt; pos) { $this.css({ position: 'absolute', top: pos }); } else { $this.css({ position: 'fixed', top: 0 }); } }); }; $('#one').followTo(400); </code></pre> <p>Here's the example: <a href="http://jsfiddle.net/Tgm6Y/1445/" rel="nofollow">jsFiddle</a></p> <p>The reason I want it to stop once it reaches a second div is because with the fluid layout I'm using, the second div will be sitting at different points depending on the browser size. Defining a specific point for it to stop at won't work. Anyone got any ideas as to how I can get this to do what I want? Alternatively, is it possible for the fixed div to stop scrolling once it reaches a percentage of the way down? I've looked around but haven't found anything.</p> <p>Thanks for any help. </p>
javascript jquery
[3, 5]
3,391,943
3,391,944
mouseover on a block
<p>My requirement is something like this!</p> <p>when I mouseover on '?' a block will appear with hyperlink of link &amp; video.Now mouseover function should work until I enter into the block.When I move the crusor from the block/from the ?, then mouseout event should occur. As I'm a newbie to javascript I don't have much idea on this.Any examples on this pls</p> <p>EDITED: Added actual code:</p> <pre><code>&lt;apex:outputLink styleClass="helpLink" onmouseover="$('{!$Component.Foo}').style.display ='block';"&gt; &lt;apex:image value="/s.gif" styleClass="helpIcon" /&gt;&lt;/apex:outputLink&gt; &lt;apex:outputPanel id="Foo" styleClass="video" &gt; &lt;a href="" target="_blank" onmouseout="$('{!$Component.Foo}').style.display = 'none';" &gt;link&lt;/a&gt; &lt;/apex:outputPanel&gt; </code></pre>
javascript jquery
[3, 5]
5,631,811
5,631,812
Alternative Jquery mouse event
<p>Alright so the code below works fine if I click outside the #nav div. I was asking if it is possible to just move the mouse away from the #nav div to make it disappear. I don't want to 'click' to hide the div.</p> <pre><code>$(document).mouseup(function (e) { var container = $("#nav"); if (container.has(e.target).length === 0) { container.hide(); } }); </code></pre> <p>Any help will be appreciated :)</p>
javascript jquery
[3, 5]
2,075,068
2,075,069
changing Galleriffic controls
<p>hay guys im using the jquery Galleriffic gallery and im trying to do somthing that im not sure is possible or not.</p> <p>i want to take the buttons that changing the pictures and start the slide show and put them inside divs.</p> <p>i was able to put all of them in a div out side the gallery but i cant find a way to put them separately inside divs.</p> <p>its even possible to do that? i looked in the javascript code and i found a code that change the pictures:</p> <pre><code> next: function(dontPause, bypassHistory) { this.gotoIndex(this.getNextIndex(this.currentImage.index), dontPause, bypassHistory); return this; } </code></pre> <p>but when i try to use it out side the Galleriffic initlizion the script break. my javascript is not the best its possible to call that function?</p> <p>sorry for my english.</p> <p><strong>EDIT:-----------------------------------------------------------------------------</strong></p> <p>i found the sulotion afther looking the Galleriffic source again and found the correct functions.</p> <p>thay called:</p> <blockquote> <p>gallery.next(); //for going foward.</p> <p>gallery.previous(); // for going backwards.</p> </blockquote> <p>you can make a div style him the way you want and link this function to it with javascript (i use jqeury).</p> <p>here a simple exmaple:</p> <pre><code>$("#foward").click(function () { gallery.next(); }); $("#backward").click(function () { gallery.previous(); }); </code></pre>
javascript jquery
[3, 5]
4,252,970
4,252,971
Why does this jquery .css line not work within 2 functions?
<p>this simple jquery .css statement does not activate within two functions, am I doing something wrong?</p> <p>javascript:</p> <pre><code>function updateAllCSS(element, property, value) { function updateThemeCreatorCSS(element, property, value) { $(element).css(property, value) } updateThemeCreatorCSS(element, property, value) } } updateAllCSS('h1', 'backgroundColor', '#f00') </code></pre> <p>HTML:</p> <pre><code>&lt;h1&gt;Test header&lt;/h1&gt; </code></pre>
javascript jquery
[3, 5]
4,342,178
4,342,179
How can i determine whether a mouse is connected or not using PHP?
<p>Is it possible to determine whether mouse or keyboard is plugged in or not in PHP? If not is it possible in Java? </p>
java php
[1, 2]
2,898,292
2,898,293
How to get the HTML of a div, including value of inputs
<p>Say I have this div:</p> <pre><code>&lt;div id='myDiv'&gt; &lt;input type='text' id='foo' size='30' /&gt; &lt;/div&gt; </code></pre> <p>and i run this javascript code:</p> <pre><code>($("#foo").val('bar'); </code></pre> <p>If I then do:</p> <pre><code>alert($("#myDiv").html()); </code></pre> <p>or </p> <pre><code>alert(document.getElementById('myDiv').innerHTML); </code></pre> <p>I get only the original copy of the html where the value of <code>foo</code> textbox is still blank. I would like to get a current copy of the html with a <code>value='bar'</code> attribute added to foo's html code.</p> <p>How can this be done?</p>
javascript jquery
[3, 5]
2,092,245
2,092,246
Member '<method>' cannot be accessed with an instance reference
<p>I am getting into C# and I am having this issue:</p> <pre><code>namespace MyDataLayer { namespace Section1 { public class MyClass { public class MyItem { public static string Property1{ get; set; } } public static MyItem GetItem() { MyItem theItem = new MyItem(); theItem.Property1 = "MyValue"; return theItem; } } } } </code></pre> <p>I have this code on a UserControl:</p> <pre><code>using MyDataLayer.Section1; public class MyClass { protected void MyMethod { MyClass.MyItem oItem = new MyClass.MyItem(); oItem = MyClass.GetItem(); someLiteral.Text = oItem.Property1; } } </code></pre> <p>Everything works fine, except when I go to access <code>Property1</code>. The intellisense only gives me "<em>Equals</em>, <em>GetHashCode</em>, <em>GetType</em>, and <em>ToString</em>" as options. When I mouse over the <code>oItem.Property1</code>, Visual Studio gives me this explaination:</p> <blockquote> <p><code>Member 'MyDataLayer.Section1.MyClass.MyItem.Property1.get' cannot be accessed with an instance reference, qualify it with a type name instead</code></p> </blockquote> <p>I am unsure of what this means, I did some googling but wasn't able to figure it out. Can anyone help this newbie out? </p> <p>thanks, anders</p>
c# asp.net
[0, 9]
170,846
170,847
How to route requests to a method in a class in WebForms?
<p>In MVC one can write a custom route that points to a method on a controller, i would like to achieve the same functionality with WebForms.</p> <p>If i have a route like;</p> <pre><code>Admin/{Controller}/{Action} </code></pre> <p>I would like to user a Url like the one below to invoke the Register method on a User class/controller.</p> <pre><code>http://[domain]/Admin/User/Register </code></pre> <p>How do i go about doing something like this.</p> <p><strong>NOTE</strong> </p> <p>I've found an answer to my question elsewhere;<br> <a href="http://www.west-wind.com/weblog/posts/2011/Mar/28/Custom-ASPNET-Routing-to-an-HttpHandler" rel="nofollow">http://www.west-wind.com/weblog/posts/2011/Mar/28/Custom-ASPNET-Routing-to-an-HttpHandler</a></p> <p>Basically, i am using WebForms to develop an app, however wanted the controller concept of the MVC - the ability to execute methods that exist on a controller. I've been able to achieve my goal, thanks to that article.</p>
c# asp.net
[0, 9]
4,520,725
4,520,726
Check box creation doesn't work in ie7
<pre><code>$("div").append($(document.createElement("input")).attr({ 'id': 'post_category', 'value': 'item', 'type': 'checkbox','checked': true })); </code></pre> <p>I am trying to create checkbox with checked but ie7 display nothing. while other browsers displays checkbox as checked. <strong>How to display checkbox selected in ie7</strong></p>
javascript jquery
[3, 5]
889,519
889,520
asp.net textbox.text and jquery.val()
<p>I'm reading the contents of a an asp.net TextBox on a button click event in the codebehind of a webpage.</p> <p>This works fine if I type something into the box I can read whats in there via TextBox.Text.</p> <p>However, if I copy into the input textbox using jquery, setting the contents using val(), I can see the text appear in the box but when the click event fires and I try to read the contents of the textbox it is always blank. There's only every anything in there if I type it in myself.</p> <p>The relevant bits of code are: - The input box</p> <pre><code>&lt;asp:TextBox runat="server" ID="deliveryAddress3" CssClass="required radius disabled sugestedAddressTargetCity bcity2" /&gt; </code></pre> <p>Javascript</p> <pre><code>var bfields = ['.baddress', '.bcity', '.bcountry', '.bpostcode']; var dfields = ['.baddress2', '.bcity2', '.bcountry2', '.bpostcode2']; for (var i in dfields) { $(dfields[i]).prev('label').hide(); $(dfields[i]).val($(bfields[i]).val()); $(dfields[i]).attr('disabled', 'disabled'); $(dfields[i]).addClass('disabled'); $(dfields[i]).attr('disabled', 'disabled'); </code></pre> <p>Code in button click method of codebehind: -</p> <pre><code>customer.DelTown = deliveryAddress3.Text; </code></pre> <p>Whats going on here is that the customer can copy their address from one set of boxes to another. If they do this (by clicking a button) the ext shows up in the boxes but in the code behind is blank. However, if I type something in to those boxes it is available in the code behind.</p>
jquery asp.net
[5, 9]
5,287,292
5,287,293
jQuery plugin which lets users draw rectangles in a div works in basic setup, but not when implemented in my page?
<p>I'm using this <a href="http://jsbin.com/azare/" rel="nofollow">Boxer plugin</a> to allow the user to draw rectangles in a div. I've got it working in <a href="http://jsfiddle.net/h8vnw/" rel="nofollow">this jsFiddle</a>.</p> <p>But I can't get it working in <a href="http://jsfiddle.net/7WgdH/" rel="nofollow">this one</a>, which is how I would be using it. I think it may be because of the CSS styling? Can anyone tell why it doesn't work?</p> <p>Thanks for reading.</p>
javascript jquery
[3, 5]
5,057,271
5,057,272
How to populate the page via JQuery after I have the json returned
<p>Ok so i have the json object returned back from my script and I have all the data but how do I put it on the page. Here is what i have so far </p> <p>I have a php page which has a loop like this</p> <pre><code>&lt;div class="main-blue"&gt; &lt;div class="blue-items"&gt; &lt;?php foreach ($related as $row_r) { ?&gt; &lt;div class="item-blue"&gt; &lt;div class="image left"&gt; &lt;img src="&lt;?php print $row_r['image'] == "" ? "css/images/blue-png2.png" : "css/images/{$row_r['image']}" ?&gt;" alt="" /&gt; </code></pre> <p>As you can see the Php loop is looping through the array $related which has lots of products. I have an ajax call that can change the data in this array and regenerate the page. I have the new data from a getjson call</p> <pre><code> $.getJSON('function.php?type=piz&amp;count=5', function(data) { $(data).each(function(key, value) { console.log(value); }); }); </code></pre> <p>How do i recreate the page using the new data</p>
php jquery
[2, 5]
4,426,474
4,426,475
Can Somebody Explain this java code
<p>I'm just starting out on android and my java is verry rusty. I can't remember ever seeing a function nested in another function like this before. Could somebody explain to me exactly what final does and explain why you would nest a function in another like this? </p> <pre><code>private final Handler handler = new Handler() { @Override public void handleMessage(final Message msg) { Log.v(Constants.LOGTAG, " " + ReviewList.CLASSTAG + " worker thread done, setup ReviewAdapter"); progressDialog.dismiss(); if ((reviews == null) || (reviews.size() == 0)) { empty.setText("No Data"); } else { reviewAdapter = new ReviewAdapter(ReviewList.this, reviews); setListAdapter(reviewAdapter); } } }; </code></pre>
java android
[1, 4]
3,909,436
3,909,437
how to disable back button in browser when user logout in asp.net c#
<p>Our problem is we are able to clear session on logout. But if user click the back button then he/she can go through all previous. But the advantage is that on a single click on any of of such previously surf page bring user to login page back ,we had done that.But our requirement is we should no allow user to go through the previously surf page.Please reply fast.</p>
c# asp.net
[0, 9]
3,040,803
3,040,804
Resizing Images with jquery ( nivo plugin )
<p><a href="http://nivo.dev7studios.com/demos/" rel="nofollow">http://nivo.dev7studios.com/demos/</a></p> <p>I am not a JS dev, I would like to know how to reduce the image in the the slider.</p> <p>The js file that handlle this feature is jquery.nivo.slider.pack.js</p> <p>Can some one help ?</p>
javascript jquery
[3, 5]
3,088,957
3,088,958
How to run activity, if app in background?
<p>I writing the network application and i have a problem with starting activity if the application in background. I want to start activity when some data comes to network. In my Actity A a have a receiver and when it receive some answer from server, it must run the Activity B. But if the App in background, Activity B not starting and metod onCreate() doesn`t execute. It execute only when the user go back to App. But its not really what i want, becouse in Activity B i need to start timer and i neen to enable GPS and some other work. Besides that, Activity B receive some data too, and if B not existing - this receiver will never receive anything. I tryed IntentServise, but its not working - result the same as without him. Any ideas? Thanks for any information :-)</p>
java android
[1, 4]
3,148,462
3,148,463
Cursor : get the field value (Android)
<p>I have problems with Cursor in my Android application. I have a SQLiteDatabase that return me Cursor when I try to fetch the values with :</p> <pre> public Cursor fetchOption(long rowId) throws SQLException { Cursor mCursor = mDb.query(true, DATABASE_TABLE, new String[] {KEY_ROWID, KEY_TITLE, KEY_BODY}, KEY_ROWID + "=" + rowId, null, null, null, null, null); if (mCursor != null) { mCursor.moveToFirst(); } return mCursor; } </pre> <p>But I don't know how to obtain the value of the field in the Cursor. If I do that :</p> <pre> String a = mOptionDb.fetchOption(0).getColumnName(0).toString(); String b = mOptionDb.fetchOption(0).getColumnName(1).toString(); String c = mOptionDb.fetchOption(0).getColumnName(2).toString(); </pre> <p>I obtain the name of the columns (_id, title, body) but not the value. How can I resolve that?</p> <p>Thank you in advance for your answer. Michaël</p>
java android
[1, 4]
3,666,128
3,666,129
How to become an expert in Python, PHP and Javascript?
<p>So I've been programming for about 9ish months now, and I've taught myself some Python, some PHP and some Javascript.</p> <p>I want to become better at these languages - I can hack something out, but a lot of things like OOP, using lists in the most effective ways, etc, is lost on me.</p> <p>What are the best ways to become an "expert" programmer? Does it depend on the nuances of the language, or is it more general? Is there any math I should be studying alongside it? Obviously a lot depends on what you want to do with it - so far I've mostly done small scale internal applications as well as web programming. How do I find out about good program design?</p>
php javascript python
[2, 3, 7]
4,052,450
4,052,451
Is excessive DataTable usage bad?
<p>I was recently asked to assist another team in building an ASP .NET website. They already have a significant amount of code written -- I was specifically asked build a few individual pages for the site.</p> <p>While exploring the code for the rest of the site, the amount of DataTables being constructed jumped out at me. Being a relatively new in the field, I've never worked on an application that utilizes a database as much as this site does, so I'm not sure how common this is. It seems that whenever data is queried from our database, the results are stored in a DataTable. This DataTable is then usually passed around by itself, or it's passed to a constructor. Classes that are initialized with a DataTable <em>always</em> assign the DataTable to a private/protected field, however only a few of these classes implement IDisposable. In fact, in the thousands of lines of code that I've browsed so far, I have yet to see the Dispose method called on a DataTable.</p> <p>If anything, this doesn't seem to be good OOP. Is this something that I should worry about? Or am I just paying more attention to detail than I should? Assuming you're most experienced developers than I am, how would you feel or react if someone who was just assigned to help you with your site approached you about this "problem"?</p>
c# asp.net
[0, 9]
3,675,895
3,675,896
Is there a Java equivalent of php's gzdeflate?
<p>I'm using Java to construct a url to a php site. The query string has a parameter that has been compressed using php's gzdeflate. Is there a way in Java that I can do the same thing gzdeflate does?</p>
java php
[1, 2]
1,964,300
1,964,301
Refresh a PHP include using jQuery
<p>I have a PHP include file which contains a lot of user actions i.e. login, logout, toolbars, buttons etc. This file is the same across the entire site hence the include. Inside the include I have jQuery scripts which call other files to validate a user login, log them out, user menus etc. This include is the entire header of the site.</p> <p>Now I want to reload this include after say a user logs into the site but I do not want to reload the entire page and they could be performing action which I dont want them to lose or I dont want them to be stored as cookies/sessions.</p> <p>There is a container div (#dynamicHeader for for example) which holds the include.</p> <p>I have tried the .load() from within the include but that does nothing. I know the content is being replaced correctly as I have tried .html("logged in") and the container div displays this. Does anyone know a way to reload the include from within the include?</p> <p>Many thanks</p>
php jquery
[2, 5]
164,544
164,545
Toggle divs open and close - ensure only one div visible at any time, not all
<p>I am using the below script to toggle open and close divs on click:</p> <pre><code>(function ($) { $.fn.showHide = function (options) { //default vars for the plugin var defaults = { speed: 1000, easing: '', changeText: 0, showText: 'Show', hideText: 'Hide', }; var options = $.extend(defaults, options); $(this).click(function () { // this var stores which button you've clicked var toggleClick = $(this); // this reads the rel attribute of the button to determine which div id to toggle var toggleDiv = $(this).attr('rel'); // here we toggle show/hide the correct div at the right speed and using which easing effect $(toggleDiv).slideToggle(options.speed, options.easing, function() { // this only fires once the animation is completed if(options.changeText==1){ $(toggleDiv).is(":visible") ? toggleClick.text(options.hideText) : toggleClick.text(options.showText); } }); return false; }); }; })(jQuery); </code></pre> <p>What would be the best method to automatically close any currently open divs before opening the next (to prevent all being open on page - only have the clicked link visible)</p> <p>HTML is below:</p> <pre><code>&lt;a href="#" class="show_hide" rel="#slidingDiv"&gt;View&lt;/a&gt;&lt;br /&gt; &lt;div id="slidingDiv" style="display:none;"&gt; Fill this space with really interesting content. &lt;/div&gt; &lt;a href="#" class="show_hide" rel="#slidingDiv_2"&gt;View&lt;/a&gt;&lt;br /&gt; &lt;div id="slidingDiv_2" style="display:none;"&gt; Fill this space with really interesting content. &lt;/div&gt; </code></pre> <p>Im guessing just a quick check before the open is fired - but Im unable to thus far get it to work.</p> <p>Many thanks in advance!</p>
javascript jquery
[3, 5]
1,343,806
1,343,807
How to give relative path in asp.net 2012
<p>I have created a new folder say XML by using solution explorer. I have added <code>xml</code> and <code>xsl</code> files say <code>a.xsl</code> and <code>b.xml</code> in it. How can I fetch these files by giving relative path?</p> <p>Example: <code>transform.Load("~/XML/a.xsl"); //load up the stylesheet</code></p> <p>But I am getting error here that file not found. When I debug it tries to take file from following path</p> <pre><code>C:\Program Files\IIS Express\~\XML\PersonnelHTML.xsl'. </code></pre> <p>Please suggest the solution</p>
c# asp.net
[0, 9]
5,446,408
5,446,409
auto collapse html content
<p><br/> Perhaps you can't help me. I want to auto create <strong>jquerymobile collapses</strong> (<a href="http://jquerymobile.com/test/docs/content/content-collapsible.html" rel="nofollow">http://jquerymobile.com/test/docs/content/content-collapsible.html</a>) with javascript a content like this :</p> <pre><code>&lt;h3&gt;title 1&lt;/h3&gt; some text &lt;h3&gt;title 2&lt;/h3&gt; some text &lt;h3&gt;title 3&lt;/h3&gt; some text </code></pre> <p>This content come from JSON that i can't manipulate before.<br/>I must wrap each :</p> <pre><code>&lt;h3&gt;title&lt;/h3&gt; some text </code></pre> <p>with this :</p> <pre><code>&lt;div data-role="collapsible" data-collapsed="true"&gt;&lt;/div&gt; </code></pre> <p>but i can't do this... Help !</p>
javascript jquery
[3, 5]
1,619,564
1,619,565
reuse code when binding to click
<p>Given the following:</p> <pre><code> $(document).ready(function() { $('a.went-cold-turkey').click(function() { $("body").css("cursor", "progress"); var activity_day = this.rel; $.ajax({ url: this.href, type: "GET", cache: false, success: function (html) { $('#'+activity_day).replaceWith(html); $("body").css("cursor", "auto"); } }); return false; }); $('a.did-it-once').click(function() { $("body").css("cursor", "progress"); var activity_day = this.rel; $.ajax({ url: this.href, type: "GET", cache: false, success: function (html) { $('#'+activity_day).replaceWith(html); $("body").css("cursor", "auto"); } }); return false; }); }); </code></pre> <p>As you can see both ".click" calls are practically identical. How can I share repetitive code in both to keep things DRY?</p>
javascript jquery
[3, 5]
1,005,346
1,005,347
Jcarousel change a divs text depending on first item shown
<p>I'm having a problem with Jcarousel where i need to have a divs text changing when the next button is pressed on the carousel. I have the carousel set up and working how i want, scrolling one item at a time:</p> <pre><code>jQuery(document).ready(function() { jQuery('.mycarousel').jcarousel({ scroll : 1 });}); </code></pre> <p></p> <pre><code> &lt;li&gt; &lt;img src="img/slider/slide1.gif" alt="slide1" /&gt;&lt;/li&gt; &lt;li&gt; &lt;img src="img/slider/slide2.gif" alt="slide1" /&gt; /li&gt; &lt;li&gt; &lt;img src="img/slider/slide3.gif" alt="slide1" /&gt; /li&gt; </code></pre> <p>Now i want to append the the text inside a div when the next button is pressed i know Jcarousel has the itemFirstInCallback: function but I'm totally lost on how to use this to append a divs text:</p> <pre><code> &lt;div class="copy"&gt; &lt;p&gt; example text &lt;/p&gt; &lt;/div&gt; </code></pre> <p>Any ideas?</p> <p>Thanks,</p> <p>Liam</p>
javascript jquery
[3, 5]
987,424
987,425
How to show edit text field on HTML page programmatically?
<p>I have the following task: there are a simple table from mysql database:</p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;table border='1'&gt; &lt;?php mysql_connect('url','user','') or die('Connect'); mysql_select_db('jquery_test') or die('Db'); $query=mysql_query('SELECT * FROM labels'); while($data=mysql_fetch_assoc($query)) { echo '&lt;tr&gt;'; echo '&lt;td&gt;'.$data['id'].'&lt;/td&gt;'; echo '&lt;td&gt;'.$data['label'].'&lt;/td&gt;'; echo '&lt;td&gt;'.$data['english'].'&lt;/td&gt;'; echo '&lt;/tr&gt;'; } ?&gt; &lt;/table&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>This code show a simple talbe. I need to make the following feature: when the user moves the cursor to $data['english'] field then it must appear the text field for editing and "Save" button; when the cursor leaves this word then the field must dissapear. There is a fantastic example what I mean: <a href="http://translate.uservoice.com/sets/51-end-user-ru/translations?filter=missing" rel="nofollow">http://translate.uservoice.com/sets/51-end-user-ru/translations?filter=missing</a>. Please, help me, I know only HTML/PHP and don't know how can I do this task. It will be very good to use JQuery for it. </p>
php javascript jquery
[2, 3, 5]
3,307,080
3,307,081
Is it possible populate the updated data in a repeater with out refreshing the page/using and update panel?
<p>H All,<br/> Is it possible to populate the updated data from the database to a repeater with out refreshing the page and with out using an update panel? <br/></p> <p>This is my requirement.</p> <p>I have an option to save Name &amp; Age to the database <br/> eg:</p> <p>Name &lt;*textbox accepts name> : Age &lt;*textbox accepts the name> <strong>Save Button</strong><br/></p> <p>i have a repeater which displays first 50 items displayed below save panel. eg: </p> <p><strong>Name Age</strong><br/> Rahul 30<br/> Sameera 32<br/> Manju 28<br/></p> <p>On click of the Save button I am calling Jquery to insert my data into the database. After this i need to update my repeater as well.</p> <p>I don't wanna refresh the page or to use update panel. Is there any option to do so???using some jquery or some thing like that????</p>
javascript asp.net jquery
[3, 9, 5]
5,961,507
5,961,508
Date Range Loop in asp.net, C#
<p>How do i loop through between two date Ranges in C# ?</p> <p>For Example- </p> <p>I am creating a credit card EMI Module, Suppose one user wants to 6 EMI I have a date range of : <code>"08/02/2009-08/08/2009"</code> I need to loop through each month</p> <p>input : </p> <pre><code>Start Date- 08/02/2008 End Date - 08/07/2009 Charge Cycle - 6 </code></pre> <p>Output will be like -</p> <pre><code>08/02/2008 08/03/2008 08/04/2008 08/05/2008 08/06/2008 08/07/2008 </code></pre>
c# asp.net
[0, 9]
4,927,738
4,927,739
Repeat line x to y every few second in php
<p>how i can repeat code from line x to y in php By Ajax.</p> <p>for example:</p> <p>mycode:</p> <pre><code>$info_2=('&lt;div id="infobox"&gt;'); echo $chat_2; $info_query=mysql_query("SELECT * FROM info WHERE fuid='$uid' or luid='$uid' "); $info_num=mysql_num_rows($info_query); for($i=0;$i&lt;$info_num;$i++) { $info_fetch=mysql_fetch_array($info_query); echo($info_fetch['username'].':'.$info_fetch['text'].'&lt;br&gt;'); } </code></pre> <p>$info_3=(''); echo $info_3;</p> <p>now i need repeat this code every x second.</p>
php javascript
[2, 3]