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,747,630
5,747,631
extension method parameter in gridview databind
<p>I'm binding an object to a gridview. The object (LeClient) consists of several variables, two of which are related to its phone number. One variable contains a string of digits (LePhone) and the other contains an int that represents the country code (LeCountryCode). I have an extension method for strings that works to format the string LePhone and that I'd like to pass it LeCountryCode as the parameter.</p> <p>So far, on RowDataBound I have an event handler with the following line:</p> <pre><code>e.Row.Cells[5].Text = (string)(e.Row.Cells[5].Text).ToPhoneFormat(1); </code></pre> <p>I'd like to replace the 1 with the corresponding country code that's stored in the object LeClient associated with the row. How does this work? I tried </p> <pre><code>.ToPhoneFormat(e.Row.DataItem("LeCountryCode")); </code></pre> <p>but it's not giving me the expected result.</p> <p>Thanks</p>
c# asp.net
[0, 9]
3,165,582
3,165,583
jQuery() on a complete, well-formatted HTML document string results in a Syntax Error, unrecognized expression
<p>I've got a document I'm pulling in with <code>$.ajax()</code>, and my <code>.done()</code> callback looks like this:</p> <pre><code>function (data, text_status, jq_xhr) { var $what_i_want = $(data).find('#what-i-want'); } </code></pre> <p>where <code>data</code> is a string that contains the entirety of an HTML document. </p> <p>This code never reaches <code>.find()</code>. Upon <code>$(data)</code>, I get</p> <pre><code>`Uncaught Error: Syntax error, unrecognized expression: &lt;!DOCTYPE html&gt;` </code></pre> <p>which continues with a contents of the entire document (the string <code>data</code>). </p> <p>The facts:</p> <ul> <li>I'm using jQuery 1.9.0 </li> <li>The document is well-formed HTML5 according to the W3C validator. </li> </ul> <p>I've used <code>jQuery()</code> to objectify many an HTML string, so I'm surprised this isn't working. Admittedly, I don't recall ever trying a whole document. Given the error, I'm guessing, perhaps, I need to escape this string somehow. But I'm not sure how.</p> <p>Incidentally, I've tried a different approach that works:</p> <pre><code>var $what_i_want = $('#what-i-want', $.parseHTML(data)) </code></pre> <p>But I can't figure out why the first approach fails.</p>
javascript jquery
[3, 5]
2,819,089
2,819,090
Passing and getting hyperlinks into a single JQuery function
<p>What I would like to do is to take several links that may be on a page and send only the link that was clicked on to a PHP script to be parsed.</p> <pre><code>&lt;a href="?something=2&amp;id=100&amp;somethingelse=55" class="link"&gt;My First Link&lt;/a&gt; &lt;a href="?something=3&amp;id=400&amp;somethingelse=65" class="link"&gt;My Second Link&lt;/a&gt; </code></pre> <p>What I would like is to grab the link and have it passed to PHP. Using this code, I am only ever able to get the first link, no matter which link I click on.</p> <p>I'd rather have one function to send these links into than a function for each and every hyperlink I have in the site. I'm simply trying to condense or consolidate the amount of functions needed that basically do the same thing.</p> <p>Here is what I have so far:</p> <pre><code> $(".link").click(function() { var v1 = $("a.link").attr("href"); // var v1 = $("a.ajax-link")[2].href; var dataString = 'v1='+ v1; $.ajax({ type: "POST", url: "/", data: dataString, dataType: 'json', success: function(data) { if(data.success == 1){ alert(data.success); } else{ alert(data.success); } } }); return false; }); </code></pre>
javascript jquery
[3, 5]
890,452
890,453
Set Referer header in asp.net
<p>&nbsp; This should be an easy question, but I've been unable to solve it. I'm trying to change the Referral header prior to redirecting the page of an HttpResponse object. I know this can be done in an HttpWebResponse, but can't get this to work for a standard Page.Response.<br /> &nbsp; I'm trying to just set the referer header to look like it originated from a temp page on my site (this is for analytics tracking for an external system). <br /> &nbsp;Is this possible to do??<br /> &nbsp;I've tried to use the code below (as well as variations such as Response.AppendHeader and Response.AddHeader), however the Referer always shows as the page that the Request initiated from.</p> <pre><code> Response.Headers.Add("Referer", "http://test.local/fromA"); Response.Redirect(HttpContext.Current.Request.Url.AbsoluteUri); </code></pre> <p>If not via .net can this be accomplished via js?<br /> Thanks!</p>
c# asp.net
[0, 9]
3,222,563
3,222,564
Listview: Bind data from db to label control by column id not name
<p>Appologies if this has already been visited a 1,000 times over but I cant think how to word my search to get the result.</p> <p>I've inherited a crappy db structure where various table use the same column names, meaning that various stored procedure return result with duplicated column names such as 'id'.</p> <p>So, I've been referencing columns in my codebehind by their column number eg </p> <pre><code>reader[22].ToString(); </code></pre> <p>However, I can't work out -monged head day- how to do this in the html.</p> <p>For example, I have a list view and have a row with a label in it, which i would normally bind data to in a fashion such as;</p> <pre><code>&lt;asp:Label ID="ProductLabel" Text='&lt;%# Eval("Product") %&gt;'runat="server" /&gt; </code></pre> <p>But, how do i do the above if I need to reference it by its column count eg column 22 ????</p> <p>Thanks for any help &amp; suggestions.</p>
c# asp.net
[0, 9]
1,307,224
1,307,225
How to improve the security on a ASP.NET site?
<p>I have an ASP.NET site and some clients want a better layer of security for accessing it. The site today asks for a username and password, but a lot of clients want to restrict the access to some machines and I need to do this on my server side. So, I'm asking for some advice.</p> <ol> <li><p>Use a VPN to restrict the access? (With mobile devices will not work)</p></li> <li><p>Is possible to check the mac address?</p></li> <li><p>Is possible to use client certificate?</p></li> </ol>
c# asp.net
[0, 9]
3,347,357
3,347,358
Find assigned EventHandlers in debug in asp.net / C#
<p>I am having an issue with asp.net and a third party control that is embedded in a user control. I want to assign an event handler to one of the third party control's events. It allows the assignment but the event handler never get's touched. I believe that I am either messing up the event handler assignment or assigning it at the wrong time. I want to track the assignment of the event handler through debug. How can I inspect which event handlers are assigned to a control in debug?</p>
c# asp.net
[0, 9]
664,342
664,343
Android java code to change displayed spinner
<p>Is there a way in android java to change the displayed spinner item to another item in the spinner list?</p> <p>If I have a spinner that has three items in its arrary can I change the value displayed to the second or third item in the arrary? I want to create a button that will change all my spinner displayed values to another selection in each of their arrarys?</p>
java android
[1, 4]
955,770
955,771
Change image size on click of button in jQuery
<p>I am working on image upload and I need to add functionality for image shapes. </p> <p>There are buttons for landscape, portrait, square and panoramic. When the user clicks any of these, the div shape will change accordingly. </p> <p>This is the code for the square shape but when I click on the square shape, it stretches the image. I want to change the shape of the div without stretching the image.</p> <pre><code>$('#Square').on('click', function(){ var images = $("#uploadedImage"); for(i=0; i&lt;images.length; i++) images[i].onload = centerImage(images[i]); function centerImage(img) { if (img.width &gt; img.height ) { var y = 160; var x = img.width/img.height*y; var marx = (x-y)/2; img.style.height = y+"px"; img.style.marginLeft = -(marx) + "px"; } } }); </code></pre>
php jquery
[2, 5]
1,069,100
1,069,101
How to work with calendar on emulator on Java, Android?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/7537494/how-to-use-calendar-in-emulator">How to use Calendar in Emulator?</a> </p> </blockquote> <p>I use calendar for my application, and app works on real device and doesn't work on emulator. But I need check workability with other versions of Android. How can I install it calendar on emulator? </p>
java android
[1, 4]
2,114,487
2,114,488
How to get the name of clicked image and compare it with a php variable?
<p>Two images, placed by php: </p> <pre><code>echo "&lt;img onclick='test()' src=\"/img/Sun.png."\"&gt;"; echo "&lt;img onclick='test()' src=\"/img/Moon.png."\"&gt;"; $x = "Sun.png"; </code></pre> <p>js: </p> <pre><code>function test(){ if (clicked_image_name == $x) ...do something </code></pre> <p>So, how to get the name of clicked image, and how to compare it with a php variable ?</p>
php javascript
[2, 3]
3,631,044
3,631,045
how to pass a checkbox value using <a href
<p>example.php ~ when i check the checkbox in example.php webpage.. then i click the print button, the value will be pass on example1.php <pre><code>if($items) { foreach($items as $i) { print"&lt;input name='checkbox[]' type='checkbox' id='checkbox[]' value='$i-&gt;logi_id'&gt;"; } } echo "&lt;a href='example1.php?checkbox=" . $checkbox . "'&gt;&lt;input type='button' name='print' id='delete' value='Print'&gt;&lt;/a&gt;" ?&gt; </code></pre> <hr> <p>example2.php</p> <pre><code>&lt;?php $keyword = $_REQUEST['keyword']; $keycateg = $_REQUEST['keycateg']; $print = $_REQUEST['print']; $checkbox = $_REQUEST['checkbox']; $count = count($_REQUEST['checkbox']); if($print){ for($i=0;$i&lt;$count;$i++){ $del_id = $checkbox[$i]; $sql = "select * FROM sampleDB WHERE logi_id='$del_id'"; $result = mysql_query($sql); } } ?&gt; </code></pre>
php jquery
[2, 5]
4,127,711
4,127,712
java Script User Define $ function like jquery
<p>I'm trying to Create user define $ function as i cannot use Jquery in existing project.</p> <p>I want to get this function as work as Jquery $('ID')</p> <p>Please give me some hint Any hint OR Example for Example</p> <pre><code>function $(element) { } var value = $('elementID').value </code></pre> <p><strong>UPDATE:</strong> As i have prototype.js</p> <pre><code>function $(element) { if (arguments.length &gt; 1) { for (var i = 0, elements = [], length = arguments.length; i &lt; length; i++) elements.push($(arguments[i])); return elements; } if (Object.isString(element)) element = document.getElementById(element); return Element.extend(element); } </code></pre>
javascript jquery
[3, 5]
2,704,871
2,704,872
How to create a javascript class or module, I need 2 instances on a page
<p>I am wrapping common javascript functions that will work on elements on a page.</p> <p>My page has 2 of these elements (textareas), so I will need to create 2 instances and then I want to do this:</p> <pre><code>var textArea1 = new SomeClass(); var textArea2 = new SomeClass(); textArea1.init("ta1"); textArea2.init("ta2"); </code></pre> <p>I tried doing this the module pattern way, but I'm confused how I can create 2 seperate instances of it?</p> <pre><code>var MYMODULE = function() { var _init = function(ta) { // .. } return { init: function(ta) { _init(ta); } }; }(); </code></pre>
javascript jquery
[3, 5]
3,830,463
3,830,464
JQuery - generating a grid from a list of words
<p>Currently this script takes the words from the list and generates a grid, giving the words random positions each time. When the words are generated I want them to be split into individual characters, into cells next to each other so the word still makes sense - how do I do this? </p> <pre><code> var listOfWords = ["mat", "cat", "dog", "pit", "pot", "fog", "log", "pan", "can", "man", ]; var shuffledWords = listOfWords.slice(0, 12); shuffledWords.sort(function () { return 0.5 - Math.random(); }); var table = $('&lt;table class="tablestyle"&gt;'); var rows = 6; var cols = 2; var tr; var index; for (var row = 0; row &lt; rows; row++) { tr = $('&lt;tr&gt;'); for (var col = 0; col &lt; cols; col++) { index = (row * cols) + col; $('&lt;td&gt;').text(shuffledWords[index]).appendTo(tr); } tr.appendTo(table); } table.appendTo('body'); $('&lt;table&gt;' + innerTable + '&lt;/table&gt;').appendTo('body'); </code></pre>
javascript jquery
[3, 5]
1,146,194
1,146,195
disable text selection while pressing 'shift'
<p>I'm implementing item selection functionality in javascript (using jQuery). <i>item</i> is a li that contains some html.<br /> the user can click on one item (makes it selected) and then shift-click on another item to select all the items in between. this basically works OK, however the shift-click also selects (higtlights) the text that appears inside the items (the basic browser functionality for shift clicks). is there any way to disable this?</p>
javascript jquery
[3, 5]
1,699,385
1,699,386
best way to store php data on a page for use with javascript/jquery?
<p>Ok, so im trying to work out the fastest way of storing data on my page without slowing the page load:</p> <ul> <li>I need to store information in the page to be later used by jquery.</li> <li>My page is an events page and i want to attach data to each event anchor.</li> <li>there are 100+ events to attach data to.</li> </ul> <p>The events anchors are created with a php loop, so i could create the data elements within this loop using either</p> <ol> <li>use un-semantic tags ie *rel="some_data"*</li> <li>create a <em>jquery.data()</em> for each iteration of the loop</li> </ol> <p>or i could run the loop again, separately, this time inside script tags with jquery.data(); </p> <p>would really appreciate any thoughts on this!</p>
php javascript jquery
[2, 3, 5]
5,432,069
5,432,070
android change selected tab background color
<p>I came from objective-c and I am an Android newbie. I am using following method that intends to change tabColor for index 0. But I would like to change default grey tab when selected. Thank you.</p> <pre><code>mTabHost.getTabWidget().getChildAt(0).setBackgroundColor(Color.CYAN); </code></pre>
java android
[1, 4]
2,870,918
2,870,919
Android set margin of buttons declared in xml file programmatically?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/2481455/set-margins-in-a-linearlayout-programmatically">Set margins in a LinearLayout programmatically</a> </p> </blockquote> <p>I have bunch of widgets in my layout.I have set layout_marginTop in layout file but I want to call these two buttons in activity and set layout_marginLeft and change the value programmatically.i tried with getLayoutParams() but can not set margin. is it possible to change margin of widgets declared in xml file programmatically(after calling layout in the activity)? </p> <p>//oncreate method</p> <pre><code>setContentView(R.layout.gamelayout); </code></pre> <p>//xml layout </p> <pre><code> &lt;ImageView android:id="@+id/gameImage" android:layout_width="fill_parent" android:layout_height="fill_parent" &gt; &lt;/ImageView&gt; &lt;Button android:id="@+id/lButton" android:layout_width="wrap_content" android:layout_height="140dip" android:layout_marginTop="10dip" android:layout_gravity="center_vertical|center_horizontal" /&gt; &lt;Button android:id="@+id/rButton" android:layout_width="wrap_content" android:layout_height="140dip" android:layout_marginTop="10dip" android:layout_gravity="center_vertical|center_horizontal" /&gt; &lt;ImageView android:id="@+id/levelImage" android:layout_width="60dip" android:layout_height="60dip" android:layout_gravity="bottom|left" android:src="@drawable/ic_launcher" /&gt; &lt;Button android:id="@+id/homeButton" android:layout_width="60dip" android:layout_height="60dip" android:layout_gravity="bottom|right" android:background="@drawable/home_btn" /&gt; &lt;/FrameLayout&gt; </code></pre> <p>please help me</p> <p>thank you</p>
java android
[1, 4]
3,908,371
3,908,372
JQuery jVal plugin running out of space on form
<p>I am using the JQuery plugin jVal. This plugin validates user input. If the user makes an error the input box is turned red and a fly out message says what is wrong. This works great for forms where there is one Label and one input per visual row. This falls apart when you have multiple labels and inputs per row. IE the fly out error gets confused with the underlying information. Is there a way to have just a * next to the field having the error, then display a summary of the all field errors in a different DIV. I am open to other JQuery plugins that would give me validation and the presentation I am after.</p>
asp.net jquery
[9, 5]
1,614,222
1,614,223
ASP.NET - Accessing copied content
<p>I have a class library project which contains some content files configured with the "Copy if newer" copy build action. This results in the files being copied to a folder under <code>...\bin\</code> for every project in the solution. In this same solution, I've got a ASP.NET web project (which is MVC, by the way). In the library I have a static constructor load the files into data structures accessible by the web project. Previously I've been including the content as an embedded resource. I now need to be able to replace them without recompiling. I want to access the data in three different contexts:</p> <ol> <li>Unit testing the library assembly</li> <li>Debugging the web application</li> <li>Hosting the site in IIS</li> </ol> <p>For unit testing, <code>Environment.CurrentDirectory</code> points to a path containing the copied content. When debugging however, it points to <code>C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE</code>. I've also looked at <code>Assembly.GetExecutingAssembly().Location</code> which points to <code>C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c44f9da4\9238ccc\assembly\dl3\eb4c23b4\9bd39460_f7d4ca01\</code>. What I need is to the physical location of the webroot <code>\bin</code> folder, but since I'm in a static constructor in the library project, I don't have access to a <code>Request.PhysicalApplicationPath</code>.</p> <p>Is there some other environment variable or structure where I can always find my "Copy if newer" files?</p>
c# asp.net
[0, 9]
2,325,305
2,325,306
part of my JS being printed at bottom of HTML
<p>I can't figure out why but at the bottom of my HTML output I have this portion of my JS being printed:</p> <pre><code>cel: function() { $( this ).dialog( “close” ); } } }); /* END REFRESH */ }); </code></pre> <p>which is at the end of my jQuery functions, like so:</p> <pre><code>var $newChange = $('&lt;div&gt;&lt;/div&gt;') .html('Change detected') .dialog({ autoOpen: false, title: 'Refresh!', modal: true, buttons: { "Refresh": function() { $("#divHint").load('url.php','q=0'); $( this ).dialog( "close" ); }, Cancel: function() { $( this ).dialog( "close" ); } } }); /* END REFRESH */ }); &lt;/script&gt; </code></pre> <p>So halfway through my "Cancel" button it begins to print my js. Can someone tell me why this is happening / how to fix it? Any help appreciated.</p> <p>There are no errors in console.</p>
javascript jquery
[3, 5]
1,181,302
1,181,303
Dynamic Javascript File newline & carriage return
<p>I am building a JS page dynamically with php using .htaccss to make .php into .js</p> <p>All works well apart from the output of the JS.</p> <p>IE</p> <pre><code>$data = array('one', 'two'); foreach($data as $d){ echo "document.write('This is a test for array item ".$d."'); \r\n"; } </code></pre> <p>Problem is it outputs it all on one line ie</p> <pre><code>document.write('This is a test for array one');document.write('This is a test for array two'); </code></pre> <p>No matter what I have tried I cant get it over 2 lines.</p> <p>Any ideas ?</p>
php javascript
[2, 3]
631,082
631,083
Android - How to change header/footer view elements for existing ListView?
<p>Say I add a header view to my list view using the typical method like so:</p> <pre><code>View header = getLayoutInflater().inflate(R.layout.list_header, null); TextView headerText = (TextView) header.findViewById(R.id.my_textview); headerText.setText("This is my header!"); myListView.addHeaderView(header); myListView.setAdapter(adapter); </code></pre> <p>Then, later I need to alter the text of the header textview...</p> <pre><code>TextView headerText = (TextView) findViewById(R.id.my_textview); headerText.setText("new header text!"); </code></pre> <p>This doesn't appear to work, since the way I originally attached the header to the list was by inflating it...</p> <p>How do I change the text?</p>
java android
[1, 4]
4,129,615
4,129,616
Save URL of AJAX loaded page, so it can be loaded after a refresh
<p>We have an application writted in PHP. Its main view is for example: <code>/pages/index</code>.</p> <p>Now when the user clicks on certain links, it pulls in other Views via ajax. ie. a call may look like <code>/pages/publish</code>, so the PHP outputs the relevant html for the publish section back to the index view.</p> <p>The problem we have is we'd like to be able to give the user the option of refreshing and seeing the same view as before. So, my initial thought is this, when we use <code>.load()</code> in jQuery, to take the URL its going to load and store it somewhere to be read by the PHP if the user refreshes. Is the best way to do or can someone think of a better way to do this whole thing?</p>
php javascript jquery
[2, 3, 5]
776,621
776,622
Retrieve database content without linebreak
<p>(asp.net C# project)</p> <p>I am trying to show contact info in my footer, I receive the info from the database, but in my administrator panel I have CKEditor which adds linebreaks. So, what my problem is that I'd like my text in my footer to have no linebreak, is there any way of doing this?</p> <p>How it looks in my contact page:</p> <pre><code>Adresse Zip, City Phone Fax </code></pre> <p>How I would like it to be in my footer:</p> <pre><code>Adresse, Zip city, phone, fax </code></pre> <p>I receive the texts using:</p> <pre><code>&lt;p&gt;&lt;asp:Literal ID="LitContent" runat="server" /&gt;&lt;/p&gt; LitContent.Text = textService.GetText("ContactInfo"); </code></pre>
c# asp.net
[0, 9]
3,057,269
3,057,270
compress file at client-side
<p>I want to upload a file to server, but is there any way(using javascript) to compress the image at client-side before upload?</p>
asp.net javascript
[9, 3]
2,309,083
2,309,084
Build textarea with formatting controls - how to get selected text
<p>Just for fun, I want to build simple text formatting tools for a textarea. To begin, I want to be able to enclose high-lighted text in a textarea with ** if it is to be in bold format (just like stackoverflow's textarea editor). I've written the following code, which works most of the time, but it does have a bug, which I'll explain shortly.</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script type="text/javascript" language="javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" language="javascript"&gt; var tmpText = ''; $(document).ready(function(){ tmpText = ''; $('#btn_bold').click(function(){bold(tmpText);}); $('textarea').bind('mouseup', function(){ tmpText = ''; if(window.getSelection){ tmpText = window.getSelection().toString(); }else if(document.getSelection){ tmpText = document.getSelection().toString(); }else if(document.selection){ tmpText = document.selection.createRange().text; } }); }); function bold(str) { $('textarea').val($('textarea').val().replace(str,'**'+str+'**')); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;button type="button" id="btn_bold"&gt;bold it&lt;/button&gt; &lt;textarea&gt;AA&lt;/textarea&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>So if you high-light the first letter A and bold it, you'll get the result <code>**A**A</code>. But if you high-light the second letter A and bold it, you still get <code>**A**A</code>, instead of <code>A**A**</code> because the line of code <code>$('textarea').val($('textarea').val().replace(str,'**'+str+'**'));</code> is insufficient at identifying which letter A you want to bold.</p> <p>What's an efficient way to identify high-lighted text and bold it?</p>
javascript jquery
[3, 5]
5,563,945
5,563,946
jquery 'attribute contains' selector with a dynamic value
<p>Let's say that i have a variable <code>questionId</code> which is an integer, and i want to find <code>tr</code> elements that have the fragment (<code>"question_"+questionId</code>) in their id. How can i do this? I thought that i would be able to do it with the jquery <a href="http://api.jquery.com/attribute-contains-selector/" rel="nofollow">'attribute contains' selector</a>. </p> <p>Eg, this works, for a non-dynamic value,</p> <pre><code>$("tr[id*='quiz_question_7674']") </code></pre> <p>but, i can't work out how to plug the variable value in there. This doesn't work for example:</p> <pre><code>questionId = 7674; $("tr[id*='quiz_question_'+questionId]") </code></pre> <p>Any ideas anyone? Is there a better way than 'attribute contains' to do it? I have the feeling i'm missing something obvious.</p> <p>thanks, max</p> <p>EDIT - SOLVED. doh, i am indeed missing something obvious. I keep forgetting that it's just a string, nothing more:</p> <p>$("tr[id*='quiz_question_"+questionId+"']")</p>
javascript jquery
[3, 5]
1,319,023
1,319,024
How can I print the contents of a link?
<p>I want the contents of a link get printed by jQuery. What do i do?</p> <p>Following is my code:<br> <strong><a href="http://jsfiddle.net/9zLGZ/" rel="nofollow">DEMO:</a></strong></p> <pre><code>&lt;a href="#" onclick="window.print(); return false;"&gt;Print&lt;/a&gt; ​ $(document).ready(function() { $('ul#tools').prepend('&lt;li class="print"&gt;&lt;a href="#print"&gt;Click me to print&lt;/a&gt;&lt;/li&gt;'); $('ul#tools li.print a').click(function() { window.open('www.google.com'); window.print(); return false; }); }); ​ </code></pre>
javascript jquery
[3, 5]
2,398,902
2,398,903
In eclipse showing response from url
<p>I am very new to programming and with alot of help from people on this site I have been able to make alot of progress. This time I am kinda stuck - I have been able to make a login screen and make a call but nothing shows back once the call is made.</p> <p>If anyone can help I would appreciate it, again I am very new so, please, any additional code would help. This is what I have so far.</p> <pre><code>import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import org.apache.http.HttpResponse; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.DefaultHttpClient; import android.app.Activity; import android.content.Intent; import android.media.MediaPlayer; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class Loginretrieve extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); String url = "http://beatswith.us/login.php"; HttpGet httpGet = new HttpGet(url); HttpClient httpClient = new DefaultHttpClient(); HttpResponse response; try { response = httpClient.execute(httpGet); Object responseString = getResponseString(response); } catch (ClientProtocolException e1) { e1.printStackTrace(); } catch (IOException e1) { e1.printStackTrace(); } catch (IllegalStateException e) { e.printStackTrace(); } } public static String getResponseString(HttpResponse response) throws IllegalStateException, IOException { String responseString = ""; BufferedReader in = null; try { in = new BufferedReader(new InputStreamReader(response.getEntity() .getContent())); StringBuffer sb = new StringBuffer(""); String line = ""; String NL = System.getProperty("line.separator"); while ((line = in.readLine()) != null) { sb.append(line + NL); } in.close(); responseString = sb.toString(); } finally { if (in != null) { try { in.close(); } catch (IOException e) { e.printStackTrace(); } } } return responseString; } } </code></pre>
java android
[1, 4]
5,310,250
5,310,251
Adding jQuery .click() to dynamically created HTML
<p>On my web app, I am dynamically creating a live feed using jQuery to parse a JSON object and dynamically creating table rows in html (see my earlier question <a href="http://stackoverflow.com/q/5773976/258813">here</a> for an example )</p> <p>Every table row I dynamically create from the JSON object, I add an image (using a standard html img tag) - What I want to do now, is create a .click() function that performs an async ajax call when that image is clicked.</p> <p>so, if my code that creates the table rows dynamically looks like this:</p> <pre><code>var html = "&lt;tr&gt;" + "&lt;td&gt;&lt;img class=\"status_refresh\" src=\"/refresh.png\" id=\"refresh_id\"/&gt;&lt;/td&gt;" + "&lt;/tr&gt;"; $('#peopleDirectory').append(html); </code></pre> <p>In my JSP, where the peopleDirectory div is defined, and the html will be appended, I have the following javascript:</p> <pre><code>$('.status_refresh').click(function () { console.log($(this).attr('id')); }); </code></pre> <p>But nothing is happening when I click.. can anyone advise what I am doing wrong?</p> <p>Thanks!</p>
javascript jquery
[3, 5]
1,075,343
1,075,344
comparing 2 strings alphabetically for sorting purposes
<p>I'm trying to compare 2 strings alphabetically for sorting purposes. For example I want to have a boolean check like <code>if('aaaa' &lt; 'ab')</code>. I tried it, but it's not giving me correct results, so I guess that's not the right syntax. How do I do this in jquery or Javascript?</p>
javascript jquery
[3, 5]
1,029,106
1,029,107
Removing elements from array dynamically
<p>So I've learnt how to add elements to an array dynamically - how about removing them?</p> <p><strong>jQuery</strong></p> <pre><code>$(document).on('change blur', '.roomFac', function () { var park = $("#park2").val(); var lecturestyle = $("#lecture_style2").val(); var roomstructure = $("#room_structure2").val(); var groupsize = $("#groupSize2").val(); var facilities = ""; $('select[name*=roomFac]').each(function () { facilities += $(this).val(); facilities += ","; }); var dataString = 'park=' + park + '&amp;' + 'lecturestyle=' + lecturestyle + '&amp;' + 'roomstructure=' + roomstructure + '&amp;' + 'groupsize=' + groupsize + '&amp;' + 'facilities=' + facilities; $.ajax({ type: "POST", url: "process_timetableMon2.php", data: dataString, cache: false, success: function (html) { $('#mon').html(html); } }); }); </code></pre> <p><strong>process_timetableMon2.php</strong></p> <pre><code>$array = explode(",", $_POST["facilities"]); for($i = 0; $i &lt; count($array)-2; $i++){ echo $array[$i].'&lt;br&gt;'; } </code></pre> <p>I've uploaded some code here: <a href="http://jsfiddle.net/kfm5b/3/" rel="nofollow">http://jsfiddle.net/kfm5b/3/</a></p>
php jquery
[2, 5]
1,473,237
1,473,238
question about 128 bit number
<p>can i represent 128 bit number in java? or in c++?</p>
java c++
[1, 6]
1,475,543
1,475,544
server-side programming
<p>I'm looking to program something for an Android machine. Basically I want the phone to communicate with a server, sending it TCP/UDP packets, and I want the server to reply to the phone an answer depending on the packet received. </p> <p>I did it while ago, with 2 PC's it wasn't really a problem. I had my "server side" running on a loop listening to a certain port and then replying. </p> <p>My question is how should I write this code if I don't want to have a PC running as a server? Any recommendations on a good free-host-server on the web, and what kind of language I should use..?</p> <p>As you can see I'm a bit lost, and need some tips/guides or anything that will help me get started.</p> <p>Thanks a lot</p>
java android
[1, 4]
3,083,313
3,083,314
keep last value of input box after submit with java script or php?
<p>i wanna keep last value of input box after submit and this is my code .<br> but my code dosent work </p> <pre><code>&lt;input type="text" name="name" value="&lt;?php echo $_GET['name'];?&gt;" /&gt; </code></pre> <p>should i use javascript or php ?</p>
php javascript jquery
[2, 3, 5]
1,045,605
1,045,606
Data option change isn't picked by jquery
<p>I've got div like this :</p> <pre><code>&lt;div id="something-1" data-options='{"pause":"YES","delete":"NO", "kill":"NO"}'&gt;&lt;/div&gt; </code></pre> <p>What I got going on is some ajax request and changes the data options like this :</p> <pre><code>$('#something-1' + item.id).attr("data-options", '{"pause":"YES","delete":"YES", "kill":"NO"}'); </code></pre> <p>When I inspect with firebug I can see changed data options in html.</p> <p>Then I have this "test" function which I trigger from firebug to see if the data has changed after the ajax update :</p> <pre><code>(function() { window.checkChanges = checkChanges; function checkChanges(id) { var dataOptions = $("#" + id).data('options'); for(var index in dataOptions) { console.log(index,dataOptions[index]); }; } })(); </code></pre> <p>But for some reason data options are the same before and after ajax request. I would need to somehow incorporate live function into this? or something else, but I don't have idea what? any suggestions?</p> <p><strong>Edit</strong></p> <p>Ajax requests changes delete to <code>YES</code></p>
javascript jquery
[3, 5]
4,146,175
4,146,176
javascript dont work with jqeury in the same page
<p>I am having a problem with my code, which is a mix of jquery and plain javascript. I use jquery to show and hide some <code>div</code>s and the js to refresh a <code>div</code> by loading a page inside the <code>div</code>. The plain js code doesn't work as is, but if I delete the jquery code it works fine. </p> <p>My code : </p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;title&gt;Ton plans&lt;/title&gt; &lt;link href="template/style.css" rel="stylesheet" type="text/css" /&gt; &lt;script type="text/javascript"&gt; var auto_refresh = setInterval( function () { $('#refresh').fadeOut().load('last_post.php').fadeIn(); }, 10000); &lt;/script&gt; &lt;script type="text/javascript" src="js/jquery-1.9.0.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; //no conflict jquery jQuery.noConflict(); //jquery stuff (function($) { $(document).ready(function() { $("#bott_div").click(function() { $("#div_profile").show(['fast']) }) $("#page").click(function() { $("#div_profile").hide(['fast']) }) }) }) (jQuery); &lt;/script&gt; &lt;/head&gt; </code></pre> <p>There is a conflict between the jQuery code and the plain javaScript that is preventing it from working properly. I would require help identifying the problem.</p>
javascript jquery
[3, 5]
935,892
935,893
How to get id of current draggable and resizable?
<p>How to get id of current draggable and resizable ? I have like </p> <pre><code>$('.demo') .resizable({ start:function(event,ui){ $(ui).item.attr('id); } }) .draggable({ start:function(event,ui){ $(ui).item.attr('id); } }); </code></pre> <p>but it returns undefined. Does anyone know solution ?</p>
javascript jquery
[3, 5]
1,402,401
1,402,402
can i store datatable for the further refinement
<p>i have a datatable with the results i just want to refine the results using this datatable... i am trying to do it but this datatable is distroyed each time page is refreshed......</p>
c# asp.net
[0, 9]
4,251,268
4,251,269
how to pass data from javascript to winforms user control
<p>I have a windows user control hosted in IE.</p> <p>how can i paas input from webpage ( propably from javascript ) to win forms user control</p> <p>can any one help me in solving this problem.</p> <p>it is urgent.</p> <p>Thanks.</p>
asp.net javascript
[9, 3]
4,941,371
4,941,372
open dialog to download pdf
<p>I have a gridview in which I have provided an option for the user to download the pdf files. When they click on the pdf icon sometimes it open the pdf file in a new tab and sometimes it starts downloading. How can i make it download always?</p>
c# asp.net
[0, 9]
3,431,394
3,431,395
increment variable on set interval using javascript?
<p>First of all this is the mini javascript script:</p> <pre><code> f = 1 $(".thumb").hover(function() { intervalId = setInterval($(this).text(f++), 400)); }); </code></pre> <p>Im trying to get the .thumb text to increase while the users moise is over it, It increases when i hover out and hover over again, but i want to increase while the user is hovered on top of the element.</p>
javascript jquery
[3, 5]
662,100
662,101
Can I iterate through table using JQuery and collect values in three arrays?
<p>Can I iterate through table with id="tbl" using JQuery with three columns and collect this value in three javascript arrays ? </p>
javascript jquery
[3, 5]
2,998,212
2,998,213
Android JSON receive issue
<p>I have a string problem, I used the below code for recieving JSON data from an URL, the code is working fine, but the problem is I am not getting full data only half of the JSON values are coming, I would like to know whether there is reason for this, if so means how to solve this problem. JSON string is very big</p> <pre><code> DefaultHttpClient http_client = new DefaultHttpClient(); HttpGet httpGet = new HttpGet(urls[0]); HttpResponse response = http_client.execute(httpGet); StatusLine statusLine = response.getStatusLine(); int statusCode = statusLine.getStatusCode(); HttpEntity entity = response.getEntity(); InputStream in = entity.getContent(); StringBuffer out = new StringBuffer(); byte[] b = new byte[4096]; int n = in.read(b); while(n&gt;0){ out.append(new String(b, 0, n)); n = in.read(b); } String resultdata = out.toString(); Log.d("Out data",resultdata); </code></pre>
java android
[1, 4]
4,167,234
4,167,235
string length in java
<pre><code>String h; h=(String) Tok.nextElement(); System.out.println("" + ++n +": "+h); h.trim(); System.out.println("The length of h :"+n+h.length()); wordlist[now]=h; System.out.println("Now length is"+wordlist[now].length()); </code></pre> <p>This "\u0B9A\u0BBF\u0BAF\u0BA9" is the string assigned to h.The output is </p> <blockquote> <p>The length of h :128</p> <p>Now length is 41</p> </blockquote> <p>I'm totally confused :( help please. Sorry . the pblm is not with operator but with length also note that the length of h is 128 !! where as the actual length is 28</p>
java android
[1, 4]
1,342,403
1,342,404
Get empty space in container
<p>How to get an empty (in example white) area in a container with Javascript? Is there a ready jQuery function or something equal?</p> <p><img src="http://i.stack.imgur.com/7uFo9.png" alt="screen"></p> <p>I need the width, height, left and top position of the 'empty' white area in Javascript.</p> <p><strong><a href="http://jsfiddle.net/P4QHj/" rel="nofollow">http://jsfiddle.net/P4QHj/</a></strong></p> <p>HTML </p> <pre><code>&lt;div id="container"&gt; &lt;div class="box-item a"&gt;A&lt;/div&gt; &lt;div class="box-item d"&gt;D&lt;/div&gt; &lt;div class="box-item e"&gt;E&lt;/div&gt; &lt;div class="box-item f"&gt;F&lt;/div&gt; &lt;/div&gt;​ </code></pre> <p>CSS</p> <pre><code>.box-item { width: 100px; height: 100px; background-color: grey; display:block; position:absolute; } #container { position:relative; width:300px; height:300px; min-width:300px; max-width:300px; } .a { position:relative; left:100px; width:200px; height:200px; } .d { left:0px; top: 200px; } .e { left:100px; top: 200px; } .f { left:200px; top: 200px; } </code></pre> <p>​</p> <p>TIA frgtv10</p>
javascript jquery
[3, 5]
5,675,856
5,675,857
How To exporting to Excel parent and nested GridView data?
<p>I have a gridview and some nested gridview inside it, when I try to export gridview data to Excel I get downloaded entire web page, I am sure it is beacause of nested gridviews.</p> <p>How can I export parent and nested gridview data into an Excel sheet?</p> <p>I use the following code to export to excel</p> <pre><code> gvExportToExcel.DataSource = objDs; gvExportToExcel.DataBind(); System.Web.HttpContext curContext = System.Web.HttpContext.Current; System.IO.StringWriter strWriter = null; System.Web.UI.HtmlTextWriter htmlWriter = null; curContext.Response.Clear(); curContext.Response.Buffer = true; curContext.Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("SearchSubmissionResult", System.Text.Encoding.UTF8) + ".xls"); curContext.Response.ContentType = "application/vnd.ms-excel"; curContext.Response.Write("&lt;meta http-equiv=Content-Type content=text/html;charset=UTF-8&gt;"); strWriter = new System.IO.StringWriter(); htmlWriter = new System.Web.UI.HtmlTextWriter(strWriter); this.ClearControls(gvExportToExcel); gvExportToExcel.RenderControl(htmlWriter); curContext.Response.Write(strWriter.ToString()); curContext.Response.End(); </code></pre>
c# asp.net
[0, 9]
2,483,257
2,483,258
Checking Number of Selected Checkboxes
<p>I saw the <a href="http://docs.jquery.com/Is" rel="nofollow">is</a> function in jQuery, and it returns me, for example, if any of the checkboxes are selected.</p> <p>I need to do a check for how many checkboxes had been selected by the user, because my app requires something like "select two of these". Is there a quick way to do it?</p> <p>Also, how can I catch when the user clicks the "submit" and then be able to decide whether to let the form send or not, according to checks?</p>
javascript jquery
[3, 5]
3,906,368
3,906,369
Maintain return URL in live id integration
<p>I am creating an application in which I am using Live Id authentication. When the user tries to access an authenticated page, I am redirecting the user to Live Id sign in page. Is it possible to return the user to the previously asked page (from which he was redirected). Some thing like return URL.</p> <p>Actually I want to pass some data in query string to webauth-handler.aspx page when the user successfully logs in. Can any body tell me how to pass query string to webauth-handler.aspx?</p> <p>Thanks Ashwani</p>
c# asp.net
[0, 9]
666,686
666,687
How can I display a dialog box for making a choice before a CALL is processed in android?
<p>I would like to intercept outgoing calls and pass them to a VOIP application. I see that the Google Voice application has a feature for displaying a question before each call is actually initiated. It provides the user with the choice:</p> <ul> <li>Initiate call via Google Voice</li> <li>Initiate call via standard call</li> </ul> <p>I would like a way to do something similar with my application (so that not all calls have to be routed through it). At the moment, I can intercept CALL events via a BroadcastReceiver, however, these are not allowed to open dialogs (thus making it possible to display the choice).</p> <p>What is the best way of achieving this goal?</p>
java android
[1, 4]
2,627,154
2,627,155
How to find the index of a clicked element from an array with jquery?
<p><strong>How can I find the index of a clicked anchor tag from an array with jquery???</strong></p> <p>I want to search if there is an element that eqqal to clicked element, and if is true return the index of that element.</p> <p>i tried with something like this but it return with -1</p> <pre><code>$('#id').click(function(){ var obj = $('a').get(0).href; var arr = $.makeArray(obj); var getclickedhref = $(this).get(0).href; var clickedindex = $.inArray(getclickedhref, arr); console.log(clickedindex); }); </code></pre> <p>please can you help me??!</p>
javascript jquery
[3, 5]
1,835,427
1,835,428
Can't bind DataTable to GridView
<p>Hey guys I've just started programming and I'm running into a problem. The new Datatable i created doesnt show in GridView2 when button1 is clicked. Although it is filled with data from the "planning" table(checked that dtPlanning is filled with the TextBoxes in comment).</p> <p>So in short: I want to get DataTable planning into the new DataTable dtPlanning and display it in a gridview.</p> <p><strong>Code Behind:</strong></p> <pre><code>protected void Button1_Click(object sender, EventArgs e) { DataTable dtPlanning = new DataTable(); dtPlanning.Columns.Add("Courseday", typeof(int)); dtPlanning.Columns.Add("Part", typeof(string)); dtPlanning.Columns.Add("Design", typeof(string)); dtPlanning.Columns.Add("Lesson", typeof(string)); //DataRow dr = planning.Rows[1]; //TextBox2.Text = (dr["Daynumber"]).ToString(); //TextBox3.Text = (dr["Part"]).ToString(); //TextBox4.Text = (dr["Design"]).ToString(); //TextBox5.Text = (dr["Lesson"]).ToString(); for (int i = 0; i &lt; dtPlanning.Rows.Count; i++) { DataRow dr = dtPlanning.NewRow(); foreach (DataRow datarow in planning.Rows) { dtPlanning.Rows.Add(datarow); } } GridView2.DataSource = dtPlanning; GridView2.DataBind(); } </code></pre> <p><strong>Source code:</strong></p> <pre><code>&lt;asp:GridView ID="GridView2" runat="server"&gt; </code></pre> <p>Thank you for your help.</p>
c# asp.net
[0, 9]
3,062,512
3,062,513
how to convert docx to pdf in asp.net without MS office installed on server
<p>I just want to ask is there any way we can convert .docx files into PDFs without MS office installed on my server?</p> <p>Is there any adobe SDK which can help me to perform this action in ASP.NET?</p> <p>If there is any free (open source) API please let me know, or any paid which help to achieve this solution?</p> <p>But first of all is any thing from Adobe to get the solution?</p>
c# asp.net
[0, 9]
612,523
612,524
Lose contact with resources - why
<p>Im developing in eclipse with 5 activities, but suddenly I loose contact with all my resources.</p> <p>Have anyone experienced this phenomenon and knows what to do about it? I have already tried cleaning up the project but no luck</p> <p>Update: I managed to resolve the issues by deleting the project and then importing an older version, which worked. Then copying and pasting from the new and damaged version to the old version..</p>
java android
[1, 4]
4,504,029
4,504,030
How to trigger a certain button using a custom attribute
<p>I'm getting the variable through the url. <a href="http://mysite.com/?category_id=1" rel="nofollow">http://mysite.com/?category_id=1</a> I want to trigger a button using a category-id attribute:<br/> <code>&lt;a class="cat-item" category-id="1" href="#"&gt;</code></p> <p>I don't have problems getting the parameter in the url. My only problem is how to trigger the button after loading the site.</p> <p>thanks for the help.</p>
javascript jquery
[3, 5]
5,244,472
5,244,473
Kill one thread in sleep mode in android
<p>I have an android application, that have one thread, which will run after each 1 minute. So my problem is, when i click one button, i have to reset the app, that means, it'll be a fresh app. So now when i clicked on that button, all the database and shared preference will clear. But the thread will start again.</p> <p>Now am using like this</p> <pre><code>if (killthread.isAlive()) { killthread.interrupt(); }else { // Here what'll i do, I mean how to kill that thread, which in sleep mode. } </code></pre> <p>Thank you vishnu</p>
java android
[1, 4]
3,659,593
3,659,594
Is it safe when compare 2 float/double directly in Java?
<p>Is it safe if I use comparision like this (a is int, b and c is float/double):</p> <pre><code>a == b b == c </code></pre> <p>It may hear ridiculous, but in my old programing language, sometimes 1 + 2 == 3 is false (because left side returns 2.99999999999...). And, what about this:</p> <pre><code>Math.sqrt(b) == Math.sqrt(c) b / 3 == 10 / 3 //In case b = 10, does it return true? </code></pre>
java android
[1, 4]
454,853
454,854
Vertical scrolling parallax background effect
<h2>Background</h2> <p>I have been asked to write a script that will create a vertical scrolling parallax background effect for a project. My initial attempt looks a little something like this:</p> <pre><code>(function($){ $.fn.parallax = function(options){ var $$ = $(this); offset = $$.offset(); var defaults = { "start": 0, "stop": offset.top + $$.height(), "coeff": 0.95 }; var opts = $.extend(defaults, options); return this.each(function(){ $(window).bind('scroll', function() { windowTop = $(window).scrollTop(); if((windowTop &gt;= opts.start) &amp;&amp; (windowTop &lt;= opts.stop)) { newCoord = windowTop * opts.coeff; $$.css({ "background-position": "0 "+ newCoord + "px" }); } }); }); }; })(jQuery); // call the plugin $('.lines1').parallax({ "coeff":0.65 }); $('.lines1 .lines2').parallax({ "coeff":1.15 }); </code></pre> <p>This code does give the required effect, but the bind on the scroll event is a real performance drain.</p> <h2>Question</h2> <p>Part 1. How could I change my plugin to be more efficient? Part 2. Are there any resources (books, links, tutorials) I can read to find out more?</p>
javascript jquery
[3, 5]
1,537,257
1,537,258
How to get a variable to the element from a function in .data()
<pre><code>var el = $('#someElement'); el.data('f', function() { console.log(this); // return an object to the window }); </code></pre> <p>So i would like something that return me an object like "el" from inside the function.</p> <p>The reason is that the element is going to be duplicated and i don't know on which element the function is applied.</p>
javascript jquery
[3, 5]
5,945,430
5,945,431
Using variables in Asp.NET Control Attributes in Html View
<p>I wonder if there is any way to do this:</p> <pre><code>&lt;asp:Label ID="lblSomething" runat="server" Visible="this.ShowLabel"/&gt; </code></pre> <p>and in the code behind:</p> <pre><code>public bool ShowLabel {get;set;} </code></pre> <p>I know some of you may ask me why I need it but I find this approach cleaner than saying this in the code behind:</p> <pre><code>lblSomething.Visible = this.ShowLabel </code></pre> <p>And also I could say this in source view:</p> <pre><code>&lt;% if(this.ShowLabel){ %&gt; &lt;asp:Label ID="lblSomething" runat="server" Text="Something"/&gt; &lt;% } %&gt; </code></pre> <p>but again, the first one would be more intuitive to me. Any ideas?</p>
c# asp.net
[0, 9]
4,572,206
4,572,207
How do I add slashes to a string in Javascript?
<p>Just a string. Add \' to it every time there is a single quote.</p>
javascript jquery
[3, 5]
3,756,398
3,756,399
Continue execution of the code after alert message from clientside
<p>I've to send mail using webappplication.All works fine but i've to show a confirm message if attachments are not selected.In that confirm box when ok is clicked execution of the code should continue,when cancel button is clicked it should return.</p> <p>This is my code</p> <p>Code behind</p> <pre><code> protected void btnSend_Click(object sender, EventArgs e) { string str = "Are you sure, you want to proceed without attachment?"; this.ClientScript.RegisterStartupScript(typeof(Page), "Popup", "ConfirmApproval('" + str + "');", true); ...Send mail code goes here } </code></pre> <p>ASPX</p> <pre><code>function ConfirmApproval(objMsg) { if(confirm(objMsg)) { alert("execute code."); return true; } else return false; } </code></pre> <p>It works fine, ie when ok button is clicked an alert "execute code" is displaying.Instead of displaying alert i want to continue execution of the code.How will we do that from client side ???</p>
c# javascript
[0, 3]
2,058,670
2,058,671
How to make my App modular?
<p>Hi and thanks for your attention.</p> <p>I have an Android App (Java) whose code is growing (and eventually will need to grow more and more).</p> <p>So I have to face the fact that I have make it somehow modular to make it manageable.</p> <p>So I am here to ask some advice on how to go about it.</p> <p>Basically the Apps consists of 2 screens, lets' call them A and B.</p> <p>The App starts with screen A, which is a quiz, if the user responds correctly the screen B is displayed, showing the results; if the user wants to go on and take another quiz the App switches again to screen A, and so on in an infinite loop.</p> <p>Please can you give me some advice no how to make this app more modular, to avoid all the code written in 'onCreate()'.</p> <p>In particular how could I implement communication between the modules: how the Quiz module would communicate to the main and ask to switch the screen from A to B; how would the actions performed on screen B would communicate again to the main and ask to switch again to A.</p> <p>I know it is a very open question, I am looking for some guidance, any suggestion very much appreciated. </p>
java android
[1, 4]
4,527,595
4,527,596
Does an alternative to .closest() exist?
<p>this is a snippet from my code:</p> <pre><code>$(&quot;#myid&quot;).append($(&quot;p:contains('text')&quot;).closest(&quot;div&quot;).clone()); </code></pre> <p>I tried to get the first closest ancestor div-element of p containing 'text'.</p> <p>I'm looking for an alternative to .closest() because I have to use jquery version 1.2.6. Do you have got an idea what I'm looking for?</p> <p>I hope you can help me. I appreciate every hint, piece of code, etc.. </p>
javascript jquery
[3, 5]
1,824,880
1,824,881
Is it possible to apply multiple ColorFilters on a Drawable?
<p>Is it possible to apply multiple ColorFilters on a Drawable by i.e. apply the first ColorFilter on the drawable and then apply a second one on the mutated drawable?</p> <p>Sample Code:</p> <pre><code>@Override public View getView(int position, View convertView, ViewGroup parent) { View returnView = super.getDropDownView(position, convertView, parent); Drawable d = returnView.getBackground(); d.setColorFilter(0xFFF1F633, PorterDuff.Mode.MULTIPLY); // overrides the first color filter d.setColorFilter(0xFFEEEEEE, PorterDuff.Mode.LIGHTEN); returnView.setBackgroundDrawable(d); return returnView; } </code></pre>
java android
[1, 4]
5,965,404
5,965,405
how to UnSelect all rows in GridView - asp.net?
<p>how to UnSelect all rows in GridView - asp.net ?</p> <p>if i select one row in GridView and make any refresh, how to unselect this row ?</p> <p>thanks</p>
c# asp.net
[0, 9]
3,524,323
3,524,324
Vector-Java equivalent in PHP?
<p>Is there a:</p> <p>1> Vector(Java) class<br> 2> ListIterator<br> 3> Single Linkedlist </p> <p>equivalent available in PHP?</p>
java php
[1, 2]
1,122,112
1,122,113
Call jquery from php
<p>I have a form with Name : input and a submit. When pressed, it posts to the same php file. My first check is basically <code>if(!$name) { call jquery to insert error class }</code>. I have the jquery set up in a function but I'm not sure how to call the function from the if statement.</p>
php jquery
[2, 5]
4,186,461
4,186,462
javascript alert like gmail chat on chat updation
<p>I want Popups on new chat or popups when chat updated like gmail... For Example if I am on other tab and gmail chat is updated then it shows on title.. I just want this type of code which shows when my database is updated or after every 10 seconds and once I clicked on it then it should not show again and again.... </p>
javascript jquery
[3, 5]
3,230,427
3,230,428
How to restore checkbox state
<p>I have one buton on my jsp and clicking that button user will see jquery dialog box as popup,which is having several checkboxes. That popup will also have two button save and cancel.</p> <p>I would like to restore state of checkbox.for better understading please follow below steps</p> <ol> <li>user clicks on showpop button on the jsp page</li> <li>user will now see jquery popup having several checkbox</li> <li>user checks first and second checkbox from the popup and click on save button that result in closing popup</li> <li>user again click on show popup button ,uncheck first check box and click on cancel button that also result in closing popup</li> <li>and now from main jsp if user again clicks on show popup buton i would like to see two checkbox checked but its showing one checkbox checked.</li> </ol> <p>any help would be much appreciated</p>
javascript jquery
[3, 5]
3,366,098
3,366,099
jquery inquiry: passing message without a new pageload
<p>Please forgive the awkwardness of this question, I honestly don't know how to phrase a better query...</p> <p>The situation:</p> <p>I have a basic contact form within an xhtml/php page that I'm in the process of upgrading. I recently added a new unrelated jquery plugin on this page, so I would like to use the jquery functionality to help with some simple form validation if possible. The validation is already being done via PHP in a separate file submitted by the contact form.</p> <p>What I want to happen, is for the PHP validation message to be passed back to the main (contact form) page without a new pageload. I've seen this done by means of jquery somewhere, but I can't seem to find it again either here or via google. Can anyone help?</p> <p>I'm really looking for speed and simplicity here, and at first glance, the jquery validation plugin is daunting in its size and complexity, so I'm loath to embark on that particular route...</p>
php jquery
[2, 5]
4,216,403
4,216,404
How to get a collapsible bottom bar Jquery?
<p>I want to do something like this:</p> <p><a href="http://devheart.org/articles/jquery-collapsible-sidebar-layout/" rel="nofollow">http://devheart.org/articles/jquery-collapsible-sidebar-layout/</a></p> <p>But I would like the separator bar to be vertical such that the sidepanel is on the bottom and content is on top divided by a separator that runs horizontally to expand and collapse. </p> <p>What tweaks are needed to accomplish this such that I don't need to worry about having a vertical scrollbar and the sidepanel stays at the bottom without forcing users to scroll when not necessary.</p>
javascript jquery
[3, 5]
1,338,369
1,338,370
Am I using $(this) or .click incorrectly?
<p>I am trying to build a simple FAQ page with answers that slideDown and Up when their questions are clicked. When the user clicks on a something with class "question" I want mytarget to become '#' + [that question's id] + 'ans' so the appropriate answer slides down.</p> <p>The toggleSlide part works when I just give it an answer's ID; I'm not sure if my .click function is wrong, or my use of $(this), or both.</p> <pre><code>$(document).ready(function() { var qid = ''; var mytarget = ''; function toggleSlide() { if ($(mytarget).css('display') == 'none') { $(mytarget).slideDown(600, 'swing'); } else if ($(mytarget).css('display') == 'block') { $(mytarget).slideUp(600, 'swing'); } }; $('.answer').hide(); $('.question').click(function() { qid = $('this').id(); mytarget = '#' + qid + 'ans'; toggleSlide(); }); });​ </code></pre>
javascript jquery
[3, 5]
1,154,626
1,154,627
How to push values to a multi-dimensional array
<p>I can't figure out how to push values to a dynamic multi-dimensional array. This is the code i have:</p> <pre><code>function compareNumbers(){ var count = $('.finishedRow').length; var inputtedNums = new Array(); for(var i=0; i&lt;count; i++){ $('.finishedRow').eq(i).find('li').each(function(j){ inputtedNums[i].push($(this).text()); }); } console.log(inputtedNums); } </code></pre> <p>So say there are, for example, 3 <code>finishedRow</code> selectors and each <code>finishedRow</code> selector contains 4 <code>li</code> elements with values of <code>first</code>, <code>second</code>, <code>third</code>, <code>fourth</code>. I want my <code>inputtedNums</code> variable to look like:</p> <pre><code>inputtedNums = [ ["first", "second", "third", "fourth"], ["first", "second", "third", "fourth"], ["first", "second", "third", "fourth"] ] </code></pre> <p>As my code is now I get the error: <code>Cannot call method 'push' of undefined</code>.</p> <p>I'm sure I'm missing something fundamental here.</p>
javascript jquery
[3, 5]
962,989
962,990
Add active class to menu "parent" item if URL has a a /directory/ listing
<p>trying to add a CSS class to a a parent item when the URL contains a directory path.</p> <p>For instance if my url is</p> <p><code>example.com/directory/about.html</code></p> <p>I want to add a CSS class an item in my top navigation if it contains <code>/directory/</code> in it. </p> <p>so in this case, <code>example.com/directory/overview.html</code> would get a CSS class "<code>active-parent</code>" </p> <p>which would be <code>.main-nav li a.active-parent</code></p> <p>(mind you I am already using jquery to check for teh URL and make that page active, but its when its a sub page of a section, the parent is not highlighted)</p> <p>I thought I could usde the <a href="http://api.jquery.com/contains-selector/" rel="nofollow"><code>:contains() Selector</code></a> but I dont know how to apply it to a URL</p>
javascript jquery
[3, 5]
1,035,339
1,035,340
Select distinct elements in listview when click item
<p>I have a list view with custom adapter, with an Image Button and a Text View.</p> <p>I want to open a context menu when a press is made on the Image Button, and open another context menu if i press the Text View.</p> <p>How can I do this??</p> <p>This is my onClickListener</p> <pre><code>lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) { if (id == view.findViewById(R.id.label).getId()) //label press { TextView text = (TextView) view.findViewById(R.id.label); registerForContextMenu(text); openContextMenu(text); } else //imageButton press { ImageButton ib= (ImageButton) view.findViewById(R.id.image); registerForContextMenu(ib); openContextMenu(ib); } } }); </code></pre>
java android
[1, 4]
1,188,674
1,188,675
JQuery/PHP - Only showing a button for Administrator account
<p>I have a web site which allows users to logon to a control panel that allows users to change content of the web site.</p> <p>When creating the users you can set the account type: (PHP)</p> <p>i.e. <code>UserAccount::get_accounttype() == 1</code> full access</p> <p>and <code>UserAccount::get_accounttype() == 0</code> part access</p> <p>I have stopped access to certain pages by using a redirect as follows:</p> <pre><code>if (UserAccount::get_accounttype() == 0 { header("Locaction: webpage.php"); } </code></pre> <p>However on certain pages I am wanting to hide certain buttons so that users with <code>UserAccount::get_accounttype() == 0</code> can't use or see them.</p> <p>I am just wondering what the best way to achieve this would be?</p> <p>I know I can hide buttons in jQuery using <code>$('target').hide();</code> but how would I do this from a PHP function?</p>
php jquery
[2, 5]
4,552,456
4,552,457
What does jQuery object contain?
<p>let's say, i have this code:</p> <pre><code>&lt;ul&gt; &lt;li&gt;&lt;strong&gt;list&lt;/strong&gt; item 1 - one strong tag&lt;/li&gt; &lt;li&gt;&lt;strong&gt;list&lt;/strong&gt; item &lt;strong&gt;2&lt;/strong&gt; - two &lt;span&gt;strong tags&lt;/span&gt;&lt;/li&gt; &lt;li&gt;list item 3&lt;/li&gt; &lt;li&gt;list item 4&lt;/li&gt; &lt;li&gt;list item 5&lt;/li&gt; &lt;li&gt;list item 6&lt;/li&gt; &lt;/ul&gt; &lt;script&gt; var x = $("li"); for (var k in x){ alert(k + x[k]); } &lt;/script&gt; </code></pre> <p>The problem is: alert outputs too many things! Why? Why doesn't it output only li elements?? Where do li elements get stored?? How do i output only li elements to which jQuery methods usually applied??</p>
javascript jquery
[3, 5]
120,480
120,481
When should I create a new activity?
<p>When should a new activity be created in android? Should I create a new activity for each large task or just switch views? What's best practice?</p>
java android
[1, 4]
2,754,108
2,754,109
jQuery OnClick not firing my event
<p>I have a jQuery which is like this:</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function () { $("#txtAgentName").click(function (event) { alert("I am ready!"); }); }); &lt;/script&gt; </code></pre> <p>What I am assuming that this should fire if I click on my textbox txtAgentName. But it is not happening. </p> <p>This is my textbox markup:</p> <pre><code> &lt;asp:TextBox ID="txtAgentName" runat="server" onclick="Event();"&gt;&lt;/asp:TextBox&gt; </code></pre> <p>However, when I am doing this on my Javascript:</p> <pre><code>function ShowTime() { alert('&lt;%= DateTime.Now.ToString() %&gt;'); } </code></pre> <p>and calling this ShowTime from my TextBox OnClick event, then it is firing up. Dont know what I am doing wrong here :(</p>
javascript jquery asp.net
[3, 5, 9]
5,635,972
5,635,973
jQuery: Returning the text from first-child or self
<p>I am trying to get the text inside an element and I only want to get the text if it's inside the first-child of a placehoder div or if there are no childrent and it's only text inside.<br /> So the two scenarios are:</p> <pre><code>&lt;div id="wrap"&gt;text1&lt;/div&gt; </code></pre> <p>and</p> <pre><code>&lt;div id="wrap"&gt;&lt;b&gt;text1&lt;/b&gt;&lt;b&gt;text2&lt;/b&gt;&lt;/div&gt; </code></pre> <p>So In both cases I want to get back <code>"text1"</code><br /> I know how to do it with 2 different queries but I am trying to unite them into one </p> <pre><code>$("#wrap :first-child").text() $("#wrap").text() </code></pre>
javascript jquery
[3, 5]
336,253
336,254
Problem with adding integers in an array
<p>I'm trying to loop through my totals in order to get a grand total for my web app. So far the code I am working with is the following:</p> <pre><code>function calcAllFields() { var name = parseFloat($('div [name = total[]]').text()); var totArray = $.makeArray(name); var total = 0; for (var i = 0; i &lt; totArray.length; i++) { total += totArray[i]; } $("#target1").text(total); } </code></pre> <p>Instead of adding integers, something is being read as a string. Say I want to add 200 + 50, instead of 250 I get 20050. Could anyone please point out what I'm doing wrong? Thanks!</p>
javascript jquery
[3, 5]
1,552,101
1,552,102
Differences between ScriptManager and ClientScript when used to execute JS?
<p>Can somebody explain for me what the differences are between ScriptManager and ClientScript?</p> <p>ClientScript works well when I use it in Button_Clicked event, but it doesn't work when I use it in the GridView_RowUpdated of a GridView. (The GirdView is wrapped inside an update panel). Then I tried ClientScript and it worked perfectly in this case.</p>
c# asp.net
[0, 9]
4,547,731
4,547,732
Send commands between two computers over the internet
<p>I wish to control my computer (and usb devices attached to the computer) at home with any computer that is connected to the internet. The computer at home must have a program installed that receives commands from any other computer that is connected to the internet. I thought it would be best if I do this with a web interface as it would not be necessary to install software on that computer. For obvious reasons it would require log in details.</p> <p><strong>Extra details</strong>: The main part of the project is actually a device that I will develop that connects to the computer's usb port. Sorry if it was a bit vague in my original question. This device will perform simple functions such as turning lights on etc. At first I will just attempt to switch the lights remotely using the internet. Later on I will add commands that can control certain aspects of the computer such as the music player. I think doing a full remote desktop connection to control my device is therefore not quite necessary. Does anybody know of any open source projects that can perform these functions?</p> <p>So basically the problem is sending encrypted commands from a web interface to my computer at home. What would be the best method to achieve this and what programming languages should I use? I know Java, Python and C quite well, but have very little experience with web applications, such as Javascript and PHP.</p> <p>I have looked at web chat examples as it is sort of similar concept to what I wish to achieve, except the text can be replaced with commands. Is this a viable solution or are there better alternatives?</p> <p>Thank you</p>
java php javascript python
[1, 2, 3, 7]
1,740,844
1,740,845
JQuery - append rather than replace content using .innerHTML?
<p>Below is a function that retrieves a users older wallposts, 16 at a time, and appends each chunk of 16 to the end of the current list in the div called "sw1".</p> <p>It works fine, except in the case where there is currently a wallpost that contains a video/embedded object that is currently in the process of playing. When we click on the button that calls the function below during the playback of an object in sw1, the below function seems to cause the entire content of sw1 to be removed, and then re-dumped.</p> <p>Is it possible to modify the function below so that it merely appends new data to the end of sw1, rather than replacing the entire contents, killing any objects that are currently playing??</p> <pre><code>function fetch_older_wallposts(u,lim){ var xhr = getXMLHttpRequest(); xhr.onreadystatechange = function() { if (xhr.readyState == 4 &amp;&amp; (xhr.status == 200 || xhr.status == 0)) { //document.getElementById( 'sw1' ).innerHTML.append( xhr.responseText ); document.getElementById( 'sw1' ).innerHTML += xhr.responseText; }else{ document.getElementById( 'oaps_loading' ).innerHTML = 'loading'; } }; xhr.open("POST", "script.php?u="+u+"&amp;lim="+lim, true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.send(null); } </code></pre> <p>Any sort of assistance or guidance appreciated guys....</p> <p>Thanks for all the usefull comments guys!</p>
javascript jquery
[3, 5]
121,843
121,844
Abstracting an id attribute in C# or Java
<p>I am designing an API. Here are some example methods from an interface:</p> <pre><code>Entry findEntry(int processId); Entry findEntry(int processId, Filter filter); </code></pre> <p>where <code>processId</code> refers to some unique identifying information. However I don't really know what the type of <code>processId</code> is yet.</p> <p>How can I abstract away an element like <code>id</code> of something? </p> <p>The best I could come up with is creating a dummy interface:</p> <pre><code>Entry findEntry(ProcessId id); Entry findEntry(ProcessId, Filter filter); </code></pre> <p>However, I worry that with the above approach I may force the client of the API to operate on too high an abstraction level. For example, the equality of process id's will no longer work (whereas if they used int's - it would).</p> <p><em>Clarification</em>: I failed to clarify that I am writing only the interfaces (contracts), to be implemented later, possibly by a different team. That is why I cannot enforce certain things like equals method.</p>
c# java
[0, 1]
3,165,303
3,165,304
Copy with clipboard manager that supports old and new android versions?
<p>I'm trying to copy text programatically on android, the most voted answer on another question provided these lines but when using them I get error: Class requires API level 11 (current min is 8):</p> <pre><code> ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); ClipData clip = ClipData.newPlainText("label", "Text to copy"); clipboard.setPrimaryClip(clip); </code></pre> <p>I copied the lines directly from the question. After trying with <code>import android.content.ClipboardManager;</code> I tested <code>import android.text.ClipboardManager;</code> and but it produced an error too <code>The method setPrimaryClip(ClipData) is undefined for the type ClipboardManager</code> plus warnings about ClipboardManager being deprecated.</p> <p>My app that supports Android 2.2 (API 8 I think) onwards, how can I copy text so it works on all versions of android?</p>
java android
[1, 4]
339,857
339,858
$ prefix for variables with jquery, global namespace
<p>I know this is probably obvious...but what exactly is jQuery doing when I prefix a variable name with '$'. I know this is placing the variable in the global namespace, but why?</p>
javascript jquery
[3, 5]
2,164,733
2,164,734
How to make sure requests are from my website?
<p>Some smartass people are using my api-centric web app to clone my service and make it appear like their own. Is there a way to make sure all ajax requests are for/from my website?</p> <p>Sure I could use the referrer header but they could easily fake it.</p>
javascript jquery
[3, 5]
5,596,274
5,596,275
Unfortunately your <Project name> has stopped working.
<p>i am a really NOOB and new coder. I started learning Java and recently created this application on eclipse. It is a dollar to euros converter. Everytime i try to run the code on eclipse i get error saying the application has stopped working.</p> <pre><code>TextView dollars; TextView euros; RadioButton dtoe; RadioButton etod; Button calculate; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); dollars = (TextView)this.findViewById(R.id.dollars); euros = (TextView)this.findViewById(R.id.euros); dtoe = (RadioButton)this.findViewById(R.id.dtoe); etod = (RadioButton)this.findViewById(R.id.euros); calculate = (Button)this.findViewById(R.id.calculate); calculate.setOnClickListener(this); } public void onClick(View v) { if (dtoe.isChecked()){ convertDollarsToEuros(); } if (etod.isChecked()){ convertEurosToDollars(); } } protected void convertDollarsToEuros(){ double val = Double.parseDouble(dollars.getText().toString()); euros.setText(Double.toString(val*0.67)); } protected void convertEurosToDollars(){ double val = Double.parseDouble(euros.getText().toString()); dollars.setText(Double.toString(val*0.67)); } </code></pre> <p>}</p>
java android
[1, 4]
5,118,637
5,118,638
Inconsistent pseudo random between c++ and c#
<p>I'm attempting to convert a pseudo rand function from c++ to c# but it doesnt seem to return the correct values. Its important that i use a consistent set for encryption so i cant just use a random number.</p> <p>this is the function in c++.</p> <pre><code>int get_pseudo_rand() { return( ((_last_rand = _last_rand * 214013L + 2531011L) &gt;&gt; 16) &amp; 0x7fff ); } </code></pre> <p>and this is my c# alternative</p> <pre><code>int get_pseudo_rand() { return (((_last_rand = (_last_rand * 214013 + 2531011) &gt;&gt; 16) &amp; 0x7fff)); } </code></pre> <p>I removed the Ls since c#s int data type is 4 bytes like c++ longs whereas c#s longs are 8 bytes.</p> <p>the first time the function is run from the seed the answer is consistent with the c++ version but then it begins to diverge.</p> <p>Any ideas?</p>
c# c++
[0, 6]
73,107
73,108
How can you reference code written in another language in the App_Code folder in ASP.Net?
<p>Due to legacy issues I have two folders under App_Code directory. One for VB.Net and another for C#. Problem is, I have a service in the C# folder that needs to leverage a class in the VB.Net folder but they dont seem to know about each other. Any ideas are welcome :)</p> <p>Thanks in advance!</p> <p>Trev</p>
c# asp.net
[0, 9]
85,760
85,761
how to get buttonId was pressed in android
<p>I have a problem with the following piece of code:</p> <pre><code>OnClickListener button_listener = new View.OnClickListener() { @Override public void onClick(View v) { ImageButton ibutton = (ImageButton) v; if(player == 0) { ibutton.setClickable(false); ibutton.setImageResource(R.drawable.crossnew); //Toast.makeText(getApplicationContext(),v.getText(), Toast.LENGTH_SHORT).show(); player = 1; } else if(player == 1) { ibutton.setClickable(false); ibutton.setImageResource(R.drawable.zeronew); player = 0; } } }; </code></pre> <p>how to get buttonId was pressed; help me please</p>
java android
[1, 4]
1,456,728
1,456,729
Does Integer.valueOf() in java translate to int.Parse() in C#?
<p>I am trying to learn java from a C# background! I have found some nuances during my journey like C# doesn't have an Integer as reference type it only has int as a primitive type; this lead me to a doubt if this translation would be correct! </p> <pre><code> String line ="Numeric string";//Java string line = "Numeric string";//C# int size; size = Integer.valueOf(line, 16).intValue(); //In Java size = int.Parse(line,System.Globalization.NumberStyles.Integer);//In C# </code></pre>
c# java
[0, 1]
1,480,003
1,480,004
JQuery each: Pause & Continue iteration after a click
<pre><code>$.getJSON('http://example.com', function(data) { $.each(data.songs, function(index, song) { //Paused &amp; waiting for a click $("#next").click(function() { alert("Processing the next object..."); }); }); </code></pre> <p>I would that JQuery analyze the next object only after the user click on #next element. </p> <p>I don't need a "timeout", just user action to go to the next object</p>
javascript jquery
[3, 5]
3,572,149
3,572,150
jquery/javascript- calculate days on this week given week number and year number
<p>i'm looking for a simple way to calculate the calendar days when given a week and year number using jquery/javascript.</p> <p>Example: Week 18, Year 2012 would result in a list of starting with sunday</p> <pre><code>2012-04-29 2012-04-30 2012-05-01 2012-05-02 2012-05-03 2012-05-04 2012-05-05 </code></pre> <p>thanks</p>
javascript jquery
[3, 5]
3,517,114
3,517,115
php and jquery image selector
<p>I was on flickr and I saw this function whereby you can scroll photos (thumbnail) without loading the page. It's probably using jQuery or json but does anyone know whats the proper name for this kind of function or is there any available libraries? I've uploaded a screenshot..</p> <p><img src="http://i.stack.imgur.com/O6lAh.png" alt="flickr snapshot"></p>
php javascript jquery
[2, 3, 5]
5,865,516
5,865,517
UI goes blank for a second when bringing up Modal Pop Up Extender
<p>I have an asp.net repeater and it has an edit button which brings up a Modal Pop Up extender (MPE) where a user enters modified values and then submits the changes in the MPE. When the MPE appears after the Edit button in the repeater is clicked - the whole page is reloaded - because the screen goes blank for a second and then gets re-populated. Is this the Page_load firing due to the action in the repeater? If so, can I prevent this. Here is the related code:</p> <p>aspx page:</p> <pre><code>&lt;td&gt;&lt;asp:ImageButton runat="server" ID="imgBtEdit" ToolTip="Edit" AlternateText="Edit" CommandName="Edit" CommandArgument='&lt;%#DataBinder.Eval(Container.DataItem,"Id")%&gt;' ImageUrl="~/css/images/icon.png"/&gt;&lt;/td&gt; </code></pre> <p>Code Behind:</p> <pre><code> protected void REPEATER_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "Edit") { MPExtender.Show(); } } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { List&lt;T&gt; lst = GetList(); REPEATER.DataSource = lst; REPEATER.DataBind(); } } </code></pre>
c# asp.net
[0, 9]