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,846,434
5,846,435
How to extend the asp.net User.Identity Property?
<p>I'm <strong><em>not</em></strong> talking about asp.net membership.</p> <p>For each logged user I want to cache some properties like status or the number of friend requests, from the db.</p> <p>I can create custom class which would do it but I thought it will be better to extend the existing User.Identity property.<br> Something like this:</p> <pre><code>Label1.Text = User.Identity.Status; </code></pre> <p>It is possible?</p>
c# asp.net
[0, 9]
2,516,518
2,516,519
Can't get jQuery to return data
<p>I have a very simple jQuery script.. all I want it to do is return the data on the PHP/HTML page but it's not working. The code is below:</p> <pre><code>function sendData() { $.post("validation.php", $("#c_form").serialize(), function(data){}, "html"); </code></pre> <p>}</p> <p>The function is called by an onclick event in the form. I don't get why it is isn't working, very stumped. Any ideas? There are no errors that pop up in the firefox console window.</p>
javascript jquery
[3, 5]
5,055,796
5,055,797
Show or Hide div from label Click
<p>I have three labels having folowing code on all with different ids and three divs with different ids</p> <pre><code>&lt;asp:Label ID="CA" runat="server" Font-Bold="False" Font-Names="Arial" Font-Size="10pt" style="padding-top:6px;" ForeColor="#CCCCCC" Height="100%" Text="Current Activities" onmouseover="var b = ChangeColorCA(); this.style.cursor='pointer'; return b" onmouseout="RemoveColorCA()"&gt;&lt;/asp:Label&gt;&amp;nbsp; </code></pre> <p>here is div code for all</p> <pre><code>&lt;div id="DIV_CA" runat=server align="center" visible="false" style="background-color:#f3f3f3; text-align: left; width: 500px; height: 470px; overflow:auto;"&gt;Some data&lt;/div&gt; </code></pre> <p>I want to make a show or hide mechanism from label click can anyone tell me how can i do this that when i click a label then the a specific div should show and others should hide and when i click next label the its coresspondent div should show.</p> <p><strong>UPdate</strong> This is My Script Code</p> <pre><code>&lt;script type="text/javascript"&gt; function hideshow(span) { var div = document.getElementById("DIV_" + span.id); if (div.style.display == "none") div.style.display = "block"; else div.style.display = "none"; } &lt;/script&gt; </code></pre> <p>and here is lablel code</p> <pre><code>&lt;asp:Label ID="CA" runat="server" Font-Bold="False" Font-Names="Arial" Font-Size="10pt" style="padding-top:6px;" ForeColor="#CCCCCC" Height="100%" Text="Current Activities" onmouseover="var b = ChangeColorCA(); this.style.cursor='pointer'; return b" onmouseout="RemoveColorCA()" onclick="hideshow(this)" &gt;&lt;/asp:Label&gt;&amp;nbsp; </code></pre>
javascript asp.net
[3, 9]
2,228,873
2,228,874
Javascript: Find out which element was clicked without attaching any eventlistener to it?
<p>I am confused on finding an approach to resolve this issue. Consider below html</p> <pre><code>&lt;body&gt; &lt;div id="parent" onclick="myFunc"&gt; &lt;div id="child-a"&gt;&lt;/div&gt; &lt;div id="child-b"&gt;&lt;/div&gt; &lt;div id="child-c"&gt;&lt;/div&gt; &lt;div id="child-d"&gt;&lt;/div&gt; &lt;div id="child-e"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/body&gt; </code></pre> <p>Event listener is attached to the parent element. If a user clicks on lets say 'child-c', is there any way to find out using "myFunc" that which div was clicked? In this case 'child-c'. Any possible solution using pure JS or jQuery?</p> <p>Let me know if more explanation is required. Thank you for helping.</p> <p>-Nishant</p>
javascript jquery
[3, 5]
3,761,650
3,761,651
Using jquery, how to I animate adding a new list item to a list?
<p>I have a simple javascript function that allows me to add an item to a list. Note that I use JQuery...</p> <pre><code>function prependListItem(listName, listItemHTML) { //Shift down list items... $("#" + listName + " li:first").slideDown("slow"); //Add new item to list... $(listItemHTML).prependTo("#" + listName) } </code></pre> <p>The 'listName' is simply an <code>&lt;ul&gt;</code> with some <code>&lt;li&gt;</code>'s.</p> <p>The prepending works fine, but I can't get the slideDown effect to work. I would like the list items to slide down and the new item to then appear on top. Any ideas how to accomplish this? I'm still new to JQuery...</p>
javascript jquery
[3, 5]
1,066,946
1,066,947
trigger login window
<p><img src="http://i.stack.imgur.com/s3kV3.png" alt="login window"></p> <p>I do a JQuery trigger on a login button to auto login. It works fine in IE but in Firefox i get this login window. My question is:</p> <p>Can I trigger the click on OK with jQuery?</p> <pre><code> jQuery(document).ready(function(){ jQuery('.centerButton').trigger('click'); }); </code></pre>
javascript jquery
[3, 5]
4,737,007
4,737,008
Update Select Menu based off another Selection
<p>I have a list of states (USA) that includes Canadian provinces, </p> <pre><code>&lt;select&gt; &lt;optgroup label="United States"&gt; &lt;option value="AL"&gt;Alabama (AL)&lt;/option&gt;&lt;option value="AK"&gt;Alaska (AK)&lt;/option&gt;&lt;option value="AE"&gt;APO state (AE)&lt;/option&gt;&lt;option value="AO"&gt;APO state (AO)&lt;/option&gt;&lt;option value="AP"&gt;APO state (AP)&lt;/option&gt;&lt;option value="AZ"&gt;Arizona (AZ)&lt;/option&gt; &lt;/optgroup&gt; &lt;optgroup label="Canada"&gt; &lt;option value="AB"&gt;Alberta (AB)&lt;/option&gt;&lt;option value="BC"&gt;British Columbia (BC)&lt;/option&gt;&lt;option value="MB"&gt;Manitoba (MB)&lt;/option&gt;&lt;option value="NB"&gt;New Brunswick (NB)&lt;/option&gt;&lt;option value="NL"&gt;Newfoundland and Labrador (NL)&lt;/option&gt;&lt;/optgroup&gt; &lt;/select&gt; </code></pre> <p>Then I have another select menu that includes 2 options, USA &amp; Canada. (USA is default selected)</p> <p>I want that if Canadian province is selected, disable USA as country in second select menu. and if Canada is selected in second select menu, remove USA states from first select menu.</p> <p>I only found ways to populate the second select menu after choosing the first (like this <a href="http://jsfiddle.net/FK7ga/" rel="nofollow">http://jsfiddle.net/FK7ga/</a>), but what I try is to show all by default, and update after selecting either one.</p>
javascript jquery
[3, 5]
3,709,581
3,709,582
Why is my javascript function not found by the page it is embedded in?
<p>I have a page that has a simple javascript in the header portion of the page:</p> <pre><code>&lt;script type="text/javascript"&gt; function doLogout() { var conf = confirm("Really log out?"); if (conf === true) { //changed == to === for boolean comparison $.post("logout.aspx"); } } &lt;/script&gt; </code></pre> <p>It uses jQuery to do an AJAX post to my logout page. The only issue right now is that when I click on the link (<code>&lt;a href="#" onclick="doLogout();"&gt;logout&lt;/a&gt;</code>) to fire this function, nothing happens. I checked FireBug's console, and it told me that the function is not defined. This has happened to me before, but I think I botched a bunch of code to fix it <em>sometimes</em>.</p> <p>Does anyone know the proper way to fix this issue?</p> <h1>Edit</h1> <p>After doing a lot of googling and trying different things, I found this very <a href="http://forums.asp.net/p/1155910/1899157.aspx" rel="nofollow">concise and informative post</a>. Apparently, as the linked article states, the way the script is referenced in the web site is important as it won't run properly otherwise! Hopefully this information will be useful for more people.</p>
asp.net javascript
[9, 3]
4,026,149
4,026,150
Get browser URL with jQuery
<p>I have this code</p> <pre><code>var pathname = window.location.pathname; </code></pre> <p>That take the current browser url</p> <p>How can i paste the pathname into an html element like a p tag?</p>
javascript jquery
[3, 5]
1,148,050
1,148,051
jquery cycle thru list one at a time when keypress
<p>I have a input box and below it, a basic list. When you press arrow-down (or arrow-up) from within the input box, I'd like to highlight/change-background of the first list item (as if it was being selected). </p> <pre><code>&lt;div&gt;&lt;input id="frmartist" type="text" value=""/&gt;&lt;/div&gt; &lt;ul id="artistlist"&gt; &lt;li id="artist-1"&gt;artist 1&lt;/li&gt; &lt;li id="artist-2"&gt;artist 2&lt;/li&gt; &lt;li id="artist-3"&gt;artist 3&lt;/li&gt; &lt;li id="artist-4"&gt;artist 4&lt;/li&gt; &lt;li id="artist-5"&gt;artist 5&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>If you press arrow-down again, the 2nd item would be highlighted. If you press down again, the 3rd item would be highlighted. </p> <p>And if you were to press arrow-up, then the 2nd item would be highlighted again. </p> <p>How can I control this behavior with jquery/javascript? I'm guessing I should track which item is highlighted, but outside of that, I think I'm clueless. </p> <p>I'm catching the arrow-up and arrow-down by using e.which === 40 and e.which === 38, but I'm confused as to where to go accessing the first item of the list.</p> <p>Any tips?</p>
javascript jquery
[3, 5]
4,892,610
4,892,611
how to set the values of the forms and make it stick even after refresh?
<p>I have a long form, wherein, when I click the submit button the external js validation fires up and checks the validity of the input fields. If all the input fields passed the validation a jquery modal pops out asking the user to register or login.</p> <p>Now, if the user choses to register and finishes registering from the modal, the modal closes and the page refreshes automatically and shows the user is automatically logged-in.</p> <p>My problem now is that the input data from the long form he filled in before the registration got erased when the page refreshed.</p> <p><strong>How can I make input fields not erase on refresh of a page? Is it possible to set the session within the external js file ? If yes, how can I to that?</strong></p> <p>For example:</p> <pre><code>$_SESSION['resumetitle'] = $_POST['resumetitle']; $_SESSION['resumeintro'] = $_POST['resumeintro']; $_SESSION['name'] = $_POST['name']; $_SESSION['dob'] = $_POST['dob']; $_SESSION['contacttel1'] = $_POST['contacttel1']; $_SESSION['contacttel1type'] = $_POST['contacttel1type']; $_SESSION['contacttel2'] = $_POST['contacttel2']; $_SESSION['contacttel2type'] = $_POST['contacttel2type']; $_SESSION['contacttel3'] = $_POST['contacttel3']; $_SESSION['contacttel3type'] = $_POST['contacttel3type']; $_SESSION['primaryemail'] = $_POST['primaryemail']; $_SESSION['secondaryemail'] = $_POST['secondaryemail']; $_SESSION['skype'] = $_POST['skype']; $_SESSION['facebook'] = $_POST['facebook']; $_SESSION['linkedin'] = $_POST['linkedin']; $_SESSOIN['twitter'] = $_POST['twitter']; $_SESSION['messenger'] = $_POST['messenger']; $_SESSION['yahoo'] = $_POST['yahoo']; $_SESSION['aol'] = $_POST['aol']; $_SESSION['summaryofpositionsought'] = $_POST['summaryofpositionsought']; $_SESSION['summaryofskills'] = $_POST['summaryofskills']; $_SESSION['gender'] = $_POST['gender']; </code></pre>
php javascript jquery
[2, 3, 5]
3,345,431
3,345,432
Add Entry to DB, Upon Success Refresh Messages
<p>So it's not a complicated matter at all, but was wondering how the Stackoverflow community would tackle this.</p> <p>I wrote a facebook-style wall type thing where users enter their "status", it gets processed via jQuery Post and upon success returns a success message. </p> <p>Prepending the new message to the Wall Stream would make sense, however, if another user had entered a message before the submission it would fail to show the correct time sequence...</p> <p>I guess my question is this. </p> <p>Should I query the latest Wall Messages inside the PHP file and echo back the entire result? That way when jQuery receives the callback it can delete whatever is in the Wall Stream and update with the new content?</p>
php jquery
[2, 5]
2,814,523
2,814,524
JQuery Sync 2 Checkboxes
<p>I am using the following code to sync 2 input boxes.</p> <pre><code>$("#input_box_1").bind("keyup paste", function() { $("#input_box_2").val($(this).val()); }); </code></pre> <p>The above works great but I need to do the same for a checkbox.</p> <p>My question is...how do I modify the code for it to work with a checkbox?</p>
javascript jquery
[3, 5]
775,377
775,378
what is the difference here in this use of JSON.stringify()?
<p>what is the difference in the following between the result of <code>p</code> and <code>q</code> and why would you do either way, which is best?</p> <pre><code> var my = [ {"a":"sdsds"}, {"b":"sdsds"}, {"c":"sdsds"}, {"d":"sdsds"}, {"e":"sdsds"} ]; var p = JSON.stringify({ "myText": my };); var q = { "myText": JSON.stringify(my) }; </code></pre>
javascript jquery
[3, 5]
4,601,200
4,601,201
JQuery - also trigger change on click away
<p>I have a basic JQuery script that changes a few divs when you click - thus showing them - via toggle.</p> <pre><code>&lt;script type="text/javascript"&gt; $('#content_display').click(function() { $(this).toggleClass('selected'); $('#content_display_selector_container').toggle(); }); &lt;/script&gt; </code></pre> <p>However - to call the even you need to click only on the first main div with the ID of "content_display".</p> <p><strong>My question is this:</strong> how can I hide these changes using JQuery if the user also clicks on BODY - i.e. if you click away, the divs go back to their original hidden state?</p> <p>Thanks for helping a JQuery clutz!</p>
javascript jquery
[3, 5]
1,048,957
1,048,958
Android: Incrementing an integer causes an allocation
<p>The following line appears in the allocations pane of eclipse:</p> <pre><code>Alloc Order Allocation Size Allocated Class 509 12 java.lang.Integer </code></pre> <p>It references this line of java code:</p> <pre><code>MyInteger++; </code></pre> <p>I changed it around a little bit, but it still causes an allocation.</p> <pre><code>MyInteger=MyInteger+1; MyInteger=MyInteger+MyIntegerIncrementor; </code></pre> <p>Why do these lines of code cause an allocation?</p>
java android
[1, 4]
300,225
300,226
horizontal scroll - like github
<p>Is there a javascript library which lets me do the horizontal scrolls effect kind like github does when you click on a file/folder. </p> <p>Preferrably jQuery plugin.</p> <p>thanks</p>
javascript jquery
[3, 5]
8,275
8,276
Prevent jquery browser scrolling to top on click
<p>I have the following script for a thumbnail image viewer. I've named each thumbnail image and large parent image ending in thumb and large, respectively. The script replaces the large image with whatever thumbnail image is clicked on by changing the filepath.</p> <pre><code>&lt;script&gt; $('.thumbs').delegate('img','click', function(){ $('.large').attr('src',$(this).attr('src').replace('thumb','large')); $('.large').hide().fadeIn(500); }); &lt;/script&gt; </code></pre> <p>Each time a thumbnail is clicked, the page scrolls back to the top. I've tried to prevent this with</p> <pre><code>return false; </code></pre> <p>It works, however, then large image won't update. Is there another way to prevent the page from scrolling to the top?</p> <p>Thanks for your help.</p>
javascript jquery
[3, 5]
3,374,864
3,374,865
Performing a Response.Redirect from a non-Web based project
<p>I have created a utility method that contains some try/catches in it. In those try/catches I need to redirect the customer using an HttpResponse redirect. I can't seem to figure out how to do this outside a web project. This utility class is referenced from my ASP.NET web project and so I'm just abstracting out some of the code into this utility class so I no longer have the request object.</p> <p>I know I can use <code>HttpWebRequest</code> object for a lot of web related request tasks outside a web project, but could not seem to get any redirect method there to use after putting in a <code>using System.Net;</code> in my utility class.</p>
c# asp.net
[0, 9]
1,583,954
1,583,955
How to get "public static final int" value by name?
<p>I created a class to extend KeyEvent:</p> <pre><code>public class myKeyEvent extends KeyEvent { public static final int MY_KEYCODE_01 = KeyEvent.KEYCODE_A; //... public static final int MY_KEYCODE_30 = KeyEvent.KEYCODE_Z; } </code></pre> <p>Now, i want to get the Integer value by the variable name (eg. "MY_KEYCODE_01" should return integer value KeyEvent.KeyCODE_A) from another class (another file).</p> <p>I tried to:</p> <pre><code>try{ Class cls = myKeyEvent.class.getClass(); Field field = cls.getDeclaredField("MY_KEYCODE_01"); int value = (Integer) field.get(cls); Log.v("TAG", "Field value is " + value); } catch (NoSuchFieldException e) { Log.e("TAG", "Field either doesn't exist or is not public: " + e.toString() ); } </code></pre> <p>In LogCat:</p> <pre><code>Field either doesn't exist or is not public: java.lang.NoSuchFieldException: MY_KEYCODE_01 </code></pre> <p>How can I do it?</p>
java android
[1, 4]
2,627,448
2,627,449
syntax error: insert } to complete ClassBody
<p>I created a method and keep getting an error that I need to include a } at the end of my method. I put the } in and the error is still there! If I then delete that } the same error will pop up on a prior method; and that error wasn't there before. in other words, if i type the } on my most recent method then the error stays there and only there. if i delete it, it duplicates that error on my prior method. </p> <pre><code>private void putThreeBeepers() { for (int i = 0; i &lt; 2; i++) { putBeeper(); move(); } putBeeper(); } private void backUp() { turnAround(); move(); turnAround(); } </code></pre>
java android
[1, 4]
5,389,026
5,389,027
How to get clientID if textbox name is in string variable
<p>I have written below code to check for blank value in my textbox but its generating compilation Error, please provide me solution.</p> <p>my code in javascript:</p> <pre><code> function checkTextboxNotFilled(txtbox) { var txtb = document.getElementById("&lt;%= " + txtbox + ".ClientID %&gt;"); if (GetFormattedString(txtb.value) == "") { return true ; } else { return false ; } } </code></pre> <p>error:</p> <pre><code>'string' does not contain a definition for 'ClientID' and no extension method 'ClientID' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?) </code></pre> <p>I am calling it like this : checkTextboxNotFilled("MytextboxName")</p>
asp.net javascript
[9, 3]
1,021,720
1,021,721
What is the equivalent to SoapExtension for JSON WebMethods?
<p>I've a few web methods that I use to call some external services like the Google Calendar API, obviously these can be extremely brittle.</p> <p>Unfortunately I now realise that any error thrown on these methods are not causing an exception to bubble up to Global.asax which is where errors are getting logged in this application.</p> <p>I have seen suggestions to wrap the method in a try/catch, which is a stupid way of doing it as there are a variety of errors that ASP.Net will silently swallow still.</p> <p>In trying to find a solution I've seen a lot of references to <code>SoapExtension</code>, which is exactly what I want to do but doesn't get fired as I'm returning Json. What I really want is a way to catch the error just like that.</p> <p>Any pointers appreciated, I still can't understand how the ASP.Net team could have thought that silently swallowing errors like this was a bright idea.</p> <p>So for example a method like this:</p> <pre><code> [WebMethod] [ExceptionHandling] //can I write a handler like this to catch exceptions from JSON webservices? static public void DeleteItem(string id) { var api = new GoogleCalendarAPI(User.InternalUser()); api.DeleteEvent(id); return "success"; } </code></pre>
c# asp.net
[0, 9]
1,662,896
1,662,897
jQuery reversing prependTo order
<p>I have a small problem, I have some static content inside a div and I need to add some extra content to it, prependTo works good, but the new content comes after the exisiting one. appendTo comes before the exisiting content, but each new appended content comes before the previous append.</p> <p>Hard to explain, so I added a little example here: <a href="http://jsfiddle.net/9j958/" rel="nofollow">http://jsfiddle.net/9j958/</a></p> <p>The foo# order is wrong, as you can see. Any way around this?</p>
javascript jquery
[3, 5]
3,784,448
3,784,449
Fire Event With Repeater into Repeater
<p>Good Afternoon People, I'm using a Repeater, and within that repeater there is another repeater, there is a button for each item. When I click on one of these buttons asp.net returns me the following error:</p> <blockquote> <p>Invalid postback or callback argument. Event validation is enabled using in configuration or &lt;%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.</p> </blockquote> <p>But when I add the Page directive EnableEventValidation = "false" on my page, no error but does not fire my event.</p> <p>How can this be resolved?</p>
c# asp.net
[0, 9]
1,858,386
1,858,387
Get Item ID From Context Menu
<p>hey people, I am trying to get the id of the item, in this case a table row, that was long pressed to bring up the context menu. This is my code so far.</p> <pre><code>@Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.context_menu, menu); } @Override public boolean onContextItemSelected(MenuItem item) { AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo(); switch (item.getItemId()) { case R.id.delete: deleteitem(id); //ID of item should be passed to method deleteitem Toast.makeText(this, "delete", Toast.LENGTH_LONG).show(); return true; default: return super.onContextItemSelected(item); } } </code></pre> <p>As you can see I need the id of the table row to pass to another method. I have tried using info however it is always null. Obviously I am missing something here so hopefully you'll be able to point me in the right direction. Thanks.</p>
java android
[1, 4]
4,706,901
4,706,902
how to change the text color using jquery or javascript
<p>I have a two items(rows) in the list box</p> <p>I love to work with jquery i love to work with javascript</p> <p>I have textbox and button when I enter love in the text box when I click button i need to loopthrow this list box to find the text love and change that love text color? to yellow.</p> <p>thanks</p>
javascript jquery
[3, 5]
2,218,796
2,218,797
jQuery toggle();
<p>I am loading data dynamically by AJAX into a cluetip (<a href="http://plugins.learningjquery.com/cluetip/#" rel="nofollow">http://plugins.learningjquery.com/cluetip/#</a>).</p> <p>I want to toggle the results from a link like so: </p> <pre><code>$(document).ready(function() { $("#calendarLink").live("click",( function() { $("#result").toggle(); })); }); </code></pre> <p>For some reason the above will not work. Can you suggest an alternative? </p>
javascript jquery
[3, 5]
2,464,790
2,464,791
JS: setInterval and clearIntervals with jQuery
<p>I'm probably tired for staring at this for too long, maybe someone can clear this up for me:</p> <pre><code>//scripts in whispers are setup this way. var something = function(){ setInterval(function1,1000); setInterval(function2,1000); blah .. blah... } //function2 is the same as this one var function1 = function(){ ajax to do something on server blah... blah... } //button to stop things from running anymore $('.stop').live('click',function(){ clearInterval(function1); clearInterval(function2); return false; } </code></pre> <p>I should be able to stop function1 and/or 2 from running after clicking the button yeah? For some reason - the ajax calls within the two functions keep running and pinging the server.</p>
javascript jquery
[3, 5]
1,789,777
1,789,778
ProfileBase.GetProperty() does not work on a new thread
<p>Why does this code not work if called within a new thread? The error returned is <code>Object reference not set to an instance of an object.</code> on the </p> <pre><code>return pb.GetPropertyValue("Name").ToString(); </code></pre> <p>this works</p> <pre><code>GetFullName(m); </code></pre> <p>while this doesnt</p> <pre><code>Thread t = new Thread(GetFullName); t.IsBackground = true; t.Start(); public string GetFullName(string username) { ProfileBase pb = ProfileBase.Create(username); return pb.GetPropertyValue("Name").ToString(); } </code></pre>
c# asp.net
[0, 9]
4,070,810
4,070,811
Displaying random images at runtime
<p>I am trying to display random images</p> <p>heres my code</p> <pre><code> private void Page_Load(object sender, EventArgs e) { int num1=0; Random randNum = new Random(); num1 = randNum.Next(0, 9); Image1.ImageUrl = DisplayNumber(num1); Image1.Visible=true; } protected string DisplayNumber(int i) { string imagepath=""; switch (i) { case 0: imagepath = "~/fordoctor/doctor_login/images/0.GIF"; break; case 1: imagepath = "~/fordoctor/doctor_login/images/1.GIF"; break; case 2: imagepath = "~/fordoctor/doctor_login/images/2.GIF"; break; case 3: imagepath = "~/fordoctor/doctor_login/images/3.GIF"; break; case 4: imagepath = "~/fordoctor/doctor_login/images/4.GIF"; break; case 5: imagepath = "~/fordoctor/doctor_login/images/5.GIF"; break; case 6: imagepath = "~/fordoctor/doctor_login/images/6.GIF"; break; case 7: imagepath = "~/fordoctor/doctor_login/images/7.GIF"; break; case 8: imagepath = "~/fordoctor/doctor_login/images/8.GIF"; break; case 9: imagepath = "~/fordoctor/doctor_login/images/9.GIF"; break; } Session["num1"] = imagepath; return imagepath; } </code></pre> <p>but it displays nothing i have even checked the images using Response.Write(Session["num1"].ToString()); and the images get displayed at the next page</p>
c# asp.net
[0, 9]
2,344,303
2,344,304
Code coming back from script not detected by jquery
<p>I basically have a div container which i am reusing to fill with different data, depending on the link that is clicked.</p> <p>This div container has a class name of "test_bed" and the anchors used to populate it have class names of "linkA", "linkb" etc.</p> <pre><code>$(document).ready(function(){ $("a.link").click(function(e) { //prevent default behaviour: e.preventDefault(); var a = "a"; var b = "b"; //pass vars to script: $.post('00_php_script_.php', { x:a , y:b }, function(output){ //Replace div content with script output: $('div#test_bed"').html(output).show(); }); }); }); </code></pre> <p>This is one of the "linkA" anchors as mentioned above:</p> <pre><code>&lt;a href="" id="linkA" name="linkA" class="linkA"&gt;LinkA&lt;/a&gt; </code></pre> <p>All the php script does is echo the vars back along with a link:</p> <pre><code>echo $_POST['x'] . " " . $_POST['y'] . " " . '&lt;a href="" id="linkA" name="linkA" class="linkA"&gt;LinkA&lt;/a&gt;'; </code></pre> <p>Everything works fine, except for the fact that the link, which is returned from the php script into the test_bed div does not seem to be detected by the above jquery code.</p> <p>QUESTION:</p> <p>How do I make the code which is returned from the php script be detected by the above jquery code??</p> <p>Any assistance appreciated guys....</p>
php jquery
[2, 5]
5,567,813
5,567,814
Boolean assignment in java
<p>Can you explain this assignment? What does it mean? </p> <pre><code>boolean activityExists = testIntent.resolveActivity(pm) != null; </code></pre>
java android
[1, 4]
4,913,111
4,913,112
C# application fails to call a method from C++ DLL/Project
<p>I try to integrate Web Camera support into C# solution. 1st of all I have learnt the nice example from Touchless.Vision. It contains C# solution with 3 components : - one windows form project (C#, Any CPU) - one wrapper project (C#, Any CPU) - WebCamLib project (C++, x64)</p> <p>I use Win7 x64. So the example works fine. At least from the moment when I changes Platform target from Win32 to x64 for C library/project.</p> <p>But then I have added two projects (C# wrapper and C++ project) under another C# solution. Now it always fails when it calls a method from C++ project.</p> <pre><code>System.BadImageFormatException was unhandled by user code Message="Could not load file or assembly 'WebCamLib, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format." Source="Touchless.Vision" FileName="WebCamLib, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" FusionLog="" StackTrace: at Touchless.Vision.Camera.CameraService.&lt;BuildCameraList&gt;d__0.MoveNext() at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) at Touchless.Vision.Camera.CameraService.get_AvailableCameras() in C:\CustomWare.NET\CustomWare\WebCamWrapper\Camera\CameraService.cs:line 40 </code></pre> <p>The solution uses AnyCPU platform as well. I think there should not be any conflicts based on platform. </p> <p>What can be the different between these two cases? What should I check?</p>
c# c++
[0, 6]
357,490
357,491
Local Storage using Javascript / Jquery (Without using HTML5)
<p>I want to replicate Local Storage concept (similar to HTML5) in javascript or jquery.</p> <p>But unfortunately I don't have idea, how to start this.</p> <p>Can any one suggest how to implement local storage using javascript or jquery (Without using HTML5)?</p>
javascript jquery
[3, 5]
3,381,796
3,381,797
how to get value from SharedPreferences?
<p>I have been making application which uses Preferences. I have following PreferenceActivity:</p> <pre><code>public class PreferencesActivity extends PreferenceActivity{ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.addPreferencesFromResource(R.xml.prefences); PreferenceManager.setDefaultValues(this, R.xml.prefences, true); } } </code></pre> <p>also I have following preferences.xml:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" &gt; &lt;EditTextPreference android:key="device_id" android:title="Device ID"/&gt; &lt;ListPreference android:key="update_time" android:entries="@array/update_keys" android:entryValues="@array/update_values" android:title="Update time" android:defaultValue="28800000"/&gt; &lt;/PreferenceScreen&gt; </code></pre> <p>and I try to get values from SharedPreferences in onCreate() method my main Activity:</p> <pre><code>@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); initializeOtherElements(); SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(getBaseContext()); Log.e("key", String.valueOf(prefs.getString("device_id", "1"))); } </code></pre> <p>I have added PreferencesActivity into manifest. But I see "1" in Log always. Where have I made a mistake?</p>
java android
[1, 4]
4,062,593
4,062,594
Validate the string entered is of mm/dd/yyyy format
<p>I have a datepicker control for the users to pick the date, however, they also need to enter the date manually. As such, I need to validate the date entered by the user in the textbox.</p> <p>Below is the code that I am using to validate </p> <pre><code> DateTime Test; if ((!string.IsNullOrEmpty(strtdate))) { bool valid = DateTime.TryParseExact(strtdate, "MM/dd/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out Test); } </code></pre> <p>The date entered by the user is 6/29/2011, however it gives the bool valid value as false though it is correct.</p> <p>What am I missing here? Please let me know, its urgent.</p> <p>Thanks.</p>
c# asp.net
[0, 9]
74,115
74,116
Email Validation
<p>I am checking the validation for email using regular expression its working fine for me. What if the user give some dummy mailid in the textbox? </p> <p>How can i check whether the entered mail is valid or not without telling the user to login to that mail and click subscribe link? </p> <p>Is it possible to check like this.. </p> <p>Thanks in advance</p>
c# asp.net
[0, 9]
1,325,302
1,325,303
Removing text from an array
<p>I have the following script which works:</p> <pre><code>classes = $(this).attr("class").split('_'); </code></pre> <p>If <code>$(this)</code>'s class was:</p> <pre><code>class="billed_department_employee_client_code" </code></pre> <p>The end result would look like this:</p> <pre><code>["billed", "department", "employee", "client", "code"] </code></pre> <p>This is exactly what I want as it allows me to do stuff like this</p> <pre><code>console.log( classes[0] ); console.log( classes[1] ); console.log( classes[2] ); console.log( classes[3] ); </code></pre> <p>Is it possible to remove a single value from <code>classes</code> and move the rest of the values back?</p> <p>For example,</p> <p>if <code>classes</code> contains <code>department</code>, remove it. So, if it looks like this:</p> <pre><code>["billed", "department", "employee", "client", "code"] </code></pre> <p>it should become:</p> <pre><code>["billed", "employee", "client", "code"] </code></pre> <p>How can this be done?</p>
javascript jquery
[3, 5]
4,950,537
4,950,538
asp:hyperlink navigation
<p>I am using asp:hyperlink button to open a Terms and Condition pop up window. Code for the hyperlink is -</p> <pre><code>&lt;asp:HyperLink ID="HyperLink4" Target="_blank" NavigateUrl="javascript:window.open('test.aspx');" ForeColor="#F58022" runat="server"&gt;Terms and Conditions&lt;/asp:HyperLink&gt; </code></pre> <p>When i click this Url in browser then it opens up my test.aspx page But along with test.aspx; it opens up another page and the url of page is - "javascript:window.open('test.aspx');" On the body of this unwanted page - [object].</p> <p>Can you please suggest me how to get rid of this unwanted page.</p> <p>Thanks</p>
c# asp.net javascript
[0, 9, 3]
3,100,316
3,100,317
"in" statement in Javascript/jQuery
<p>Does Javascript or jQuery have sometime like the "in" statement in Python?</p> <p>"a" in "dea" -> True</p> <p>Googling for the word <em>in</em> is hopeless :(</p>
javascript jquery
[3, 5]
1,655,807
1,655,808
Enable input filed on radio button checked
<p>I have 2 radio buttons and 2 input fields. I want to associate a radio button with a input field. So only the selected radio buttons input field will enable and others are disabled. My html markuo is :</p> <pre><code> &lt;div&gt; &lt;input type="radio" checked="checked" name="co" data-for="s" /&gt; &lt;input type="text" id="s" /&gt; &lt;br /&gt;&lt;br /&gt; &lt;input type="radio" name="co" data-for="u"/&gt; &lt;input type="text" id="u" disabled="disabled" /&gt; &lt;/div&gt; </code></pre> <p>So currently first radio button is checked and its input field is enabled. How will i do this with using little amount of jquery code ?</p> <p><strong>EDIT</strong></p> <p>I tried this :</p> <pre><code>$("input[type=radio][name=co]").bind({ change: function () { if ($(this).attr("checked") == "checked") $("#" + $(this).attr("data-for")).removeAttr("disabled"); else $("#" + $(this).attr("data-for")).attr("disabled", "disabled"); } }); </code></pre>
javascript jquery
[3, 5]
632,796
632,797
to display doc file in text format asp.net c#
<p>i want to read content of file.but these code is not helping.</p> <pre><code>string[] readText = File.ReadAllLines(path); this line is giving error. protected void btnRead_Click(object sender, EventArgs e) { string path = fileupload1.PostedFile.FileName; if (!string.IsNullOrEmpty(path)) { string[] readText = File.ReadAllLines(path); StringBuilder strbuild = new StringBuilder(); foreach (string s in readText) { strbuild.Append(s); strbuild.AppendLine(); } textBoxContents.Text = strbuild.ToString(); } } </code></pre>
c# asp.net
[0, 9]
2,512,447
2,512,448
Using javascript and jquery, to populate related select boxes with array structure
<p>Using answers to <a href="http://stackoverflow.com/questions/57522/javascript-array-with-a-mix-of-literals-and-arrays">this question</a>, I have been able to populate a select box based on the selection of another select box. ( <a href="http://stackoverflow.com/questions/57522/javascript-array-with-a-mix-of-literals-and-arrays#58062">I posted my answer here</a>) Pulling the data from an array structure built server-side, stored in a .js file and referenced in the html page.</p> <p>Now I would like to add a third select box. If I had 3 sets of data (model, make, options) something like this (pseudo code):</p> <pre><code>cars : [Honda[Accord[Lx, Dx]], [Civic[2dr, Hatchback]], [Toyota[Camry[Blk, Red]], [Prius[2dr,4dr]] </code></pre> <p>Ex: If Honda were selected, the next select box would have [Accord Civic] and if Accord were selected the next select box would have [Lx Dx]</p> <p>How can I</p> <p>1) create an array structure to hold the data? such that</p> <p>2) I can use the value from one select box to reference the needed values for the next select box</p> <p>Thanks</p> <p><strong>EDIT</strong></p> <p>I can create the following, but can't figure out the references in a way that would help populate a select box</p> <pre><code>var cars = [ {"makes" : "Honda", "models" : [ {'Accord' : ["2dr","4dr"]} , {'CRV' : ["2dr","Hatchback"]} , {'Pilot': ["base","superDuper"] } ] }, {"makes" :"Toyota", "models" : [ {'Prius' : ["green","reallyGreen"]} , {'Camry' : ["sporty","square"]} , {'Corolla' : ["cheap","superFly"] } ] } ] ; alert(cars[0].models[0].Accord[0]); ---&gt; 2dr </code></pre>
javascript jquery
[3, 5]
1,764,861
1,764,862
jQuery ajax load a page with an automatic download
<p>I have a page that produces a PDF and automatically downloads the file. </p> <p>I have to submit some variables to the page for the PDF be produced. Right now I have it submitting a form using jQuery like this <code>$("#expForm").submit();</code>. I am submitting form jQuery because I have to apply some logic before the form is submitted.</p> <p>This works fine and a PDF pops up right away.</p> <p>The problem is I need to have some sort of loading icon come up because the exporting page loads a lot of data and I do not want to confuse the user.</p> <p>I tried doing this using <code>$.post('exp.html', $("#expForm").serialize() ,function(data) {});</code></p> <p>The export page loads but it does not pop up the PDF. If I open the link from Firebug's console the PDF then loads.</p> <p>Does anyone know of a way to make it auto download the PDF with using the <code>$.post()</code></p> <p>Any help on this would be great. Thanks</p>
javascript jquery
[3, 5]
749,602
749,603
how to calcualate bounding box withing given distance
<p>I am developing a website in which i want to give a search functionality for user..the search feature will detect the users current location and will show all the business within 10 kilometer from the user's current location.. businesses are stored in database.. please can anyone help me?</p>
php javascript
[2, 3]
5,429,525
5,429,526
Delay function of jquery to load?
<p>I want to delay blocking by 2 seconds while executing this code. How can I do that ? I tried setTimeout but it did not worked.</p> <pre><code>document.getElementById('&lt;%=btnSave.ClientID%&gt;').disabled=true; document.getElementById('&lt;%=btnSave.ClientID%&gt;').value='Saving...'; $('#Block').block({message:'Please wait...',css: { border: '3px solid #a00' }}); </code></pre>
asp.net jquery
[9, 5]
2,478,723
2,478,724
how to convert Bitmap into a View?
<p>I have a back.png file which I need to </p> <ol> <li>assign to a variable and convert to bitmap</li> <li>apply a hue function to it</li> <li>and put it back</li> </ol> <blockquote> <pre><code>a = BitmapFactory.decodeResource(this.getResources(),R.drawable.back); b = Hue(a); View c = (View)findViewById(R.drawable.back); ///need to make View C = Bitmap B ... but how? </code></pre> </blockquote> <p>Here's my code so far, everything works, only I don't know how to assign my bitmap "b" back to view "c" ... any ideas?</p> <p>Thanks!</p> <p>backrepeat.xml</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/back" android:tileMode="repeat" /&gt; </code></pre> <hr> <pre><code>AbsoluteLayout al = (AbsoluteLayout)findViewById(R.id.setLay); Drawable dback = al.getBackground(); a = ((BitmapDrawable)dback).getBitmap(); //b = Hue(a); d =new BitmapDrawable(a); al.setBackgroundDrawable(d); </code></pre> <p>Edit, tired that one, but converting from a drawable to a bitmap and then back again makes it loos is tileing. I just get one bitmap stretched all over the screen...</p>
java android
[1, 4]
4,114,721
4,114,722
Change another MenuItem onClick of one
<p>My problem is that I want to change the icon from a MenuItem from Visible to not being Visible, but this ofcourse needs to go via the onOptionsItemSelected. If I call on menu, it gets the MenuItem where is clicked on, while another one needs to be hidden. And I also checked on defining the MenuItem and findViewById, which didn't work because it's no view. Let me show you a part of my code to make it more clear:</p> <pre><code>@Override public boolean onOptionsItemSelected(MenuItem menu) { switch (menu.getItemId()) { case R.id.menu_refresh: // Stuff case R.id.menu_settings: (Somehow point to R.id.menu_refresh).setVisible(false); } return super.onOptionsItemSelected(menu); } </code></pre> <p>Any ideas?</p>
java android
[1, 4]
2,054,859
2,054,860
jQuery Floating Div with Bottom Limit
<p>Trying to duplicate the mashable effect with two menus. I got the scrolling effect working, but I was looking for the effect to stop at the top of the footer. I was thinking I could do a conditional statement with the limits, but I wasn't sure how to pull it off.</p> <p>Here is the javascript I'm using.</p> <pre><code>var name = ".floater"; var menuYloc = null; jQuery(document).ready(function($) { menuYloc = parseInt(jQuery(name).css("top").substring(0,jQuery(name).css("top").indexOf("px"))) jQuery(window).scroll(function () { offset = menuYloc+jQuery(document).scrollTop()+"px"; jQuery(name).animate({top:offset},{duration:500,queue:false}); }); }); </code></pre> <p>Here is the link to the build site. <a href="http://host.philmadelphia2.com/~chill/about/" rel="nofollow">http://host.philmadelphia2.com/~chill/about/</a></p> <p>Thanks in advance.</p>
javascript jquery
[3, 5]
286,856
286,857
Display date on the basis of culture
<p>I want to display the date time (which I've placed on master page); in different language on the basis of current culture.</p> <p>My javascript code on master:</p> <pre><code> &lt;script type="text/javascript"&gt; var t; $(document).ready(function pageLoad() { setTimeout('SetTime()', 1000); }); function SetTime() { var date = new Date(); date.format = 'MM.DD.YYYY'; $get('&lt;%=lbl.ClientID %&gt;').innerHTML = date.toLocaleDateString() + " : " + date.toLocaleTimeString(); setTimeout("SetTime()", 1000); } &lt;/script&gt; </code></pre> <p>It always shows datetime string in English even if I set different culture say: french or any other.</p> <p>I tried other way through code-behind file of master page:</p> <pre><code> protected override void OnInit(EventArgs e) { base.OnInit(e); Timer1.Tick += new EventHandler&lt;EventArgs&gt;(Timer1_Tick); } void Timer1_Tick(object sender, EventArgs e) { Label2.Text = DateTime.Now.ToLongDateString() + " " + DateTime.Now.ToLongTimeString(); UpdatePanel1.Update(); } </code></pre> <p>Here, I'm getting date string in different language on the basis of culture selected. But I don't want to use Timer. Is there any way, I could achieve this without using timer. Thanks. </p>
c# javascript asp.net
[0, 3, 9]
2,228,927
2,228,928
Dynamically editable pop-up menus in Android Java
<p>I'm working with an existing Android app and I need to have a dynamically editable pop-up menu or something functionally equivalent. I want the menu to appear at the bottom of the screen or the top (out of the way, the user needs to see what is going on with the screen). That menu will display information, <em>not</em> options to select, based on what the user changes on the screen. </p> <p>My current attempts include using menuinflater to get a menu xml file to the bottom of the screen, which works, but I can't dynamically edit the names of the items in the xml file while the app is running. </p> <p>Any thoughts on how I could accomplish this?</p>
java android
[1, 4]
2,466,888
2,466,889
Cant add jquery to the head dynamically and run jquery code
<p>I have got this code:</p> <pre><code>function init(){ if (typeof window.jQuery !== 'function') { var link = document.createElement('script'); link.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'; document.getElementsByTagName('head')[0].appendChild(link); } } window.onload = init; if (typeof window.jQuery === 'function') { $(document).ready(function(){ alert(1); }); } </code></pre> <p>What I am trying to do is to add jquery script link to the head if jQuery doesnt exist and then run the code. What could be best is to check whether jquery exists in the head as soon as possible and then add a link to the source. But I dont know how to achieve so?</p> <p><strong>UPDATE:</strong> An alternative approach would be using a function:</p> <pre><code> function init(){ if (typeof window.jQuery !== 'function') { var link = document.createElement('script'); link.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'; document.getElementsByTagName('head')[0].appendChild(link); start_code(); } else{ start_code(); } } window.onload = init; function start_code(){ $(document).ready(function(){ alert(1); }); } </code></pre> <p>I could basically call a function after everything is loaded.. But this doesnt work well. cause the $ is not defined error is being thrown too</p>
javascript jquery
[3, 5]
1,462,409
1,462,410
string to two dimensional array
<p>i would like to convert this string:</p> <pre><code>'[ ['Row1 of first array', 'Row2 of first array'], ['Row1 of 2nd array', 'Row2 of 2nd array'] ]' </code></pre> <p>Into an array with three arrays of one dimension and two items.</p> <p>My expected output is an array with 2 elements:</p> <ul> <li>Array 1</li> <li>Array 2</li> </ul> <p>And every array has two elements inside.</p> <p>Is there any in Jquery to do this conversion?</p>
javascript jquery
[3, 5]
1,989,030
1,989,031
JQuery script runs twice
<p>some JQuery scripts in web page runs twice. What is all about ? Maybe somebody faced such problem ? </p> <p>For example(code that gets total items number from DB and runs in $(document).ready(function(){}); ):</p> <pre><code>$.post("/index/getitemscount/", {} ,function(data){ $('#items_count_div').html(data); }, 'text'); </code></pre> <p>As I see in FireBug(Firefox plugin), code runs twice...</p> <p>Your help would be appreciated.</p>
javascript jquery
[3, 5]
5,226,054
5,226,055
Remove empty tags in a HTML doc with jQuery
<p>im trying to remove empty p tags using jquery. </p> <p>Ive written the following only it doesnt seem to work...</p> <pre><code> $( 'p:empty' ).remove(); </code></pre> <p>Heres a live demo...</p> <p><a href="http://jsfiddle.net/CuJXG/" rel="nofollow">http://jsfiddle.net/CuJXG/</a></p>
javascript jquery
[3, 5]
3,646,679
3,646,680
How to convert DB2 timestamp to datetime?
<p>How do I convert a timestamp returned from DB2 ISeries to DateTime datatype in c#?</p> <pre><code>2012-07-06 09:52:50.926145 </code></pre> <p>This did not worked for me</p> <pre><code>myEmployee.LastModified = Convert.ToDateTime(myRecord.GetString(myRecord.GetOrdinal("LASTMODIFIED"))); </code></pre>
c# asp.net
[0, 9]
5,503,586
5,503,587
JavaScript and JQuery - Encoding HTML
<p>I have a web page that has a textarea defined on it like so:</p> <pre><code>&lt;textarea id="myTextArea" rows="6" cols="75"&gt;&lt;/textarea&gt; </code></pre> <p>There is a chance that a user may enter single and double quotes in this field. For instance, I have been testing with the following string:</p> <pre><code>Just testin' using single and double "quotes". I'm hoping the end of this task is comin'. </code></pre> <p>Additionally, the user may enter HTML code, which I would prefer to prevent. Regardless, I am passing the contents of this textarea onto web service. I must encode the contents of the textarea in JavaScript before I can send it on. Currently, I'm trying the following:</p> <pre><code>var contents $('&lt;div/&gt;').text($("#myTextArea").val()).html(); alert(contents); </code></pre> <p>I was expecting contents to display</p> <pre><code>Just testin&amp;#39; using single and double &amp;#34;quotes&amp;#34;. I&amp;#39;m hoping the end of this task is comin&amp;#39;. </code></pre> <p>Instead, the original string is printed out. Beyond just double-and-single quotes, there are a variety of entities to consider. Because of this, I was assuming there would be a way to encode HTML before passing it on. Can someone please tell me how to do this?</p> <p>Thank you,</p>
javascript jquery
[3, 5]
1,774,931
1,774,932
Check if button was clicked in PHP from serialize() jquery
<p>I'm building a form to allow someone to change the color of buttons, to be used on a webpage, via a web GUI. It's set up to submit the changes via ajax, with jquery, for preview prior to the user clicking the save submit button so they can make sure they like the changes before saving them.</p> <p>I understand that .serialize() will not send the value of a button click or even tell you that a button was clicked. I have googled and searched stackoverflow but I can't make any of the solutions work with my set up.</p> <p><strong>How can the PHP script tell if the save button was clicked?</strong></p> <p>HTML:</p> <pre><code>&lt;div id="preview"&gt;&lt;/div&gt; &lt;form id="build_form" class="build_form" action="button_preview.php" method="post"&gt; &lt;input name="color" type="radio" value="red" /&gt; red &lt;input name="color" type="radio" value="blue" /&gt; blue &lt;input name="save" type="submit" value="Save" class="button" /&gt; &lt;/form&gt; </code></pre> <p>Javascript:</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function() { $(function() { $(".build_form").change(function() { $("form").submit(); }); }); $('#build_form').submit(function() { $.ajax({ data: $(this).serialize(), type: $(this).attr('method'), url: $(this).attr('action'), success: function(response) { $('#preview').html(response); } }); return false; }); }); &lt;/script&gt; </code></pre> <p>PHP:</p> <pre><code>&lt;?php print_r($_POST); ?&gt; </code></pre>
php javascript jquery
[2, 3, 5]
2,733,259
2,733,260
calling master page constructor from content page
<p>I have parameterized constructor for the master page and no default constructor. How can i call the master page constructor from content page constructor.</p> <pre><code>BaseClass(): Master.Master(x) or BaseClass() { Master.Master(x) } </code></pre> <p>both does not work</p> <p>Thanks a lot in advance for help, Harish</p>
c# asp.net
[0, 9]
3,829,121
3,829,122
Jquery binding to keyup
<p>I'm having some problems binding to the keyup event of a textarea control. I'm trying the below</p> <pre><code>var shortDescInput = $('nobr:contains("Short Description")').closest('tr').find($('textarea[title="Short Description"]')); // this doesn't work shortDescInput.bind('keyup', function () { countShortDescChars(); }); // Nor this shortDescInput.keyup(function () { countShortDescChars(); }); </code></pre> <p>Am I missing something here that's really obvious? This is working for other controls, for example binding events to radiobuttons. I've checked and I'm defiantly selecting the right textarea with</p> <pre><code>var shortDescInput = $('nobr:contains("Short Description")').closest('tr').find($('textarea[title="Short Description"]')); </code></pre> <p>I just never seem to get the keyup event....</p>
javascript jquery
[3, 5]
3,264,135
3,264,136
drag a textarea when the cursor is inside the control
<p>i am making a textarea draggable using jquery UI....basically im making a div draggable and in that div is my textarea. when u drag the div the textarea drags too. the problem is that if my mouse pointer is inside the textarea, and i try to drag the control, it fails. so basically when the pointer changes the shape from arrow to that symbol when u are writting text( i dont know wats the name of the shape) the dragging donot occur! i think i can understand that since the text area is in editable mode, and when u click inside, the jquery drag method might not be invoked...but i think there shud be a solution to this! </p> <p>thanks!!</p>
javascript jquery
[3, 5]
200,176
200,177
Fire javascript (lightbox) once per session
<p>Hey all I have a quick javascript question! Frustrated trying to get it sorted.... right now my modal div shows after 10 seconds which is right, but I want to only show it <strong>ONCE</strong> per session. Here's my current code:</p> <pre><code>&lt;script type="text/javascript"&gt; $(function() { // wait for the DOM setTimeout(function () { var $modal = $('#free-awesome'); // your selector; cache it; only query the DOM once! $modal.modal('show'); // show modal; this happens after 10 seconds setTimeout(function () { $modal.modal('hide'); // hide modal; }, 50000); }, 10000); }); &lt;/script&gt; </code></pre> <p>Any ideas how I can adapt that javascript to show once per visit/session?</p> <p>I'm quite new to javascript so if you could let me know exactly what to swap the above out for that'd be great!</p> <p>Thanks in advance</p>
javascript jquery
[3, 5]
4,016,418
4,016,419
How to convert selectors and event capturing from jQuery to plain JS?
<p>Can someone please help with converting this code to plain JS:</p> <pre><code>$(document).ready(function() { $("textarea").bind("keydown", function(event) { var textarea = $(this).get(0); //further will need only textarea and event vars } }); </code></pre> <p>I don't care about cross browser compatibility as long as it works in current FF and Chrome.</p>
javascript jquery
[3, 5]
1,548,645
1,548,646
pre-increment and post-increment in PHP
<p>the result of the following statement should give 9 : (using java or js or c++)</p> <pre><code>i = 1; i += ++i + i++ + ++i; //i = 9 now </code></pre> <p>but in php </p> <p>the same statements will give 12 ?!</p> <pre><code>$i = 1; $i += ++$i + $i++ + ++$i; echo $i; </code></pre> <p>is this a bug or can anyone explain why ?</p>
java php javascript
[1, 2, 3]
4,688,334
4,688,335
Speed of Java vs. JS / HTML / CSS for web applications
<p>I am creating a web application. I have primarily used Javascript specifically jQuery. Because of some very specific functionality, I am running into practical limitations of Javascript--they're not hard limitations but stuff that I would find easy in Java, like making an equation editor where you can edit directly as opposed to entering TeX, is difficult in JS even using MathJax as a base. </p> <p>I'm going to have to build even more complex functionality that involves 3D and physics engines.</p> <p>For a large scale application like this--specifically one that involves 3D and physics engines--would Java be slower or faster than Javascript when one is run within a browser? (Assume that code is written well in both cases.) Or is it completely uncertain--i.e. dependent on far too many specific variables?</p> <p>Thanks.</p>
java javascript
[1, 3]
3,154,888
3,154,889
Using methods of classes in android programming
<p>Hi everyone I am a beginner in android, please help. I have DBAdapter class which has different methods to manipulate my db. I want to call the method i.e. insert when button is clicked. However it only works outside of listener (View.OnClickListener). </p> <pre><code> package com.dbclass; import android.app.Activity; import android.database.Cursor; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.Toast; public class DBActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button btn1 = (Button)findViewById(R.id.Button01); btn1.setOnClickListener(btn1Listener); DBAdapter db = new DBAdapter(this); db.open(); long id; // this needs to go to setOnclick method id = db.insertTitle( "0470285818", "Alanel", "Wrox"); Cursor c = db.getAllTitles(); if (c.moveToFirst()) { do { DisplayTitle(c); } while (c.moveToNext()); } db.close(); } public void DisplayTitle(Cursor c) { Toast.makeText(this, "id: " + c.getString(0) + "\n" + "ISBN: " + c.getString(1) + "\n" + "TITLE: " + c.getString(2) + "\n" + "PUBLISHER: " + c.getString(3), Toast.LENGTH_LONG).show(); } private View.OnClickListener btn1Listener = new View.OnClickListener() { @Override public void onClick(View v) { // db.insertTitle("0470285818", "Alanel", "Wrox"); } }; } </code></pre>
java android
[1, 4]
4,803,098
4,803,099
Interested in writing a computer game to improve my programming
<p>I've been trying to think of a good project to improve my programming skills. I'm heavilly interested in finance, but getting the data isn't so easy, therefore I thought I would try to make a simple computer game. The problem I have is I am not very 'graphics' savy. To be honest I dont know much about computer graphics. </p> <p>I should say a little about my background before you provide advice- I am very mathematical and I can do Physics (not to postgraduate level, but I know a fair amount of trig and calculus etc).</p> <p>At the moment my initial idea is some sort of game similar to command and conquer, but for prospecting for oil across a large map. To begin with, nothing fancy just entering coordinates and I could randomise the locations of oil found. However, eventually it'd be nice to make it look good- moving vehicles etc. How do companies create graphics? As far as I am aware they don't employ hosts of PhD mathematicians so they must be using libraries?</p> <p>ps if anybody could edit this to add any more relevant tags, please do</p>
java c++
[1, 6]
2,023,020
2,023,021
Which pattern jQuery $.fn.extend or $.extend use
<p>I was just reading <a href="http://stackoverflow.com/questions/3790909/javascript-module-pattern-vs-constructor-prototype-pattern">Javascript: Module Pattern vs Constructor/Prototype pattern?</a> and I was curious to know that when we extend our class with $.fn.extend or $.extend which pattern is used, Module Pattern or Constructor/Prototype pattern?</p>
javascript jquery
[3, 5]
2,619,482
2,619,483
Using jQuery.get with a file up a directory?
<p>I'm using jQuery to write a simple utility app that's just run locally. It'll read from a list of files using jQuery.get and then display them along with some meta-data (which resides in a separate file). The images and meta files live in ../scored_images/*.[jpg|meta]</p> <p>I can load the file list with jQuery.get just fine (it's in the current directory), and I can load up the images and display them without a problem. However when I go to load the meta file for display, jQuery.get seems to silently fail. I can load them fine if the path doesn't have ../ in it. Is there a way to work around this behavior?</p>
javascript jquery
[3, 5]
362,900
362,901
how to access div id in same "table td" using jquery
<p>I have the following code : </p> <pre><code>&lt;td&gt; &lt;div id="div&lt;%# Eval("Id") %&gt;" class="Display"&gt;&lt;%# Eval("Display") %&gt;&lt;/div&gt; &lt;div class="Actions"&gt; &lt;/div&gt; &lt;div class="Comment"&gt; &lt;span&gt;Comment &lt;/span&gt; &lt;input id="txt&lt;%# Eval("Id") %&gt;" type="text" width="400px" /&gt; &lt;/div&gt; &lt;/td&gt; </code></pre> <p>What I am looking for is, when i pressed EnterKey from </p> <pre><code>&lt;input id="txt&lt;%# Eval("Id") %&gt;" type="text" width="400px" /&gt; </code></pre> <p>I want to append text in </p> <pre><code>&lt;div id="div&lt;%# Eval("Id") %&gt;" class="Display"&gt;&lt;%# Eval("Display") %&gt;&lt;/div&gt; </code></pre> <p>how can I do this?</p> <p>I did follow this (but not sure if this is the best way)</p> <pre><code>if (e.which == 13) { var comment = $("#" + this.id).val(); var textId = "#" + this.id.replace("txt", "div"); $(textId).append(comment); $.ajax({ type: "POST", url: "Home.aspx/AddComments", data: "{'id': '" + this.id.replace("txt", "") + "','comments': '" + comment + "'}", dataType: "json", contentType: "application/json", success: function (response) { alert(response.d); } }); } </code></pre> <p><strong>Note : this is itemtemplate, so every div and input element have different id</strong></p>
javascript jquery asp.net
[3, 5, 9]
2,604,127
2,604,128
Finding the device model and make
<p>How do I find the make and model of an Android device?</p>
java android
[1, 4]
3,385,859
3,385,860
Avoid Page refresh on button click?
<p>I have this .net page where I have a media player control and a button. The button functionality is to call a stored procedure. I need the page NOT to reload and stop the video when the user clicks the button.</p> <p>Is there a way to do this?</p> <p>Here is the code</p> <p>watching.aspx</p> <pre><code>&lt;div id="video" runat="server"&gt; &lt;div id="myElement"&gt; Loading... &lt;/div&gt; &lt;/div&gt; &lt;asp:Button ID="btnWatchlist" runat="server" Text="add to watchlist" onclick="btnWatchlist_Click" /&gt; </code></pre> <p>watching.aspx.cs</p> <pre><code>public partial class Watching : System.Web.UI.Page { private int movieId = 0; protected void Page_Load(object sender, EventArgs e) { movieId = Int32.Parse(Request.QueryString["id"]); Movie movie = MovieAccess.GetMovieDetails(movieId); startVideo(movie); } private void startVideo(Movie movie) { string moviePath= "data/videos/"+movie.srcPath; String script = "&lt;script type='text/javascript'&gt;jwplayer('myElement').setup({file: '" + moviePath + "',image: '43.jpg', \"width\": 800,\"height\": 450,});&lt;/script&gt;"; ScriptManager.RegisterStartupScript(Page, Page.GetType(), "video", script, false); } protected void btnWatchlist_Click(object sender, EventArgs e) { MovieAccess.AddWatchlistMovie(movieId, User.Identity.Name); } } </code></pre>
c# asp.net
[0, 9]
4,131,036
4,131,037
How to check if a EditText field has change content under runtime in Android.
<p>How can I check if two EditTextField has changed content under runtime i android? I want to enable a button if both EdutTextField has some content. Thanks in advance.</p>
java android
[1, 4]
1,473,710
1,473,711
JS Jquery Namespace Calling Functions
<p>Ok terrible title but I couldn't think of another description.</p> <p>I have the following code:</p> <pre><code>jQuery( document ).ready( function( $ ) { $.myNamespace = { init: function() { $('.button').click(function() { this.anotherFunction(); }); }, anotherFunction: function() { alert('insidefunction'); } } $.myNamespace.init(); }); </code></pre> <p>As you can see I am trying to call anotherFunction from inside init and have there the two ways I tried but didn't work. So how am I able to call that function or is my concept wrong?</p>
javascript jquery
[3, 5]
3,029,443
3,029,444
Hard-coding button's width in dimension units
<p>I've got the hard-coded layout, consisting of <code>Button</code>s, and need to enlarge some of them. I found <code>Button</code>'s method <code>setWidth(int value)</code>, accepting width in pixels, but I need to set value in <code>dp</code>. So, how can I set <code>dp</code> value in program code?</p>
java android
[1, 4]
2,563,563
2,563,564
jquery PHP image upload (using .post method)
<p>I am trying to upload images on a form but I am using Jquery .Post function in order to submit the data of the form. I get a PHP error of an undifined index. Here is a small portion of my code:</p> <p>related HTML:</p> <pre><code>&lt;input type="hidden" name="MAX_FILE_SIZE" value="1000000" /&gt; Picture: &lt;input name="uploadedfile" id="uploadedfile" type="file" /&gt; </code></pre> <p>related jQuery</p> <pre><code> $.post("registerCB.php", { uploadedfile: $("#uploadedfile").val() } </code></pre> <p>The PHP that handles the submission: </p> <pre><code>//file upload $uploadedfile= $_POST["uploadedfile"]; /*--------------------Image Uploads-------------------------*/ // Where the file is going to be placed $target_path = "userImages/"; /* Add the original filename to our target path. Result is "uploads/filename.extension" */ $target_path = $target_path . basename( $_FILES[$uploadedfile]['name']); </code></pre> <p>THE ERROR: <img src="http://i.stack.imgur.com/6ySdI.png" alt="enter image description here"></p> <p>CONCLUSION: I think the issue is the .val() on the image input. I did an alert on that element and it would only alert the file name NOT the entire path. </p> <p>How can I get the entire path?</p> <p>ONE MORE THING---- I would like to control the NAME of the file. So no matter what the user uploads I can control the name....is this possible?</p> <p>THANKS!!!</p>
php jquery
[2, 5]
5,651,036
5,651,037
Call function named clearState? (java/android beginner)
<p>Here's the code:</p> <pre><code>public CellState(Context context, GameState state) { super(context); setLayoutParams(new GridView.LayoutParams(70, 70)); setScaleType(ImageView.ScaleType.CENTER_CROP); setPadding(8, 8, 8, 8); setClickable(true); mGameState = state; //TODO: call clearState } </code></pre> <p>So I have to call clearState, which has already been written. This is from a java/android intro tutorial and I've never programmed before so I've been slogging through. Any help on what to do to call clearState would be appreciated. </p> <p>clearState code:</p> <pre><code>public void clearState() { mState = EMPTY; } </code></pre>
java android
[1, 4]
5,574,143
5,574,144
asp.net lock page method until action finished
<p>I have an asp.net page that execute some update to db. The updates takes 2-3 seconds, all these hapends in a method that first read data from db and do some updates. When the page request are less then 2 sec for these action, the db read code, read the same state of records in db, and all update actions of asp.net page requests updates the same records.</p> <p>How i can prevent these, that the newest request wait untill the oldest finish their execution?</p> <p>Any ideas? </p>
c# asp.net
[0, 9]
994,514
994,515
Triggering full screen in browser with JavaScript
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1125084/how-to-make-in-javascript-full-screen-windows-stretching-all-over-the-screen">How to make in Javascript full screen windows (stretching all over the screen)</a> </p> </blockquote> <p>Currently I tried to do something like, when you click a fullscreen button current window will become full screen. I tried to use the following script, but it doesn't work. Any ideas on how to make this work?</p> <pre><code>&lt;script type="text/javascript"&gt; window.onload = maxWindow; function maxWindow() { window.moveTo(0, 0); if (document.all) { top.window.resizeTo(screen.availWidth, screen.availHeight); } else if (document.layers || document.getElementById) { if (top.window.outerHeight &lt; screen.availHeight || top.window.outerWidth &lt; screen.availWidth) { top.window.outerHeight = screen.availHeight; top.window.outerWidth = screen.availWidth; } } } &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
4,106,532
4,106,533
Javascript 'undefined error' in asp.net webform
<p>I'm not a javascript expert, but I've used it before, and this problem is perplexing me. Here's the javascript: </p> <pre><code>function formatNumThousands(myNumber) { if (myNumber.length &gt; 0) { var index = myNumber.indexOf(','); while (index != -1) { myNumber = myNumber.replace(',', ''); index = myNumber.indexOf(','); } var myResult = ''; for (var i = myNumber.length - 1; i &gt;= 0; i--) { myResult = myNumber[i] + myResult; if ((myNumber.length - i) % 3 == 0 &amp; i &gt; 0) myResult = ',' + myResult; } document.getElementById('&lt;%=txtMyNumber.ClientID%&gt;').value = myResult; } } </code></pre> <p>In the code behind, I set the attribute for this text box's OnBlur event: </p> <pre><code>this.txtMyNumber.Attributes.Add("onblur", "formatNumThousands(this.value);"); </code></pre> <p>I build and publish the app and it runs fine on my machine. Two other users get 'undefined' in the text box, regardless of what they do.</p>
javascript asp.net
[3, 9]
5,495,843
5,495,844
Avoiding having to write the same word over and over again
<p>I'm very new to javascript so this question might sound stupid. But what is the correct syntax of replacing certain words inside variables and functions. For example, I have this function:</p> <pre><code>function posTelegram(p){ var data = telegramData; $("#hotspotTelegram").css("left", xposTelegram[p] +"px"); if (p &lt; data[0] || p &gt; data[1]) { $("#hotspotTelegram").hide() } else { $("#hotspotTelegram").show() } }; </code></pre> <p>There is the word "telegram" repeating a lot and every time I make a new hotspot I'm manually inserting the word to replace "telegram" in each line. What would be a smarter way of writing that code so that I only need to write "telegram" once?</p>
javascript jquery
[3, 5]
1,244,840
1,244,841
asp.net export to access
<p>I want to export my generic list by doing the following. Please advise.</p> <p>I'd like to use the Access object model in .net and create an Access database in a memory stream populate it with my list and send it for download all in one click of a button.</p> <p>Is that possible? Would this work under heavy load? Better way?</p>
c# asp.net
[0, 9]
1,112,309
1,112,310
Is there a way to hide javascript code?
<p>I have this script that starts with <code>&lt;script&gt;</code> and finishes with <code>&lt;/script&gt;</code></p> <p>People can actually see it if they go to the source code of the page.</p> <p>Is there a way to avoid that? I mean to make that code invisible as if it where PHP?</p>
php javascript
[2, 3]
2,618,995
2,618,996
Jquery tablesorter plugin not sorting correct
<p>I have some columns with the format:</p> <pre><code>&lt;td&gt;148 kr. &lt;/td&gt; </code></pre> <p>The tablesorter plugin does not sort them correct. It is like random.</p> <p>I also have columns like this one:</p> <pre><code>&lt;td&gt;148 kr. &lt;br&gt;(Oprettelse 49 kr.)&lt;/td&gt; </code></pre> <p>Were I want to sort by the first number <code>148 kr.</code> </p> <p>What should I do? </p>
javascript jquery
[3, 5]
323,023
323,024
Why does jquery need _$ in case of overwrite?
<pre><code>var // Will speed up references to window, and allows munging its name. window = this, // Will speed up references to undefined, and allows munging its name. undefined, // Map over jQuery in case of overwrite _jQuery = window.jQuery, // Map over the $ in case of overwrite _$ = window.$, jQuery = window.jQuery = window.$ = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' return new jQuery.fn.init( selector, context ); }; </code></pre> <p>Why does jQuery need "_$ = window.$" or "_jQuery = window.jQuery"? It doesn't make sense to me, but without this two lines, the framework doesn't work.</p> <p>Thanks for any help..</p>
javascript jquery
[3, 5]
3,613,754
3,613,755
How to extend data recursively with jQuery.data?
<p>I'm looking for a better way to do this:</p> <pre><code>var extended = $.extend(entity.data('namespace'), { att1 : whatever, att2 : whatever }); entity.data('namespace', extended); </code></pre> <p>Any suggestions?</p>
javascript jquery
[3, 5]
2,886,527
2,886,528
Changing the UI of a webform when the browser language changes
<p>I need to change the location of some controls of a webform when the page is opened in a different language. That is I simply need to Localize the GUI of the Webform too along with the text of the webform.</p>
c# asp.net
[0, 9]
211,952
211,953
PHPs call_user_func_array in Python
<p>Is there an equivalent in Python for PHP's <a href="http://www.php.net/manual/en/function.call-user-func-array.php" rel="nofollow">call_user_func_array</a>?</p>
php python
[2, 7]
461,858
461,859
Email Templating with Delimiters
<p>In DasBlog the template uses the following syntax, for example:</p> <p>&lt;h1>&lt;%= MyMacro() %>&lt;/h1&gt;</p> <p>inside a txt file, and my query is, how this is evaluated at run time? Does the author of DasBlog use the AspCompiler programatically?</p> <p>Is there an Evaluating statement I am missing or is the author simply using Regular Expression search and replaces? I doubt the latter but I need to ask regardless. </p>
c# asp.net
[0, 9]
1,796,591
1,796,592
Convert a javascript piece of code into php
<p>I just want to properly translate this</p> <pre><code>foo.push(("000" + parseInt(foo1.charAt(loc3), 16).toString(2)).slice(-4)); </code></pre> <p>into php.</p> <p>Anyone can help me?</p>
php javascript
[2, 3]
1,740,658
1,740,659
Ping sql server and track newly inserted rows
<p>I m developing simple multiuser chat application in asp.net c# for my website.I have a table name chat in database.i have a chat.aspx.cs page which contains getmessage() addmessage() methods.i created 1 class file which contains getpreviousmsgcount() and newmsgcount() methods which returns the Count of total records in Chat table.now what i did is i drag two timers on my chat aspx page. on timer1 tick event i retrieve prevmsgcount() and timer2 tick event i retrieve newmsgcount(),timer1 tick event get fired before timer 2.And in timer 2 i applied a following logic if(newmgcount>prevmsgcount) then refresh a page(so getmessage() gets called again and new messages are added).But in this case i observed timers keep on refreshing page on time interval."if" condition is getting ignored.how to ping sql server continously and track insertion of new record?is der any other way without using timer controls? <strong>Plz help with the code of C# and asp.net only. Thanks in Advance.</strong> </p>
c# asp.net
[0, 9]
2,164,543
2,164,544
Keeping images in place after others are removed?
<p>I am working on a memory matching game. Right now, when the user clicks on two identical images, they are removed. This part of the game works fine. When the images are removed, I want the other images to stay in place. However, they are shifting towards each other and not leaving space.</p> <p>Demo: <a href="http://jsfiddle.net/kevinferri/bCP4G/" rel="nofollow">http://jsfiddle.net/kevinferri/bCP4G/</a></p> <p>For example, click on the two flowers in the middle column. You will see that the the two outer columns will shift towards each other and fill that empty space. How can I change it so the images will stay in place after others are removed?</p>
javascript jquery
[3, 5]
5,831,341
5,831,342
Win Form and Asp.net interface
<p>I have a WinForm which connects to a OleDb. Whilst the Project (In Visual Studio 2010) was open i clicked on the New Menu and Said <code>Add New Web Site</code> now the problem is i have a class which i created before adding the website - but the <code>code-behind</code> file can't pick up that namespace or class example: (Note both projects are in the same solution)</p> <pre><code>namespace Name { //Code From The Original Project before Adding The WebSite class DataAccessObject { private ...; private ...; } } </code></pre> <hr> <pre><code> public partial class Candidate : System.Web.UI.Page { ... ... ... DataAccessObject dao = new DataAccessObject(); } </code></pre> <p>The WebSite Section of the Project Does not even Pick up the NameSpace - </p> <p>I have Also Tried</p> <pre><code> public partial class Candidate : System.Web.UI.Page { ... ... ... Name.DataAccessObject dao = new DataAccessObject(); } </code></pre> <p><em><strong>EDIT</em></strong></p> <p>Also The whole idea behind this is that the user can switch between winForms and Web at will, So to pass on the DataAccessObject is required.</p> <p>NOTE THIS IS THE VERY FIRST TIME I AM ENTERING THE WORLD OF ASP(.NET)</p> <p>Any Advice</p>
c# asp.net
[0, 9]
1,811,418
1,811,419
accessing fields across a package
<p>How do I make fields accessible across a package? Currently, even if they are declared public i'm not able to access the fields from another class in the same package.</p>
java android
[1, 4]
2,649,121
2,649,122
market:// not supported, despite Android documentation
<p>I'm implementing in-app purchase for an Android app from within a web view. The purchase is meant to be completed via Amazon's MP3 app. If the user does not have it installed, I want to open the Market app so they can download it before attempting to complete their purchase.</p> <p>According to <a href="http://developer.android.com/guide/publishing/publishing.html#marketintent" rel="nofollow">the official Android documentation</a>, the following JavaScript should work:</p> <pre><code>window.location.href = 'market://details?id=com.amazon.mp3'; </code></pre> <p>However, when I call that, I get a view that is blank except for a link to that link and half an upside-down Android dude poking out the top left of the view (you can't make this stuff up).</p> <p>Anyone know why this might not be working? I've tested it on multiple handsets all running Android 2.1 and above. TIA for any help!</p> <p><strong>UPDATE:</strong> Thanks to @<a href="http://twitter.com/jtkendall" rel="nofollow">jtkendall</a> on Twitter for <a href="http://samstewartapps.com/blog/2010/10/12/open-the-android-market-from-an-app/" rel="nofollow">this post</a> that talks about how this behavior changed recently. Looks like this has to be implemented in native code.</p>
javascript android
[3, 4]
5,571,444
5,571,445
jquery horizontal news ticker using google jsapi
<p>I need to make some changes to this news ticker which is based on goldyberg's jquery horizontal newsticker using Google JSAPI:</p> <p><a href="http://inetwebdesign.com/jQueryTools/tickers/horizontal-news-ticker2/horizontal-news-ticker3.html" rel="nofollow">http://inetwebdesign.com/jQueryTools/tickers/horizontal-news-ticker2/horizontal-news-ticker3.html</a></p> <p>I have two questions:</p> <ol> <li><p>How do you limit the number of words that are being pulled into the div? Right now it is too long and it wraps.</p></li> <li><p>How do you add the date from the rss feed to the string that is displayed?</p></li> </ol> <p>Here is the code I believe is relevant:</p> <pre><code> parse: function(entries) { var feedMarkup = ''; feedMarkup += '&lt;ul&gt;'; for (var i = 0; i &lt; entries.length; i++) { feedMarkup += '&lt;li&gt;&lt;a target="_blank" href="'+entries[i].link+'"&gt;'+entries[i].title+'&lt;/a&gt;&lt;/li&gt;'; } feedMarkup += '&lt;/ul&gt;'; $("#ticker-content").empty().append(feedMarkup).fadeIn(400); $('#ticker ul li:eq(0)').show(); current = $('#ticker ul li:eq(0)').index(); first = 0; last = $('#ticker ul li').length; </code></pre> <p>Thanks in advance for your help.</p> <p>Regards, umbre</p>
javascript jquery
[3, 5]
2,379,420
2,379,421
redirect in n seconds and pass values
<p>i have page A and B. Once the page A loads i will be keep on getting input from user. after 60 seconds the page will automatically redirect to Page B. I did with below code.. but values are not getting passed. </p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script type="text/javascript"&gt; function printVal() { printVal.counter--; document.getElementById("timer").innerHTML=printVal.counter; if(printVal.counter==0) window.location="next.php"; } function callfun() { setInterval( function() { printVal() } ,1000); } printVal.counter=61; &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;input type="submit" value="Click Me" onclick="callfun()"&gt; &lt;p id="timer"&gt;&lt;/p&gt; &lt;form method='post' action='next.php'&gt; &lt;input type='text' name='val'&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>i ve to create a list . once user types something in text box and press enter it should go and add in a list box. and after 60 seconds i want the values in the list box to be passed to next.php . how could i do that.</p>
php javascript
[2, 3]
2,482,881
2,482,882
How to add same method to multiple classes (activity)
<p>I have 3 classes A, B, and C. These extend another class D.</p> <p>Class D has a method that is used in all classes A, B, and C. </p> <p>Now the problem is that classes A, B, and C should extend different classes and use just the same method from class D.</p> <p>I can't believe that I should copy and paste the method in all my classes. Is there something like an include for function in C?</p> <p>By the way I'm working on an Android app. Class D extends Activity and has a method for managing a common menu of Android activities A, B, and C (this is the official approach as reported in Android's documentation). However I need that these activities extend different classes such as ActivityList and not just the Activity class.</p>
java android
[1, 4]
4,762,524
4,762,525
What should the frequently asked questions really include?
<p>Sorry for intruding, I've been using SO for a while now and just recently started contributing by helping to answer questions. This is the first question I ever asked, and I wish I had a better way to approach it.</p> <p>The faqs section for Android is unhelpful. It shows the most upvoted questions, not the ones asked repeatedly but never get upvoted, because the people who constantly ask them have zero rep. So I'm asking you all to help fix this. What are the FRAs - the 'frequently replied answers' instead?</p> <p>I wish there was a meta section for each tag, but alas there isn't. This really is a meta-Android thing. Please vote up the best FRAs you'd typically give to a beginner.</p> <p>I'll start - For the initial text in the question textarea that it seems most people ignore....</p> <blockquote> <p>A: You probably have an exception. Post the stacktrace from logcat. If its a NullPointerException, 99.9999% of the time its your fault, and debug expressions and watches help. It actually might be because of your layout XML files - please post especially if said NPEs occur during a findViewById. Regardless, give us at least a bit of pseudocode that <em>smartly</em> expresses your actual problem. Real code helps us narrow down to a better answer.</p> </blockquote> <p>For info about 'smartly,' refer to <a href="http://www.catb.org/~esr/faqs/smart-questions.html" rel="nofollow">http://www.catb.org/~esr/faqs/smart-questions.html</a>. </p>
java android
[1, 4]