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
1,086,759
1,086,760
Android: onOptionsItemSelected() called in SherlockActivity, but not in SherlockFragmentActivity
<p>I have problems with the onOptionsItemSelected() in SherlockFragmentActivity. The onCreateOptionsMenu() is called and the option menu is built perfectly, but when I click on an Options item, the onOptionsItemSelected() isn't called.</p> <p>I tried the same following code in a test Project using SherlockActivity and there it works:</p> <pre><code> @Override public boolean onCreateOptionsMenu(Menu menu) { menu.add(0, 1, 0, "hi").setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT); menu.add(0, 1, 0, "ha").setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER | MenuItem.SHOW_AS_ACTION_NEVER); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == 1) { // Do someting! } return true; } </code></pre> <p>In both cases, the following imports are done:</p> <pre><code> import com.actionbarsherlock.app.ActionBar; import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.MenuItem; </code></pre> <p>Does anyone know help? Thank you!</p>
java android
[1, 4]
5,623,488
5,623,489
Jquery mouseover event don't work
<p>I write a image share js script. It will add a div wrapper once there is an image in the page. For example,</p> <pre><code>&lt;img href="xxx.jpg" /&gt; </code></pre> <p>My script will make it to</p> <pre><code>&lt;div class="wrapper"&gt; &lt;img href="xxx.jpg" /&gt; &lt;/div&gt; </code></pre> <p>And, there is also a mounseover event in .wrapper class. Everything is going well untill the code structre below. We have a blog site, there is so many div wrapperd the img tag. </p> <pre><code>&lt;div class="a"&gt; &lt;img href="xxx.jpg" /&gt; &lt;/div&gt; </code></pre> <p>while my js script wrapper a "wrapper" class, my mouseover event does not work anymore in these HTML structure. Anyone could tell me what's happened here? Thanks in advance!</p>
javascript jquery
[3, 5]
2,885,304
2,885,305
jQuery on click css3 rotation
<p>I need to get an image to rotate having its transform origin at 50% 50%. is the following correct? It does not seem to work for me.</p> <pre><code> function slideUp_Menu(){ $('.main_nav').slideUp('slow', function(){ $("#arrow_up").css({ "-webkit-transform": "rotate(180deg)" }); $("#arrow_up").css( "-webkit-transform-origin", "50% 50%"); });// $('.tab_wrapper').animate({ marginTop: '193px' }, 500, 'linear'); } </code></pre>
javascript jquery
[3, 5]
4,377,927
4,377,928
Button Switch case
<p>I can't seem to get this to work in jquery. I am using this code as an alternative to having to define each button, however this does not work :/</p> <p><a href="http://jsfiddle.net/pufamuf/FV4jW/1/" rel="nofollow">http://jsfiddle.net/pufamuf/FV4jW/1/</a></p> <p>Also, I was wondering if/how I can use more than one statement for each case. Thank you :)</p>
javascript jquery
[3, 5]
4,647,514
4,647,515
Add and transform layers of images and text like Photoshop fx
<p>This is just a question of approach and ideas, rather than solving an issue.</p> <p>You know it from Photoshop, where you can add layers of text and images onto each other and transform and move them around to design a complete image. </p> <p>What do you call this? And do you know some jQuery plugins that does this?</p> <p>Thank you in advance.</p> <p>EDIT: I don't need any other Photoshop feature, as blending, filters etc.</p>
javascript jquery
[3, 5]
5,829,363
5,829,364
jQuery parents then locate a div to hide
<p>Ok, so i've got this .parents() function that goes outside to a located class/id. In my case, (.wrapper).</p> <pre><code>&lt;div class="wrapper"&gt; &lt;div class="hide"&gt;Hide Class&lt;/div&gt; &lt;div class="boxClass&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>I've got a list of these div's on a single page, so, if i click the "Hide Class" text, everything would fadeout, since everything in the list, has the same class name. Now, back to my question. I use .parents() to locate (.wrapper) (i know this can be done with (.parent)). But how can i use .parents to go back and then select (fadeOut) a class inside it? EX, boxClass?</p>
javascript jquery
[3, 5]
1,550,869
1,550,870
PHP - Make some fields anonymous
<p>I'm using PHP. I have somes forms that will be used to votes, surveys, etc. I'd like to know how can i make the fields like Name, second name anonymous when the form is submited. The votes, survey, are not all anonymous, it should be an option for the admin to define if the form is anonymous or not. Could you please explain me how can I do this?</p> <p>Thanks.</p>
php javascript
[2, 3]
125,123
125,124
Detecting Change jQuery
<p>So I have this notification system that uses jQuery and PHP. The jQuery checks the PHP script every few seconds, and if there is a change, it is displayed. I want to know how to detect a change in the data (like from '1' to '2') and then responding by causing the object to animate (using this: $(this).effect("shake", { times:3 }, 300);). How can I do this?</p> <p><strong>jQuery</strong></p> <pre><code>$(document).ready(function() { $.get('/codes/php/nf.php', function(data { $('#badge').badger(data);});}); setInterval(function(){ $.get('/codes/php/nf.php', function(data) { $('#badge').badger(data);});}, 8000); </code></pre>
php jquery
[2, 5]
5,081,535
5,081,536
multiple functions in the document.ready function
<p>here's my code:</p> <pre><code>$(document).ready(function () { $('.flip1').click(function () { $('.panel1').slideToggle("slow"); }); $('.flip2').click(function () { $('.panel2').slideToggle("slow"); }); $('.flip3').click(function () { $('.panel3').slideToggle("slow"); }); $('.flip4').click(function () { $('.panel4').slideToggle("slow"); }); }); </code></pre> <p>I want to make a loop with .flip as the variable (flipVar) and .panel as (panelVar)</p>
javascript asp.net jquery
[3, 9, 5]
567,407
567,408
Object Serialization in Java and Android
<p>how to write more than one object to ObjectOutputStream in single response(Objects are not fixed,objects are creating dynamically as per user's request).can i use either Arraylist or Vector for this,please give some sample program.</p> <pre><code>TexxtViews text=new TexxtViews(2, -2, 2, "WELCOME TO CCS");//First Object ButtonView button=new ButtonView(-2, 2, "OK");//Second Object ArrayList array=new ArrayList(); array.add(text); array.add(button); OutputStream out = resp.getOutputStream(); ObjectOutputStream outSt = new ObjectOutputStream(out); outSt.writeObject(array); </code></pre> <p>tried this code</p>
java android
[1, 4]
5,049,616
5,049,617
How to write javascript function to check JRE version
<p>I am new to javascript. How to write javascript function which will return installed java version in the computer.</p> <p>Thanks Sunil Kumar Sahoo </p>
java javascript
[1, 3]
665,031
665,032
Changing DIV color without giving an ID?
<p>I have the following code : </p> <pre><code>&lt;div id="wrapper"&gt; &lt;div style="width:500px;background-color:yellow;"&gt; // this is a parent div &lt;div style="width:260px;"&gt; &lt;a href="javascript:XXXXX"&gt;Click me to color only the FIRST yellow div&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;div style="width:500px;background-color:yellow;"&gt; // this is a parent div &lt;div style="width:260px;"&gt; &lt;a href="javascript:XXXXX"&gt;Click me to color only the SECOND yellow div&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>Can I use jQuery to change the parent div's color without giving its ID or name?</p> <p>Thanks</p>
javascript jquery
[3, 5]
5,395,326
5,395,327
Why js function works inside of another function but not alone
<p>I have these two functions below and for whatever reason the windowedBox function only works when I call it from another function. If I directly call windowedBox(), it wont do anything. If I call getShareButtons(), it calls windowedBox() and works correctly. If anyone knows why this is happening, please help me. :(</p> <p>NOTE:: if you're wondering why it says $j and not $ its because i set it up that way.</p> <pre><code>function getShareButtons(){ var postPath = window.location.pathname; var videoTitle = 'asdf'; var videoURL = 'asdf'; //Output social button attributes $j(".facebook-share").attr('href', 'asdf'); windowedBox(); &lt;---THIS CALL WORKS } function windowedBox() { $j(".facebook-share, .twitter-share").click(function(){ window.open(this.href, videoTitle, "width=626, height=436", "status=0", "toolbar=0"); return false; }); } </code></pre>
javascript jquery
[3, 5]
2,675,456
2,675,457
keep content stay on tab1 after filling in tab2
<p>Seen from the attached image, the page has a tab menu. After filling in the information on the tab 1, then going to fill in tab 2. After completing to fill tab2, the content is lost on the tab1, because page refreshed after fill in tab2</p> <p>My question is how to keep content stay on tab1 after filling in tab2?</p> <p><strong>UPDATE</strong></p> <p><strong>If page isn't refresh after filling in tab2, the content will stay on tab1. However, the page refresh is required in the code for some reason.</strong></p> <p><img src="http://i.stack.imgur.com/SyJDN.jpg" alt="enter image description here"></p>
php javascript jquery
[2, 3, 5]
4,010,564
4,010,565
Detecting key strokes in a web form
<p>I've got a web form textbox with text mode set to multiple. Recently a feature stopped working and I can't figure out what happenned. When a user hit the [Return] key two consecutive times, the webform would trigger a submit button event via a client side javascript. Like this:</p> <pre><code>function postPage() { var inputString = document.getElementById("Search1_AccordionPane2_content_txtSearchText").value; if (inputString.match(/(\r\n){2,}/)) { document.getElementById("Search1_AccordionPane2_content_txtSearchText").click(); } } </code></pre> <p>The code hasn't changed, our users use IE8 on W7 and I suspect that this stopped working since going W7 or IE8. Also the browser settings are restricted by the group policy that I don't control. Any ideas where to start debugging this?</p> <p>Thank you,</p> <p>Risho</p>
javascript asp.net
[3, 9]
494,113
494,114
Javascript website preview?
<p>can i do a website preview on a link similar to facebook when you post a link? with image and short description</p>
javascript jquery
[3, 5]
4,417,856
4,417,857
jQuery href attribute addition visible in Firebug but not in the source code
<p>It may be trivial, but I have following code that is dynamically adding some <code>href</code> attributes to an <code>&lt;a&gt;</code> element, with important variables that are passed to php generated page in a pop-up window.</p> <pre><code>jQuery(document).ready(function(){ var url = jQuery("a.special-links").attr("href"); var data = "?iframe=true&amp;width=800&amp;height=350&amp;format=popup"; jQuery("a.special-links").attr("href", url + data); }); </code></pre> <p>When inspected the page with Firebug, the <code>&lt;a&gt;</code> element got the url <code>href</code> properties right, but link does not work. When I inspect the code looking at source code, I see that <code>href</code> data part was in fact not added!</p> <p>Is this runtime problem or something else ? Thanks for clues...</p>
javascript jquery
[3, 5]
4,040,063
4,040,064
two nearly equal jQuery functions; one works with IE, one doesn't
<p>I included two nearly identical jQuery functions in <a href="http://www.umiwebservice.com/" rel="nofollow">my homepage</a> which should increase or decrease the font-size. </p> <p>They both work perfectly fine with FireFox, but the increaseFont-function doesn't work with the Internet Explorer (it actually works one time, but not multiple times).</p> <p>Usually I'd say I made a mistake, but since it works with FireFox I guess it's Internet Explorer-related. Of course I did the usual research but haven't found anything relevant.</p> <p>My question is: What's the problem and is there a solution or workaround?</p> <p>Here's the code I used:</p> <pre><code>jQuery(document).ready(function() { // Reset Font Size var originalFontSize = jQuery('html').css('font-size'); jQuery(".resetFont").click(function() { jQuery('div#mainContainer').css('font-size', originalFontSize); }); // Increase Font Size jQuery(".increaseFont").click(function() { var currentFontSize = jQuery('div#mainContainer').css('font-size'); var currentFontSizeNum = parseFloat(currentFontSize, 10); var newFontSize = currentFontSizeNum * 1.05; jQuery('div#mainContainer').css('font-size', newFontSize); return false; }); // Decrease Font Size jQuery(".decreaseFont").click(function() { var currentFontSize = jQuery('div#mainContainer').css('font-size'); var currentFontSizeNum = parseFloat(currentFontSize, 10); var newFontSize = currentFontSizeNum * 0.95; jQuery('div#mainContainer').css('font-size', newFontSize); return false; }); });​ </code></pre> <p>Thank you very much.</p>
javascript jquery
[3, 5]
2,758,580
2,758,581
problem in if & else?
<p>why don't work <code>if(length_pa &gt;= 16){ ...</code> after select value "2" in select box and don't work <code>if(length_pa == 0){...</code> after select value "all" in select box???<br> [with change length(number) in <code>"var length_pa" $('#pagination a')</code> don't work "show" and "hide" for <code>#prev_pag, #next_pag</code>.] <p> <strong>EXAMPLE:</strong> <a href="http://www.binboy.gigfa.com/admin/accommodation/show" rel="nofollow">See This</a></p> <pre><code>var length_pa = $('.pagination a').size(); if(length_pa &gt;= 16){ $('.prev_pag, .next_pag').show(); }else{ $('.prev_pag, .next_pag').hide(); $('.pagination').css('float','none') } if(length_pa == 0){ alert('0000000000') $('.hesar_number').css('display','none'); } </code></pre> <p>what do i do?</p> <p><strong>Explanation:</strong> <br> If that value <code>2</code> be select, <code>.prev_pag, .next_pag</code> must show<br> If that value 'all' be select, <code>.hesar_number</code> must hide(<code>'display','none'</code>)<br> But these does not happen... why!?</p>
javascript jquery
[3, 5]
2,587,957
2,587,958
adding a div only if number of charecter exceeds the set limit
<p>I am trying to append a div to pdpTab5 if the tab contains more than 540 charecters. Where i will be creating a "read more..." sort of situation through a modal. </p> <p>I am truncating the text by using this. But the part of adding a div is making me confused. I dont want to show the div if the tab contains less than 540 charecters. </p> <pre><code>&lt;script&gt; $(function(){ var myDiv = $('#pdpTab5'); myDiv.html(myDiv.html().substring(0,540)); }); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
4,013,360
4,013,361
Accessing gridview from a non GridView event
<p>I have a button outside a gridview called "UpdateAll", i need to be able to click on such button and find an item template "DropDownList" and update the database with that value for each record, I am not sure how to go about this any ideas?</p> <pre><code> public void UpdateAll_Click(object sender, EventArgs e) { } </code></pre> <p>Now I know I can access the drop down in the GridView_RowCommand something like this</p> <pre><code> GridViewRow row = (GridViewRow)(((Button)e.CommandSource).NamingContainer); Myddl = row.FindControl("Quantity") as DropDownList; </code></pre> <p>But i am not sure how to do that from an outside event that is not GridView related, I can not do the one above because it accesses the <code>e.CommandSource.</code></p> <p>Please help.</p>
c# asp.net
[0, 9]
4,997,689
4,997,690
Show only client-side validation with client and server validators in asp.net
<p>If I have something like the following:</p> <pre><code>&lt;asp:TextBox id="test" runat="sever"&gt;&lt;/asp:TextBox&gt; &lt;asp:RequiredFieldValidator runat="server" ControlToValidate="test" ErrorMessage="Required"&gt;&lt;/asp:RequiredFieldValidator&gt; &lt;asp:Label runat="server" id="lblStatus"&gt;&lt;/asp:Label&gt; </code></pre> <p>if in the code behind, I set the label to "You must enter a value if the textbox is empty" to validate it on the server side and this is fine, but if javascript is enabled, I don't want to show the client side validation and the server side label together. Is this something where I would just have to disable the client-side validators if javascript was enabled?</p>
c# asp.net
[0, 9]
3,480,336
3,480,337
The use of globle in regular expression
<p>I used the regular expression <code>(/\&lt;+\/+\s+/gm,"&lt;/")</code>. If i remove the g the regular expression don't work. Please let me know technical difference between 'g-global and m-multiple'.</p>
php javascript
[2, 3]
5,651,395
5,651,396
How do I trap enter from form except textarea
<p>In a dynamic form, I have the following code to trap 'enter' key.</p> <pre><code>$(document).bind('keypress', function (e) { if (e.keyCode == 13) { e.preventDefault(); } }); </code></pre> <p>Occasionally, there is an element like HTMLTextAreaElement which accept 'enter' key. </p> <p>how do I unbind preventDefault only for HTMLTextAreaElement.</p> <p>TIA.</p>
javascript jquery
[3, 5]
874,110
874,111
Move focus from one control to another control just pressing enter key by Jquery
<p>suppose i have many html control in the page and all the control has a sequentially tab stop set.so if i press tab then focus move properly but i want to move focus just by pressing enter key instead of tab. so please tell me how could i programatically press tab when user will press enter key in my web page just by javascript or jquery. expecting small smaple code to achieve the effect i need.</p> <p>thanks.</p>
javascript jquery
[3, 5]
196,181
196,182
Why can't I bind visible of a control without runat=server?
<p>In other words, why can't I do this:</p> <pre><code>&lt;a id="projectsButton" visible=&lt;%= someFunctionWhichEvalsToFalse() ? false : true %&gt;&gt; &lt;/a&gt; </code></pre> <p>It seems to do nothing. I checked this by switching the false and true.</p> <p>What can I do about this?</p>
c# asp.net
[0, 9]
3,265,828
3,265,829
Use jquery mouseover to show status from callback
<p>Is it possible to use jquery to use a callback in a div and show the full text in another div? Currently I have in the right div:</p> <pre><code>$(document).ready(function(){ setInterval(function(){ $.post("status.php?_="+ $.now(), {day : "&lt;?php echo $day;?&gt;"}, function(upcoming){ $(".ticker").html(upcoming); }), "html" }, 45000); }); </code></pre> <p>And I need something like:</p> <pre><code>$(".view").hover(function(){ $("#left").load("a.php"); }); &lt;div id="left"&gt; &lt;div class="show"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="right"&gt; &lt;div class="ticker"&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>My php spits back html: <code>&lt;a href="" class="view"&gt;EventID&lt;/a&gt;</code> </p> <p>What I want to do is hover over the hyper link and have the full status shown in .show I know I'll have to do a query with the event number, but my search in doing this comes up empty. As always, any help is appreciated</p>
php jquery
[2, 5]
1,220,998
1,220,999
How do I add a function to an element via jQuery?
<p>I want to do something like this:</p> <pre><code>$('.dynamicHtmlForm').validate = function() { return true; } $('.dynamicHtmlForm .saveButton').click(function() { if (!$(this).closest('.dynamicHtmlForm').validate()) { return false; } return true; }); </code></pre> <p>And then when I have a form of class dynamicHtmlForm, I want to be able to provide a custom validate() function:</p> <pre><code>$('#myDynamicHtmlForm').validate = function() { // do some validation if (there are errors) { return false; } return true; } </code></pre> <p>But I get this when I do this:</p> <pre><code>$(this).closest(".dynamicHtmlForm").validate is not a function </code></pre> <p>Is what I've described even possible? If so, what am I doing wrong?</p>
javascript jquery
[3, 5]
4,640,285
4,640,286
jQuery `hasClass()` doesn't produce any result
<p>I am simply trying to find out if the parent of the <code>A</code> (i.e. the <code>P</code>) has a class called <code>some_class</code> defined on it. I will then use the <code>true</code>/<code>false</code> result in a conditional.</p> <p>I have a simple structure:</p> <pre><code>&lt;div class="things"&gt; &lt;p class="some_class"&gt; &lt;a href="something"&gt;Link One&lt;/a&gt; &lt;/p&gt; &lt;/div&gt; </code></pre> <p>And some jQuery script:</p> <pre><code>$(function() { $('.things a').click(function(e) { e.preventDefault(); alert($(e.target).parent()[0].nodeName); //works, displays "P" alert($(e.target).parent()[0].hasClass('some_class').toString()); //No output }); }); </code></pre> <p>The call to the second <code>alert()</code> does nothing - no alert box is displayed at all.</p> <p>What am I doing wrong?</p> <p>A <a href="http://jsfiddle.net/LVerN/2/" rel="nofollow">JSFiddle is here</a></p>
javascript jquery
[3, 5]
2,704,202
2,704,203
Play Sound Javascript/Jquery
<p>I would like to request help from experts here but I would like to explain my requirements first. I am building an Ajax Based application that will run on our local intranet network.</p> <ol> <li>Now upon every return of request from my Ajax, I need to play a sound in my client browser.</li> <li>I want to put a sound file (mp3/wav) in my web server (Tomcat) directory where the application will download and play at the client browser. (I dont want to embed this and will just automatically play)</li> </ol> <p>But I basically have this limitation.</p> <ol> <li>Our target users intranet computers has no access to the outside internet since this is being block by our network team.</li> <li>Most of the client runs on Windows XP and Flash might not be updated or not being installed.</li> </ol> <p>I know a little jquery but I dont know if what I am thinking is possible and what possible plugin can I use that is basically cross browser. My target browse runs on IE6/IE7/IE8/FF3. Please advise.</p>
javascript jquery
[3, 5]
1,642,517
1,642,518
I want to break my text into two parts - asp.net
<p>Here's the problem:</p> <p>I have couple of pages which gets its content from a database. The content is displayed in a Literal control kept on an asp.net page.</p> <p>The article sometimes gets quite long so I want to break the content into two parts using a client script. Unfortunately I cannot change the query to pull data partially. The entire data has to come.</p> <p>What I want is that when the page (<a href="http://mysite.com/showpage.aspx?pid=45" rel="nofollow">http://mysite.com/showpage.aspx?pid=45</a>) or any other page is opened, I show the first 500 words in that literal control. A Link gets generated below the 500 words which says 'Click Here to View More...'</p> <p>On clicking this link, a postback occurs and this time the entire content is shown to the user. I understand there is an extra roundtrip required but that's ok for my users.</p> <p>How can I create such a functionality? Please help me with the script. Thanks.</p>
asp.net javascript
[9, 3]
5,651,033
5,651,034
Hooking into the change() event on jQuery .toChecklist
<p>I'm experiencing a problem when I attempt to use the .change() event on select lists, using the jQuery .toChecklist plugin.</p> <p>My page contains a number of select lists, which are changed to CheckLists, using jQuery. </p> <p>Consider the following Javascript snippet:</p> <pre><code>for (var i=0;i&lt;5;i++) { var selectListId = 'selectList' + i; // Assume this line represents the outputting on a // standard select list // Convert to Checklist $("#" + selectListId).toChecklist(); $("#" + selectListId).change ( function () { alert("SelectListId: " + selectListId); } ); } </code></pre> <p>For each iteration of this loop, I output a multi-select list, convert it to Checklist, and then add the .change() handler.</p> <p>However, when the page renders (visually, everything is fine), choosing an option from ANY of the lists gives the alert text of "SelectListId: selectList4" (ie. the last list id of the loop). Thus it appears that each invocation of .change() globally replaces the change handler.</p> <p>Does anyone know how to change the code so that each checklist has its own change handler (so that the first change handler would output "SelectListId: selectList0", etc).</p> <p>Thanks,</p>
javascript jquery
[3, 5]
3,687,569
3,687,570
How do I add view with id in android dynamically?
<p>Hello everyone i'm new to android and I would like to ask about a basic feature.</p> <p>Suppose I have a TableLayout and I want to add some rows to it dynamically (from java code) so that each row will contain a checkbox that should has a unique ID (suppose row1, row2, etc..). I can't touch r.id at runtime, and the id I pick for the elements must be an integer, so how can I assure it's unique ? is there any way to add ID in form of a string (such as row1)?</p> <p>Thanks in advance, Christopher</p>
java android
[1, 4]
4,601,022
4,601,023
how to get the asp.net drop down list items in javascript
<p>I have one dropdownlist in my c# code behind page like `DropDownList dl = new DropDownList(); dl.Items.Add("Item 2");</p> <pre><code> dl.Items.FindByText("Item 2").Value="2"; dl.Items.Add("Item 3"); dl.Items.FindByText("Item 3").Value="3";` </code></pre> <p>I like to get that drop down list items in client side java script. one important think note that I like to get values of dropdownlist in the c# code behind page and not the asp.net page. Can anyone know the solution for that problem?</p> <p>Thank you...</p>
c# asp.net
[0, 9]
3,382,151
3,382,152
Call focus() after jQuery append() is completed
<p>I have an <code>append()</code> and a <code>focus()</code> which is set to focus the first input in the appended <code>dom</code>. </p> <p>IE is taking time to append and so the focus is not working. Is there a way (other than <code>setTimeout</code>) to set the focus after the <code>dom</code> is fully appended? </p> <p>Thanks!</p>
javascript jquery
[3, 5]
2,880,692
2,880,693
C# version of Javascript Date.getTime()
<p>What is the best way in c# to get the same result of javascript date.gettime() call?</p> <blockquote> <p>The getTime() method returns the number of milliseconds since midnight of January 1, 1970 and the specified date.</p> </blockquote>
c# javascript
[0, 3]
5,323,196
5,323,197
Make Keyboard keys run JavaScript if the mouse isn't in a Textarea/textbox
<p>Like if they press A regardless of the caps for it to pull up Apps, Pressing D pulls up Dashboard. This should only work if their mouse is not in a area where they can type. How would i do this?</p>
javascript jquery
[3, 5]
1,752,332
1,752,333
passing array by calling activity from a thread
<p>Hello I have two activities:</p> <ol> <li><p>"a" that spawns thread for generating a dynamic array of values inside <code>public void run()</code> function.</p></li> <li><p>"b", graphics activity that will help me draw rectangular pulses based on array values calculated in activity "a" (calculated in a's thread to be precise).</p></li> </ol> <p>When I am in thread inside "a", how do I pass values of array to activity "b" and call activity as well. </p> <pre><code>activity a { thread - array calculation, call activity b, pass array values, call another activity } activity b { store array values from activity a, draw rectangles based on array values } </code></pre>
java android
[1, 4]
102,666
102,667
Asp.net Set Textbox 1 to Equal Textbox 2
<p>What's the <strong>cleanest</strong> way, like <strong>1 line</strong> of JavaScript code, to set one text box's text property to equal another?</p> <p>e.g. the JavaScript way to accomplish this:</p> <pre><code>txtShipCity.Text = txtCity.Text; </code></pre> <p>Thanks!</p>
asp.net javascript
[9, 3]
5,554,053
5,554,054
Internet Explorer file input onchange
<p>I have these dynamically added file inputs, that I then use a jQuery 'Ajax' file upload plug-in with. I'd like the upload to start once the input value has been 'changed'. However, Internet Explorer doesn't seem to respect the onchange event like other browsers. How can I do this?</p> <p>Here is, more or else, the code that is affected:</p> <pre><code>var html = $('&lt;div class="add_input"&gt;&lt;input type="file" name="file"/&gt;&lt;/div&gt;').change(submit); $('#add_inputs').prepend(html); </code></pre>
javascript jquery
[3, 5]
4,419,898
4,419,899
How to check if javascript (js file) has been loaded or not loaded using PHP
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3976277/using-php-to-check-is-a-javascript-file-has-been-loaded">using php to check is a javascript file has been loaded?</a> </p> </blockquote> <p>Is it possible to check if the js file is already loaded in a page using PHP? Because I have some block on my page that needs the js file. So if the js file is not loaded then don't load this block.</p> <p>It's something like this:</p> <p>if js file is not loaded then don't execute this php script else execute this php script</p>
php javascript
[2, 3]
2,900,505
2,900,506
can I trigger click event onload
<p>I am having anchor tag in my page. I like to trigger click event onload . Which means I wanna open this page "http://XXXXX.com" with new tab. Because I don't wanna popup blockers. Is there anyway to do this?</p> <p>anchor attrs are given bellow</p> <pre><code>id="add_redirect" href="http://XXXXX.com" target="_blank" </code></pre>
javascript jquery
[3, 5]
231,721
231,722
Get address of the page from which redirected to new page
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3805438/get-previous-page-url-after-response-redirect">Get previous page URL after Response.Redirect</a> </p> </blockquote> <p>Suppose in page 1.aspx, if error occurs, I'm using in catch() block:</p> <pre><code>Response.Redirect("err.aspx"); </code></pre> <p>In code behind of err.aspx, I need url of 1.aspx (or any page from which I'm redirecting to err.aspx page). How do I achieve this?</p>
c# asp.net
[0, 9]
5,801,735
5,801,736
Avoid Page_Load to effect my array, using AJAX
<p>I have a textbox that the user suppose to place numbers on it, and after he push the button, the number should pass to an array.</p> <p>and each number and button pushed, should be saved in this array in order (for example : 3 , 4, 5, ....)</p> <p>The problem is, that each time I push the button, then <code>page_load</code> occurs. I have this code :</p> <pre><code> protected string[] CurrentArr; protected void Page_Load(object sender, EventArgs e) { if (CurrentArr != null) { CurrentArr = (string[])Session["CurrentArr"]; } else CurrentArr = new string[length]; </code></pre> <p>which <code>CurrentArr</code> is the array that change over time.</p> <p>I tried to solved it with AJAX as well :</p> <pre><code>&lt;asp:ScriptManager runat="server" ID="sm"&gt; &lt;/asp:ScriptManager&gt; &lt;asp:UpdatePanel runat="server" ID="update"&gt; &lt;ContentTemplate&gt; &lt;input type="text" class="response" id="how_many" name="guess" placeholder="Enter your guess..." /&gt; &lt;asp:Button runat="server" class="button red" id="generate" name="generate" value="Generate!" OnClick="guess_Click" /&gt; &lt;asp:Button runat="server" class="button red" id="win" name="win" value="you won" /&gt; &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt; </code></pre> <p>but it has no effect over my array (although my page doesnt post back...)</p> <p>anyone has a solution ?</p> <p>Thanks!</p>
c# asp.net
[0, 9]
1,672,166
1,672,167
Library to write javascript code
<p>Is there a c# library that can help to write and indent Javascript code.</p> <p>It's because I'm writing some c# code that generated some Javascript code. Something like this :</p> <pre><code>js += "&lt;script type=\"text/javascript\"&gt;\n"; js += " function()...\n"; </code></pre> <p>And I find that generated a lot of ugly code.</p> <p>So, I thought that maybe a existing library can help me doing that ? </p>
c# javascript
[0, 3]
82,844
82,845
Can't adjust label widths. JQuery
<p>I have such a sketch: <a href="http://jsfiddle.net/challenger/upcZJ/" rel="nofollow">http://jsfiddle.net/challenger/upcZJ/</a>.</p> <p>I found an article <a href="http://www.jankoatwarpspeed.com/post/2008/07/09/Justify-elements-using-jQuery-and-CSS.aspx" rel="nofollow">http://www.jankoatwarpspeed.com/post/2008/07/09/Justify-elements-using-jQuery-and-CSS.aspx</a> which explains how to adjust label widths relative to the widest one.</p> <p>But I can't do the same. What have I missed? I've tried do the thing inside an <code>accordion tab</code> and inside <code>aside division</code>.</p> <p>Thanks!</p>
javascript jquery
[3, 5]
3,523,500
3,523,501
How does jQuery’s .text() work, internally?
<p>I quickly tried to find the implementation in jQuery’s source, but only found <a href="https://github.com/jquery/jquery/blob/61e37d41490aed319a176c6ca7feb95e5505059c/src/manipulation.js#L33-46" rel="nofollow">this</a> which doesn’t actually seem to define it completely.</p> <p><strong>From the jQuery Source</strong></p> <pre><code>... snip ... jQuery.fn.extend({ text: function( text ) { if ( jQuery.isFunction(text) ) { return this.each(function() { return jQuery(this).text( text.call(this) ); }); } if ( typeof text !== "object" &amp;&amp; text !== undefined ) { return this.empty().append( (this[0] &amp;&amp; this[0].ownerDocument || document).createTextNode( text ) ); } return jQuery.getText( this ); }, ... snip ... </code></pre> <p>Anyone know?</p> <p><strong>Clarification:</strong> I know how to <em>use</em> it. I just want to know how to get the text of an element à la jQuery when jQuery isn’t available.</p>
javascript jquery
[3, 5]
5,605,316
5,605,317
C# Basic web HttpWebRequest, does not support Javascript
<p>I have a basic C# HttpWebRequest. My problem is the page that it is sending the GET request to, requires javascript (on the client-side) to be enabled for the content to generate.</p> <p>How can I add javascript support to my code? Is it even possible?</p>
c# javascript
[0, 3]
1,086,003
1,086,004
php variable in javascript
<p>I have the following code in php:</p> <pre><code>$test = 'abc'; echo '&lt;script type="text/javascript"&gt;\n'; echo 'movtitle = ' . $test . ';\n'; echo '&lt;/script&gt;'; </code></pre> <p>and I tried to do an <code>alert(movtitle)</code>, but it doesn't print out anything. What am I doing wrong?</p>
php javascript
[2, 3]
2,152,613
2,152,614
Basic second timer implementation
<p>I am very new to the android platform thus java so i have a pretty basic question i am trying to make a simple second timer so here is the code i have written. I don't know why but the method run never gets executed:</p> <pre><code> Timer tmr = new Timer(); tmr.schedule(new TimerTask() { @Override public void run() { TextView txt = (TextView) findViewById(R.id.txtLoading); counter++; txt.setText(counter); } }, 1000); </code></pre> <p>LE : actually it looks like it executing but the GUI doesn't get updated ... why ?</p>
java android
[1, 4]
1,596,629
1,596,630
Extract innerHTML from span[class]
<p>so my code is something along the lines of: </p> <pre><code>&lt;table&gt;&lt;tr&gt;&lt;td class="tdclass1"&gt; $('#nameoftable tr').each(function(){ tdclass1 = $(this).find(".classname").html(); if (tdclass1:contains('classname')) //do something here }); </code></pre> <p>What I want to do is simply extract the inner HTML of this specific span.</p> <p>Any help is appreciated :)</p>
javascript jquery
[3, 5]
2,293,108
2,293,109
jQuery - testing backend
<p>I have backend .php file in which I decide what to return as the ajax response - how can I test this .php file? If I write a var_dump() of print() inside of this file - how can I check what does this echoes?</p> <p>It's jquery ajax, and I don't see any ajax response in the firebug.</p> <p>I'm using ajax to create remote validation rules inside of the jquery validation plugin (<a href="http://docs.jquery.com/Plugins/Validation" rel="nofollow">http://docs.jquery.com/Plugins/Validation</a>), jquery version is 1.9.0.</p>
php jquery
[2, 5]
935,747
935,748
c[l][k] is not a constructor
<p>I have been trying to remove this Firebug Console Error from last few hours. The error which I am getting is:</p> <pre><code>c[l][k] is not a constructor jquery-ui-1.7.1.custom.min.js (line 10) </code></pre> <p>Any siggestions would be really helpful. Thank you!</p>
javascript jquery
[3, 5]
5,295,826
5,295,827
movenext and moveprevious navigation
<p>A dropdownlist with numerous items, movenext and moveprevious navigation buttons to display an image for each selected item. Each image is displayed in the same image control. The image data in the database is simply a path to the image file.</p> <p>Using the DataReader and stored procedure for data, how do I move next and previous without having to access the database each time?</p> <p>ASP.NET 4, C#, MS SQL Server 2008 </p>
c# asp.net
[0, 9]
3,003,599
3,003,600
What is the difference between a sql table adapter and entity framework model?
<p>They both seem to create classes based on a database schema. Why would you use the entity framework model over a table adapter?</p> <p>They both allow me to easily drag a sql table onto a surface in Visual Studio, after which a class and all the code is generated which allows me to automatically create/update/delete records.</p> <p>I know the entity framework is the clear choice, I just don't understand why.</p> <p>Thanks!</p>
c# asp.net
[0, 9]
2,788,792
2,788,793
Chrome kill pages popup appears on page loading
<p>I am getting this issue of popup asking for kill page or wait as browser is unresponsive, and I am not able to get what is the reason behind the same, I have tried to debugg the javascript but seems like control is not going to the breakpoint even when I am writing <strong>debugger;</strong> in my javascript code. So there are two problems:</p> <ol> <li><p>How to debug my java script, as writing debugger; is not helping, also I am not able to add breakpoints when debugging through firebug lite.</p></li> <li><p>How to check which script is stopping the page response and giving this error.</p></li> </ol>
c# javascript
[0, 3]
4,764,003
4,764,004
Address Textboxes inside a SPAN
<p>I want to address textboxes which are dynamically created during runtime.</p> <pre><code>preise += "&lt;b&gt;" + preisgruppenRow["Name"] + ":&lt;/b&gt;&lt;br/&gt; &lt;input name=\"Preisgruppe_" + preisgruppenRow["Preisgruppe_ID"] + "\" type=\"text\" id=\"MainContent_Preisgruppe_" + preisgruppenRow["Preisgruppe_ID"] + "\" class=\"textEntryListView textEntryListViewSmall\" value=\"" + preis + "\"&gt; &lt;br/&gt;"; </code></pre> <p>This string is later inserted in an ASP.NET template via Binding:</p> <pre><code>&lt;EditItemTemplate&gt; &lt;asp:Label Runat="server" Text='&lt;%# Bind("Preise") %&gt;' ID="lblPreise"&gt;&lt;/asp:Label&gt; &lt;/EditItemTemplate&gt; </code></pre> <p>However, when I try to address those generated input field like:</p> <pre><code> GridViewRow row = (GridViewRow)grdSpeiseplan.Rows[e.RowIndex]; Label test = (Label)row.FindControl("lblPreise"); TextBox test2 = (TextBox)test.FindControl("Preisgruppe_2"); TextBox test3 = (TextBox)test.FindControl("MainContent_Preisgruppe_2"); </code></pre> <p>I only get NULL values - whatever I try :(.</p> <p>Do you might have an idea how I could solve that dilemma?</p>
c# asp.net
[0, 9]
5,138,902
5,138,903
How to show just the first matched selector on click when there may be multiple identical selectors
<p>I have a series of read more buttons with accompanying div content, unfortunately these read more and content divs cant be wrapped together so I was wondering what is the best way to display the correct content when a read more link is clicked, I've tried .closest and .next with no success.</p> <p><strong>Fiddle:</strong> <a href="http://jsfiddle.net/QJcFf/1/" rel="nofollow">http://jsfiddle.net/QJcFf/1/</a></p> <p><strong>JS</strong></p> <pre><code>var readMore = $('.readmore'); readMore.on('click', function(e) { e.preventDefault(); var el = $(this); console.log(el); el.next('.more-ctn').show(); console.log( el.closest('.more-ctn') ); }); </code></pre> <p><strong>HTML</strong></p> <pre><code>&lt;div class="main-content"&gt; &lt;p&gt;lorem ipsum &lt;a href="#" class="readmore"&gt;Read more&lt;/a&gt;&lt;/p&gt; &lt;div class="more-ctn"&gt; &lt;p&gt;Content for first readmore&lt;/p&gt; &lt;/div&gt; &lt;p&gt;lorem ipsum &lt;a href="#" class="readmore"&gt;Read more&lt;/a&gt;&lt;/p&gt; &lt;div class="more-ctn"&gt; &lt;p&gt;Content for first readmore&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
533,309
533,310
android serverSocket initialisation causing permission denied exception in service(remote)
<p>i am trying to create a socket with a harcoded ip address and socket in a remote process</p> <p>server = new ServerSocket(80);</p> <p>and i am getting a permission denied exception even though i have added the INTERNET permission in the manifest file....</p> <p>Wat could be possibly wrong in this >>>?? Any idea ????</p>
java android
[1, 4]
5,662,628
5,662,629
What is the best gaming framework for android and iphone
<p>What is the best gaming framework that can I use for both android and iPhone ?? </p>
android iphone
[4, 8]
1,325,806
1,325,807
Changing the title of a link in jQuery
<p>I have a link with id "helpTopicAnchorId".</p> <p>I want to change its text in jQuery.</p> <p>How do I do this?</p>
javascript jquery
[3, 5]
1,931,224
1,931,225
get hebrew chars from textbox asp.net
<p>So, </p> <p>ive got a textbox in my website, which is writeig in c# asp.net 4. </p> <pre><code>&lt;td&gt; &lt;asp:TextBox ID="UserName" runat="server" CssClass="textEntry" Width="265px" placeholder="שם משתמש" ontextchanged="UserName_TextChanged"&gt;&lt;/asp:TextBox&gt; &lt;/td&gt; </code></pre> <p>the problem is, that when someone trying to put hebrew input its lets him do it. </p> <p>how can i know that the input he is trying to write is hebrew and dont let him? just like show him a warring in javasciprt, or just dont let him. </p> <p>any one can give me a hand?</p> <p>thanks!</p>
c# asp.net
[0, 9]
5,300,688
5,300,689
Android : Is there any way to change the default language of android to new language?
<p>I'm trying to know whether it is possible to change the default android OS language to other. For which the language is not in the settings for instance: how to set the device 's language to burmese programmatically.</p>
java android
[1, 4]
3,902,737
3,902,738
autopostback event will fire for textbox when java script desable at client side
<p>hi all i have set autopostback property for text box . will it fire when java script desable at client side </p> <pre><code>&lt;asp:TextBox ID="Slider1" runat="server" OnTextChanged="Slider1_TextChanged" AutoPostBack="True" &gt; </code></pre>
javascript asp.net
[3, 9]
2,129,195
2,129,196
ASP.NET 3.5 Page Load - Design Issue
<p>I have a web site with a series of Master Pages which all derive from a "Base" master page. For this example lets call it MasterPage.master.</p> <p><strong>Edit</strong>-----</p> <p>Basically there are 2 halves of the website: Public and Private. We'd like to create, among other things, a custom Site Tracking 'utility.' Any time a page is hit... we capture a bunch of data about the user for future reporting, etc.</p> <p>Right now I am working on the Public site.. but I want to reuse this 'utility' for the private site 3-4 months from now.</p> <p>To me, a Master Page doesn't seem like the best way of accomplishing this... While I'm still new to .NET, I feel that Master Pages should only be used for organizing the UI.</p> <p>I've looked into Custom IHttpModule and have been able to get something to work... but its kinda ghetto if you ask me.</p> <pre><code>public void Init(HttpApplication context) { context.AcquireRequestState += (new EventHandler(this.context_AquireRequest)); } ... void context_AquireRequest(object sender, EventArgs e) { HttpApplication application = (HttpApplication)sender; HttpContext context = application.Context; if (context.CurrentHandler is Page){ //Do Stuff } } </code></pre> <p><strong>End Edit</strong>----</p> <p>Is there a better way of having a block of code running each time a page is loaded than the following... Such as a custom IHttpModule or somehow in the Global.asax.</p> <p>[MasterPage.master] ...</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { //...do stuff... } </code></pre> <p>Thanks</p>
c# asp.net
[0, 9]
2,606,504
2,606,505
sending parameters from ASP.NET to javascript
<p>I want to call a javascript function from my ASP.NET (C#) code, I want to pass a variable (string) with another string like below:</p> <pre><code>tag_label.Attributes.Add("onmouseover", "tooltip.show('my text'+'"+myString+"'&lt;br/&gt;'another text);"); </code></pre> <p>how should I pass these values? also I want to have new line in my tooltip (<code>&lt;br/&gt;</code>), what should I do? I've tried several ways (using <code>'</code>, <code>+</code> and other methods) to send all these values but I get javascript error, is there any sample? please help me thanks</p>
javascript asp.net
[3, 9]
4,970,923
4,970,924
Server controls on custom Web User Control's events not firing when added dynamically to page
<p>I'm having a little problem while trying to dynamically add a web user control on an ASPX page, I've read up on the page lifecycle and saw some suggestions to add the dynamic controls as early in the page lifecycle as possible. As of right now the controls are created on the PreInit event like the following code block:</p> <pre><code> protected override void OnPreInit(EventArgs e) { if (!Page.IsPostBack) { lstQuestions = new List&lt;ucQuestion&gt;(); Session["listQuestionss"] = lstQuestions; ucQuestion q = null; for (int i = 0; i &lt; MIN_QUESTIONS; i++) { q = LoadControl("~/UserControls/Exam/ucQuestion.ascx") as ucQuestion; q.ID = String.Format("Question{0}", listQuestions.Count + 1); listQuestions.Add(q); } } else { if (Session["listQuestions"] != null) { listQuestions = Session["listQuestions"] as List&lt;lstQuestions&gt;; } else { Response.Redirect("~/Views/HR/Exams/AddExam.aspx"); } } base.OnPreInit(e); } </code></pre> <p>And then onInit I have the following:</p> <pre><code> protected override void OnInit(EventArgs e) { foreach (ucQuestion q in lstQuestions) { divQuestions.Controls.Add(q); } base.OnInit(e); } </code></pre> <p>The ucQuestion user control has a few labels, some textboxes and a FileUpload with a button to save the posted file, when I press the button, the page gets posted back, but the breakpoint in my code never gets hit, in short I need to know if there's something I'm doing wrong while adding the Control that doesn't bind the controls to their proper events. if I add the user control statically the events work all right, it's just that the user can add an as many questions to the exam as he sees fit, so I have to add them dynamically. </p>
c# asp.net
[0, 9]
3,774,092
3,774,093
Not displaying after quote mark
<p>After I run my script, the input field essentially looks like this:</p> <pre><code>&lt;input type="text" value="How do you " /&gt; </code></pre> <p>Even if I slash the quotes or change them to <code>&amp;quot;</code> it still doesn't work.</p> <p>Any suggestions?</p> <pre><code>$('input').html(function() { var dataVal = 'How do you "feel" about that?'; return '&lt;input type="text" value="' + dataVal + '" /&gt;'; }); </code></pre>
javascript jquery
[3, 5]
4,926,716
4,926,717
On Clicking checkbox change textbox value
<pre><code>&lt;input type="checkbox"&gt;hello &lt;input type="textbox" name="textbox"&gt; </code></pre> <p><em>fiddle-<a href="http://jsfiddle.net/JNX5G/" rel="nofollow">http://jsfiddle.net/JNX5G/</a></em></p> <p>when clicking the <code>checkbox</code> I want to display the value of <code>textbox</code> on the page. I am working in php and ci.</p>
php javascript jquery
[2, 3, 5]
935,462
935,463
how to play audio chunks of single mp3 file without interruption in android?
<p>can anybody tell me how to play audio chunks of single mp3 file without interruption?</p>
java android
[1, 4]
5,188,900
5,188,901
PHP code to Javascript
<p>How can I convert this PHP code to javascript? I wanna use .js file to insert other pages. If there are other ways please tell me. thanks! :)</p> <pre><code>&lt;? include 'config.php'; $select = mysql_query("SELECT * FROM `currency`"); $num=mysql_num_rows($select); while($row=mysql_fetch_object($select)) { $id=$row-&gt;id; $qveyana=$row-&gt;qveyana; $simbolo=$row-&gt;simbolo; $kursi=$row-&gt;kursi; $zrda=$row-&gt;zrda; $drosha=$row-&gt;drosha; ?&gt; &lt;table border="0" width="300" cellpadding="" cellspacing="0"&gt; &lt;tr bgcolor="#CCCCCC" bordercolor="#FF0000"&gt;&lt;td width="22"&gt;&lt;i.mg src="&lt;? echo $drosha; ?&gt;" width="20" /&gt;&lt;/td&gt;&lt;td width="50"&gt;&lt;? echo $qveyana; ?&gt;&lt;/td&gt;&lt;td width="40"&gt;&lt;? echo $simbolo; ?&gt;&lt;/td&gt;&lt;td&gt;&lt;? echo $kursi; ?&gt;&lt;/td&gt;&lt;td&gt;&lt;? echo $zrda; ?&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/table&gt; &lt;? } ?&gt; </code></pre>
php javascript
[2, 3]
2,561,286
2,561,287
loginview shows "welcome system-name/administrator" and logout for the first time page load
<p>I modified my code to use LoginView and before I had a button in one of my aspx page to redirect to login.aspx and another button for logout and it was all working fine and now I have a LoginView in my master page instead of the button and I have added the code below.But when I load the page it shows my status as loggedin before I even login to the page and I have another page login.aspx to actually enter the credentials and username ,password are stored in sql server. Here is the code for loginView</p> <pre><code> &lt;asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false"&gt; &lt;AnonymousTemplate&gt; [ &lt;a href="~/Account/Login.aspx" ID="HeadLoginStatus" runat="server"&gt;Log In&lt;/a&gt; ] &lt;/AnonymousTemplate&gt; &lt;LoggedInTemplate&gt; Welcome &lt;span class="bold"&gt;&lt;asp:LoginName ID="HeadLoginName" runat="server" /&gt;&lt;/span&gt;! [ &lt;asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="~/home.aspx"/&gt; ] &lt;/LoggedInTemplate&gt; &lt;/asp:LoginView&gt; </code></pre> <p>Is it behaving like this because I havent used roles and membership ?Please help me.I have no luck searching for the problem in internet</p>
c# asp.net
[0, 9]
4,283,214
4,283,215
Define a map as constant in java
<p>For my Android app I've the need of defining some keys in a single constant, and I think the best way to do it is using a map. But not sure whether that's really the way to go, and how to do it correctly. As I'm targeting Android, a Bundle may also be an option.</p> <p>I have a list of keys like: <br>"h" = "http" <br>"f" = "ftp"</p> <p>Basically the program is to read a QR code (to keep that code from growing too big I'm using super-short keys), gets those keys, and has to translate them to something useful, in my case a protocol.</p> <p>I'm trying to define a constant called KEY_PROTOCOLS, I think this should be a Map, so later I can call something like KEY_PROTOCOLS.get("f") to get the protocol that belongs to key "f". </p> <p>Other classes should also be able to import this constant, and use it. So this map has to be populated in the class right away.</p> <p>How can I do this?</p>
java android
[1, 4]
5,530,439
5,530,440
Random iexplore crashes when debugging (ASP.NET)
<p>I have a web application I am developing that seems to crash completely at random when clicking links on any page. When this happens, I'm told 'An unhandled win32 exception occured in iexplore.exe'. When I try to debug, it says one is already attached.</p> <p>What could this be relating to? I know without code it will be hard, but this seems like a very strange error to occur at random.</p>
c# asp.net
[0, 9]
3,604,479
3,604,480
ASP.NET Dynamic JavaScript File
<p>I'm writing a ASP.NET web application. It dosen't use Web Forms or MVC. It uses ASP.NET Routing to a Http Handler, and the handler just writes html to the HttpContext.</p> <p>The final output of my html is something like this:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;...&lt;/title&gt; &lt;script type="text/javascript"&gt; ... &lt;/script&gt; &lt;/head&gt; &lt;body&gt; ... &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Now, Instead of writing the (long) script into this page, I want to write it to another page, and then use the <code>src</code> of <code>script</code> element to reference it. The problem is, that the script is dynamic.</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;...&lt;/title&gt; &lt;script type="text/javascript" src="..."&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; ... &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Any ideas?</p> <p>Thanks.</p>
c# javascript asp.net
[0, 3, 9]
1,708,066
1,708,067
Losing line-feeds/carriage-returns on post
<p>Any help on how I would keep carriage-returns in the text that I am posting?</p> <pre> function checkPlayState(checkStatus) { var Player = document.getElementById("NSPlay"); if (Player.playState == 0 || Player.playState == 1) { // 0 vs 8 if (checkStatus == true) { var tex_t = document.getElementById("ctl00_ContentPlaceHolder1_TextArea1").innerHTML; // The following javascript function takes the URL of the target page and // a name / value paire and POSTs the data to the supplied URL by dynamically // creating a form and then submitting it... // but I am loosing line-feeds/carage-returns in the transfer of the text var fil_e = "Speach.aspx" // target url post_to(fil_e, tex_t); function post_to (file, text) { var myForm = document.createElement("form"); myForm.action = file; myForm.method = "post"; var myInput = document.createElement("input"); myInput.setAttribute("name", "key"); myInput.setAttribute("value", tex_t); // squares show in the "Text Visualizer" when yellow is here myForm.appendChild(myInput); // squares have gone in the "Text Visualizer" when we are here but show in the value field of watch window??? document.body.appendChild(myForm); myForm.submit(); document.body.removeChild(myForm); } return; } else { window.setTimeout("checkPlayState(true)", 500); } } else { window.setTimeout("checkPlayState(false)", 500); } } ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' I have this in aspx file to retrieve '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Dim tex_t As Object tex_t = Request.Form("key") If tex_t "" Then ' Here while debugging the squares are gone?!? TextArea1.InnerText = tex_t ' it is the same textarea too Else End If </pre>
asp.net javascript
[9, 3]
1,149,247
1,149,248
How can I not show the phone screen all the time when making a call?
<p>I have written an application which include a service running in the background, and a GUI that includes (amongst other things) the ability to make a call to a predefined number. Now- when the user presses the button to make the call- the call is made OK- and the screen changes to the phone's GUI. I'd rather the app stays in view and the phone isn't shown at all really- but I can live with it briefly showing. However, to return to the application, the user must manually click the "back button£" on the phone. I want this to happen immediately the call is ringing if at all possible. I have tried using the PhoneStateListener- which I am already using for something else (in the service part of the app)- but can't seem to detect the call being made, and then show the main screen again.</p> <p>Suggestions would be much appreciated! Many thanks in advance.</p>
javascript android
[3, 4]
3,064,298
3,064,299
Javascript object manipulation with Jquery $.each()
<p>What am I doing wrong here ???</p> <pre><code>var menu = { menuset : { first : false, second : false, third : false }, setMenus : function (selected) { var menuCollection = this.menuset; $.each(menuCollection, function (key, element) { if (selected===key) { key=true; } else { key=false; } }); } } </code></pre> <p>When I execute "menu.setMenus(first)" I want it to set the object like this :</p> <pre><code> menuset : { first : true, second : false, third : false } </code></pre> <p>should I be using something other than $.each() ??</p>
javascript jquery
[3, 5]
2,445,548
2,445,549
how to create a complex javascript structure
<p>i want to create a structure like that:</p> <pre><code>[{title:'Imágenes', extensions:'jpg,gif,png'}, {title:'Todos', extensions:'*'}] </code></pre> <p>but i need to create it from a string, in this way (in "js+jquery+php rare mode"):</p> <pre><code>items = 'Imágenes jpg,gif,png|Todos *'.split('|').each(function() { list(title, ext) = explode(' ', $this); filters[] = array('title' =&gt; title, 'ext' =&gt; ext); }); </code></pre> <p>i found structures like:</p> <pre><code>var theStatus = new Object(); function testIt() { theStatus.Home = 'mouseover'; theStatus['Place'] = 'click'; for (var i in theStatus) { alert('theStatus[\''+i+'\'] is ' + theStatus[i]) } } </code></pre> <p>and like:</p> <pre><code>$.alerts = { verticalOffset: -75, horizontalOffset: 0, repositionOnResize: true, overlayOpacity: .01, overlayColor: '#FFF' } </code></pre> <p>but i cant do nothing functional.</p> <p>Thanks in advance.</p>
javascript jquery
[3, 5]
2,316,402
2,316,403
send option selection via. jquery
<p>I have some problems sending an id though jquery. I have a form select with some values, i want to "grap" the id when change option selection. </p> <p>Output error: [object Object] !! :/</p> <pre><code>&lt;select name="case_name" id="case_id"&gt; &lt;option value="10009" &gt;Case 1&lt;/option&gt; &lt;option value="10010" &gt;Case 2&lt;/option&gt; &lt;option value="10011" &gt;Case 3&lt;/option&gt; &lt;/select&gt; var PARAMS = { "case_id": 10009 }; $("#case_id").change(function() { var CASE_ID = $(this).val(); var PARAMS = { "case_id": CASE_ID }; alert(CASE_ID); }); </code></pre>
javascript jquery
[3, 5]
1,795,608
1,795,609
Find hidden elements and store them in an array
<p>I have some mark-up like so:</p> <pre><code>&lt;div class="slideshow"&gt; &lt;div class="slide" style="display:block;"&gt;&lt;/div&gt; &lt;div class="slide" style="display:none;"&gt;&lt;/div&gt; &lt;div class="slide" style="display:none;"&gt;&lt;/div&gt; &lt;div class="slide" style="display:none;"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>Which is basically some divs with one shown and the others hidden.</p> <p>I'm trying to find the ones that are currently not shown and then randomly select one of them...</p> <pre><code>var length = $('div.slideshow').find('div.slide:hidden').length; var ran = Math.floor(Math.random()*length) + 1; var newSlide = $("div.slideshow &gt; div.slide:nth-child(" + ran + ")"); </code></pre> <p>However because their is more than one hidden div it will not work... I'm guessing I need to setup an array? Can anyone help me out here as I'm a little confused.</p>
javascript jquery
[3, 5]
2,786,016
2,786,017
Check that the user is entering a time format? eg 13:00
<p>Basically, I'd like to have an input that when blur'd, will check the input to make sure it's in the format...</p> <p>[24hour] : [minutes]</p> <p>So for example 13:00, or 15:30.</p> <p>So I guess I have to split it up into three parts, check the first bit is between 0 and 24, then check it has the semi-colon, then check it has a number between 0 and 60.</p> <p>Going more complicated than that, it'd be fantastic to have it so if the user enters 19 it'll complete it as 19:00 for example.</p> <p>I am using jQuery fwiw, but regular code is fine, for example I'm using this little piece of code so far which works fine, to convert . inputs to :</p> <pre><code>tempval = $(this).val().replace(".", ":"); $(this).val(tempval); </code></pre> <p>Not sure where to start with this, if anyone could recommend me some reading that'd be fantastic, thank you!</p>
javascript jquery
[3, 5]
684,741
684,742
How can i create multiple div tags in c#?
<p>How can i create multiple div tags dynamically ? I am using place holder inside a repeater . How can i do this in c#.net</p>
c# asp.net
[0, 9]
4,898,392
4,898,393
How to pause an event in jQuery?
<p>I have a question regarding events.</p> <p>Basically, I want to run a jquery method when the user clicks a link to leave the page. In this method I want to check a few things before they leave, so I know I can call:</p> <pre><code>e.preventDefault(); </code></pre> <p>But what if I want the event to continue after I prevent the event?</p> <p>Any suggestions how to approach this?</p> <p>Thank you!</p>
javascript jquery
[3, 5]
3,292,073
3,292,074
Is there any reason to use Server.MapPath() to reference a file store?
<p>I have seen several developers perform:</p> <pre><code>string fileStore = Server.MapPath(@"~\someDirectory"); File.Create(fileStore + "someFileName.xxx"); </code></pre> <p>I find that this makes unit testing difficult. Since I test with MSTest, there's no HTTP context, so this code just flat out fails.</p> <p>Instead, I store my file paths in web.config.</p> <p><code>string fileStore = ConfigurationManager.AppSettings["fileStore"];</code></p> <p>This works with unit tests. Why do developers use <code>Server.MapPath()</code> in this way? Are there some benefits I'm unaware of?</p>
c# asp.net
[0, 9]
5,651,616
5,651,617
Show Error icon in Datagridview
<p>I want to show the error text and icon on a datagridview specific cell when this event is fired</p> <pre><code>private void dataGridView1_CellValidating(object sender, DataGridViewCellValidatingEventArgs e) </code></pre> <p>how can i do that? </p> <p>i tried the following: </p> <pre><code>if (int.Parse(dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString()) &gt; nbsstatus) dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].ErrorText = "Max Social Status is " + nbsstatus; e.cancel=true; </code></pre>
c# asp.net
[0, 9]
6,002,070
6,002,071
Why jQuery function returns null?
<p>I have this form:</p> <pre><code>&lt;form action="javascript:;" class="iceFrm" enctype="application/x-www-form-urlencoded" id="frmMainMenu" method="post" onsubmit="return false;"&gt; ..... &lt;/form&gt; </code></pre> <p>I do not understand why this script:</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function () { $("#frmMainMenu").$("#menuPopupAP").$("#menuItem0").$("#out").css('padding','0 0 0 29px'); }); &lt;/script&gt; </code></pre> <p>says:</p> <blockquote> <p><code>$("#frmMainMenu")</code> is null</p> </blockquote> <p>in Firebug.</p> <p><strong>UPDATE:</strong> This is the html element (from the above form) I want to change the padding on:</p> <pre><code>&lt;span id="frmMainMenu:menuPopupAP:menuItem0:out" class="iceOutTxt iceMnuItmLabel graMenuPopupMenuItemLabel"&gt;My Applications&lt;/span&gt; </code></pre> <p>Update 2:</p> <p>I've forgot to mention that this span is within a menu, so basically it's hidden normally and displayed only when hovering on some div... Does jQuery finds it even if it's not displayed?</p> <p>Do you know why?</p>
javascript jquery
[3, 5]
2,134,440
2,134,441
Cannot get jQuery to work on site
<p>Okay, I have been working for quite some time on a website for a friend.. My coding skills are .. questionable, and I've been having quite a few problems.</p> <p>Currently the jQuery on my site simply stopped working, I could not find the reason, and I have done everything I could to try to get it to work. ( I have followed countless guides all over the internet, for troubleshooting etc. and I still cannot get it to work)</p> <p>-EDIT- I have moved all the files to the top of the code.. Yet the problem persists.</p> <p>Sincerely yours, Malmoc</p>
javascript jquery
[3, 5]
5,512,342
5,512,343
how to check does the asp. net control element exist or not by using jquery?
<p>how to check does the asp. net control element exist or not? My page actually don't have the element with ID "hyper", but i just want to verify the existence of this.</p> <p>im looking for the asp.net element with ID "hyper".</p> <p>so what i have tried is </p> <pre><code>if (("#&lt;%=hyper.ClientID %&gt;").exists()) </code></pre> <p>or</p> <pre><code>if (("#&lt;%=hyper.ClientID %&gt;").length&gt;0) </code></pre> <p>but it give me this error </p> <blockquote> <p>The name 'hyper' does not exist in the current context</p> </blockquote> <pre><code>&lt;script type="text/javascript"&gt; function getElement() { if ($('#&lt;%=(hyper.ClientID)%&gt;').length &gt; 0) { alert("none!"); } else alert("exist!"); } &lt;/script&gt; &lt;asp:HyperLink ID="hyper2" runat="server" NavigateUrl="www.facebook.com" &gt;click me&lt;/asp:HyperLink&gt; </code></pre>
jquery asp.net
[5, 9]
5,972,310
5,972,311
Validator inside Server control
<p>I have a server control that inherits from TableRow and INamingContainer. I override the CreateChildControls and add three cells, in the first one I put a label, in the second one I put a textbox (lets call it A) with autopostback true and causevalidation true, a required validator and a range validator, in the third one another label. Additionally, I have another textbox (B) with autopostback true and cause validation true, but in the webform, not in the server control.</p> <p>When I write a <em>valid</em> value in the textbox A, the postback occurs but the rangevalidator is displayed. If after that, I change the value of the textbox B, the rangevalidator of the textbox A is not displayed and everything works as I expect.</p> <p>What is wrong?</p>
c# asp.net
[0, 9]
4,674,770
4,674,771
how to connect to asp.net web service in android?
<p>I want to call asp.net web service in android so that it can make the validation in back end. I want to make an app. which calls the web service in android</p>
android asp.net
[4, 9]
1,298,737
1,298,738
upload file http handler file size
<p>I'm creating a small Silverlight uploader. It does 2 things: checks the file size and type and uploads the file. I'm creating an http handler on the receiving end. However, the Silverlight code can still be manipulated or bypassed and I don't want to tie up the server because someone's uploading 100MB file. How do I restrict the size of the upload in the http handler so that if the size of the file partially uploaded already exceeds 3MB then stop the upload.</p> <p>Thanks for your suggestions.</p>
c# asp.net
[0, 9]
1,894,653
1,894,654
Finish empty activity
<p>I'm trying to turn screen on using an activity. I reached my goal, but the activity stays alive. If I use finish method, it doesn't get closed.</p> <p>Note: it doesn't work even if I setContentView(...my xml...);</p> <pre><code>package it.android.smartscreenon; import android.app.Activity; import android.os.Bundle; import android.view.WindowManager; public class AccendiSchermo extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON); finish(); } } </code></pre>
java android
[1, 4]
3,093,752
3,093,753
use jquery to echo value from text box
<p>I am attempting to echo out the value after a text box has been filled in. </p> <pre><code>&lt;input name="cron" type="textbox" placeholder=" Please insert a valid command in cron time format" class="required" /&gt; </code></pre> <p>The value of this textbox will then need to go into my cron_parser function and will echo out with $next_time</p> <pre><code>$cron_parser = new cron_parser($cron); $next_time = $cron_parser-&gt;next_runtime(); </code></pre> <p>Essentially after the text box is filled in, I want the following result to be echo'd out on the screen and update if the text box is changed.</p> <pre><code>&lt;div class="alert success"&gt; &lt;span class="icon"&gt;&lt;/span&gt;&lt;strong&gt;Is this correct?&lt;/strong&gt; Your backup will run next at &lt;?php echo $next_time ?&gt; &lt;/div&gt; </code></pre>
php jquery
[2, 5]
1,054,978
1,054,979
How to make an https request in javascript?
<p>I am doing phonegap app, I want to access web service from server, in coding javascript get,post or ajax methods working fine for http url request but it cant work for <strong>https</strong> url request. Please help me, <strong>how to called SOAP or secure web service to parse JSON in phonegap through javascript?</strong></p>
javascript jquery
[3, 5]
2,262,955
2,262,956
Javascript Animate Performance
<p>I'm having some issues here with my js. </p> <p>It functions correctly, but the performance is too slow in a certain case. </p> <p>I scroll to the bottom softly, but when I try to scroll up again, it scrolls very slowly.</p> <p>What can i do to enhance the performance?</p> <p>Thanks!</p> <pre><code>$(function(){ var windowHeight = $(window).height(); var windowWidth = $(window).width(); var sectionsNumbers = $("#content section").length-1; var sectionCount = 0; // Scroll sets var windowScrollX = ((sectionsNumbers+1)*windowWidth)-windowWidth; var windowScrollY = ((sectionsNumbers+1)*windowHeight)-windowHeight; $("#content").css("width", windowScrollX+windowWidth); $("#content").css("height", windowScrollY+windowHeight); $(".illusion1").css("width", windowScrollX+windowWidth); $(".illusion1").css("height", windowScrollY+windowHeight); // Set mask w and h $("#mask").css("width", windowWidth); $("#mask").css("height", windowHeight); $(".scrollRule").css("height", (sectionsNumbers+1)*windowHeight); $("#content section").each(function() { // Defines its width and height $(this).css("width", windowWidth); $(this).css("height", windowHeight); // Defines its position $(this).css("left", sectionCount*windowWidth); $(this).css("top", sectionCount*windowHeight); sectionCount++; }); // When window scrolls $(window).scroll(function(){ var curScrollTop = $(window).scrollTop(); var angleVar = windowScrollX/windowScrollY; $("#content").stop().animate({left: "-"+curScrollTop*angleVar, top: "-"+curScrollTop}, {duration: 250, easing: 'easeOutQuart'}); $(".illusion1").stop().animate({left: "-"+curScrollTop*angleVar*0.5, top: "-"+curScrollTop*0.5}, {duration: 250, easing: 'easeOutQuart'}); //{duration: 1500, easing: 'easeOutQuart'} }); }); </code></pre>
javascript jquery
[3, 5]
4,235,851
4,235,852
jQuery fadeIn() not working properly
<p>jquery:</p> <pre><code> $.post("process_login.php", {username : $("#username").val(), password : $("#password").val()}, function(data) { $("#login_results").fadeIn("slow").html(data); } ) </code></pre> <p>html:</p> <pre><code>&lt;table&gt; &lt;tr&gt;&lt;td id="login_results"&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&lt;input type="text" id="username" /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&lt;input type="password" id="password" /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&lt;input type="submit" id="login_submit" /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/table&gt; </code></pre> <p>The data shows, but it doesn't fade in. I have no idea why. =/. If you need any other details, let me know.</p>
javascript jquery
[3, 5]
4,983,058
4,983,059
jquery animate, scroll top top slow
<p>I'd like my page to go to the top when certain anchor is clicked, I had this done before but I lost the code somewhere, here is how I tried to do it but its not working its scrolling usual super fast.</p> <pre><code> $('a[href=#top]').click(function () { $('body').animate({ scrollTop: 0 }, 50); }); </code></pre> <p>Can anybody help me, tnx </p>
javascript jquery
[3, 5]
1,553,392
1,553,393
Checkbox onclick uncheck other checkboxes
<p>I have 6 checkboxes, one for each business day and one that says 'all'.</p> <p>What i want to be able to do is uncheck all the other boxes if someone clicks the 'all' checkbox if that makes sense.</p> <p>For example, if someone has clicked monday and wednesday ... then they come in and click the 'all' checkbox, then the monday and wednesday checkbox should uncheck.</p> <p>Cheers,</p>
php javascript jquery
[2, 3, 5]
4,314,333
4,314,334
jQuery or JavaScript is it possible to call in another JavaScript file that was not initially loaded in the dom?
<p>I am working with an MVC framework with PHP and in my views I only try to load whats needed for the view. However sometimes I need something from a script that may not have been called into play with the loading of the DOM. This is mostly out of the sake of curiosity to know if there is a way I can load another javascript file into my DOM dynamically after the DOM has rendered or can it only be pulled in while the DOM is rendering?</p>
javascript jquery
[3, 5]