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
343,730
343,731
Downloading a file from a PHP page in C#
<p>Okay, we have a PHP script that creates an download link from a file and we want to download that file via C#. This works fine with progress etc but when the PHP page gives an error the program downloads the error page and saves it as the requested file. Here is the code we have atm: </p> <p>PHP Code:</p> <pre><code>&lt;?php $path = 'upload/test.rar'; if (file_exists($path)) { $mm_type="application/octet-stream"; header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: public"); header("Content-Description: File Transfer"); header("Content-Type: " . $mm_type); header("Content-Length: " .(string)(filesize($path)) ); header('Content-Disposition: attachment; filename="'.basename($path).'"'); header("Content-Transfer-Encoding: binary\n"); readfile($path); exit(); } else { print 'Sorry, we could not find requested download file.'; } ?&gt; </code></pre> <p>C# Code:</p> <pre><code>private void btnDownload_Click(object sender, EventArgs e) { string url = "http://***.com/download.php"; WebClient client = new WebClient(); client.DownloadFileCompleted += new AsyncCompletedEventHandler(client_DownloadFileCompleted); client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(ProgressChanged); client.DownloadFileAsync(new Uri(url), @"c:\temp\test.rar"); } private void ProgressChanged(object sender, DownloadProgressChangedEventArgs e) { progressBar.Value = e.ProgressPercentage; } void client_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e) { MessageBox.Show(print); } </code></pre>
c# php
[0, 2]
598,952
598,953
Android: Executing method from specific thread
<p>I'm developing an application in Android. The application can post a HTTP request to specific web server. That post request must run asyncronously, so I create a thread to do the job. But I need a callback that will be called at thread end and it must be called from thread that call the `post` method.</p> <p>My <code>post</code> method looks like this:</p> <pre><code>interface EndCallback { public void Success(String response); public void Fail(Exception e); } public void post(final String url, final List&lt;NameValuePair&gt; data, EndCallback callback) { Thread t = Thread.currentThread(); (new Thread() { public void run() { HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost(url); try { httppost.setEntity(new UrlEncodedFormEntity(data)); HttpResponse r = httpclient.execute(httppost); HttpEntity en = r.getEntity(); String response = EntityUtils.toString(en); //I want to call callback.Success(response) //here from thread t } catch (Exception ex) { //And I want to call callback.Fail(ex) //here from thread t } } }).start(); } </code></pre>
java android
[1, 4]
1,931,041
1,931,042
How to get an object's properties in JavaScript / jQuery?
<p>In JavaScript / jQuery, if I <code>alert</code> some object, I get either <code>[object]</code> or <code>[object Object]</code></p> <p>Is there any way to know:</p> <ol> <li><p>what is the difference between these two objects</p></li> <li><p>what type of Object is this</p></li> <li><p>what all properties does this object contains and values of each property</p></li> </ol> <p>?</p>
javascript jquery
[3, 5]
663,840
663,841
Multiplying a number without using * operator
<p>I was going through a programming class and was asked this tricky question which was left unanswered till the end of the class.</p> <p><strong>Question</strong>: </p> <p>How can I multiply any input(Float,int etc) by 7, <code>without using the</code> <code>*</code> operator in <code>TWO steps</code>. </p> <p>If anyone can give me the answer for this question with the explanation , that would be very helpful.</p> <blockquote> <p><strong>With TWO STEPS I mean suppose you are running a loop (i=0;i&lt;7;i++) in that case number of steps will be >2, also TYPE CONVERSION, DIVISION,ADDITION etc ( Counts for steps ).</strong></p> </blockquote>
java c++
[1, 6]
1,825,146
1,825,147
Cross Language Variables - Implementation
<p>Certain Variables I use acrross Javascript and PHP, for example JSON_ON.</p> <p>I need it set to either 1 on both sides or 0 on both sides...this sets encoding and decoding of structured data.</p> <p>One way I could implment this is to just have PHP open up the .js file and read the variable.</p> <p>Is this done? Are there better ways to implement variables across languages?</p> <p>I only want to have to set the variable in one place, in this case the .js File.</p>
php javascript
[2, 3]
4,593,656
4,593,657
How to load a table on a cell by cell basis
<p>I have a simple table with a link and an image in a div in each cell. the simplified code is like:</p> <pre><code>&lt;td&gt; &lt;a href="#"&gt;&lt;/a&gt; &lt;div&gt; &lt;img src="image01.jpg" /&gt; &lt;/div&gt; &lt;/td&gt; </code></pre> <p>I pull the values for the link and the image from a the database and manually generate the table like:</p> <pre><code>cell = "&lt;td&gt;" + "&lt;a href=\"#\"&gt;&lt;/a&gt;&lt;div&gt;" + "&lt;img src=\"" + imageName + "\" " + "\" alt=\"" + imageName + "\" /&gt;&lt;/div&gt;&lt;/td&gt;"; </code></pre> <p>When the user hovers the images, another image element is displayed to show a bigger version of the hovered image. This is done with javascript.</p> <p>To be able to instantly respond to the hover, I actually load the bigger versions of the images in the table. I resize and crop them (hence the parent divs).</p> <p>Since the table has around 40-100 cells, and the images vary between 180px to 800px width, I decided to load the empty table first, and then refresh the page with each cell content. This way the user will be able to interact with the loaded images, while the rest is still loading.</p> <p>I think it is possible with an ajax loop that fires upon each page load with a counter set to the total number of cells. But I do not know how it can be done.</p> <p>Is there a way to load the content of a cell, display it to the user and go on loadind the next cells?</p> <p>Thank you for your time.</p>
c# asp.net
[0, 9]
1,330,567
1,330,568
How to return a value from inside an interator in Javascript
<p>I have a function that I want to return true or false.</p> <p>Inside the function I iterate through some elements on the page and check their values.</p> <p>But if I put a return statement inside the iterator, it will return from the anonymous function right? (and not the outer function).</p> <pre><code>function someElementHasZeroValue() { $('.some-class').each(function(){ if($(this).html() == '0'){ return true; } }); return false; } </code></pre> <p>So this function always returns false no matter what.</p> <p>What is the best way to do this? The solution below seems to work but it doesn't seem very elegant.</p> <pre><code>function someElementHasZeroValue() { elements_found_with_zero_value = 0; $('.some-class').each(function(){ if($(this).html() == '0'){ elements_found_with_zero_value += 1; } }); if(elements_found_with_zero_value &gt; 0){ return true; }else { return false; } } </code></pre> <p>More generally, does anyone know why Javascript requires you to iterate through elements with an anonymous function as opposed to a normal iterator like most languages, or is there some way to do it I'm not aware of?</p>
javascript jquery
[3, 5]
2,640,357
2,640,358
asp - Cannot find method 'IsNullOrEmpty(String)' in 'String'
<p>Trying to only print if a string isn't empty, and am using the code below, but it keeps coming up with that error... </p> <pre><code>&lt;%if(!String.IsNullOrEmpty(o_handler.renderDesc())) { %&gt; &lt;strong&gt;Description:&lt;/strong&gt;&lt;BR&gt; &lt;HR SIZE="1"&gt; &lt;strong&gt;&lt;%= o_handler.renderDesc()%&gt;&lt;/strong&gt; &lt;HR SIZE="1"&gt; &lt;BR&gt; &lt;%} else { %&gt; &lt;%}%&gt; </code></pre> <p>Also tried this:</p> <pre><code>&lt;%if( o_handler.renderDesc() != null ) { %&gt; &lt;strong&gt;Description:&lt;/strong&gt;&lt;BR&gt; &lt;HR SIZE="1"&gt; &lt;strong&gt;&lt;%= o_handler.renderDesc()%&gt;&lt;/strong&gt; &lt;HR SIZE="1"&gt; &lt;BR&gt; &lt;%} else { %&gt; &lt;%}%&gt; </code></pre> <p>Here's the error:</p> <p><strong>Compiler Error Message: VJS1223: Cannot find method 'IsNullOrEmpty(String)' in 'String'</strong></p>
c# asp.net
[0, 9]
295,945
295,946
How to show Who's online in a user control in masterpage?
<p>I need to get online users of my website and show the online users name in a repeater.</p> <p>The reapeter will be in a usercontrol.</p> <p>How to get online users?</p> <p>Please help.</p>
c# asp.net
[0, 9]
248,558
248,559
How to access created enum in C# from code behind to aspx file
<p>Below is my code behind C# code:</p> <pre><code>namespace Test { public enum en { One, Two } } </code></pre> <p>How can I access this created enum in my aspx file? Like using the enum in this code:</p> <pre><code>&lt;% %&gt; </code></pre> <p>Thanks</p>
c# asp.net
[0, 9]
4,390,836
4,390,837
java android app execute every 10 seconds
<p>I have this code, for a android app i'm working on:</p> <pre><code>package com.exercise.AndroidInternetTxt; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.MalformedURLException; import java.net.URL; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class AndroidInternetTxt extends Activity { TextView textMsg, textPrompt, textSite; final String textSource = "http://www.xxx/s.php"; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); textPrompt = (TextView)findViewById(R.id.textprompt); textMsg = (TextView)findViewById(R.id.textmsg); textSite = (TextView)findViewById(R.id.textsite); //textPrompt.setText("Asteapta..."); URL textUrl; try { textUrl = new URL(textSource); BufferedReader bufferReader = new BufferedReader(new InputStreamReader(textUrl.openStream())); String StringBuffer; String stringText = ""; while ((StringBuffer = bufferReader.readLine()) != null) { stringText += StringBuffer; } bufferReader.close(); textMsg.setText(stringText); } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); textMsg.setText(e.toString()); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); textMsg.setText(e.toString()); } //textPrompt.setText("Terminat!"); } } </code></pre> <p>It works fine, it outputs a text from the .php file. I would like it to autorefresh every 10 seconds, but sincerely i don`t know how to do that. Can you please help me solve this out? Thanks! </p>
java android
[1, 4]
4,366,138
4,366,139
Check if css property has !important attribute applied
<p>If I have a style like this -</p> <pre><code>​div#testdiv {position:absolute;top:10px !important;}​ </code></pre> <p>I can query the <code>top</code> value with jQuery like this -</p> <pre><code>$("#testdiv").css("top"); </code></pre> <p>which will return the value <code>10px</code>. Is it possible to use jQuery or JavaScript to check if the <code>top</code> property has had the <code>!important</code> attribute applied to it?</p>
javascript jquery
[3, 5]
4,136,710
4,136,711
Create opening application
<p>I would like to display an image at the opening of my application Android (Java), is like a toast in full screen only.</p> <p>That is, when you open the application and an image appears and disappears after you start the program.</p> <p>What better way to do this?</p>
java android
[1, 4]
915,727
915,728
A quick question about keypress and jQuery
<p><code>$(document).keydown(function(e) {</code></p> <p>Well, that's my code - I was wondering if it is possible to have something like:</p> <p><code>$(document).not('#pinkElephant').keydown(function(e) {</code></p> <p>(Except, that doesn't work...)</p> <p>Any Ideas?</p> <p>Thanks very much!</p> <p>p.s. All that function has inside it, is a <code>switch</code> statement.</p> <p><strong>[edit]</strong> Hey guys n gals - I cannot <code>return false;</code> because the element I need to type in is an <code>&lt;input&gt;</code> text, so the keyboard still needs to return here. </p> <p>It's really confusing me :(</p>
javascript jquery
[3, 5]
847,190
847,191
Can I use jQuery or javascript to make an <Img> behave like a link without the <a> based on class?
<p>I have a large number of images of the same class "linkImg" and I would like them to behave as links without adding tags.</p> <p>What I'm tryng is something like this:</p> <pre><code>&lt;script type="text/javascript"&gt; $(function() { $('.linkImg').click( function( event ) { var fileSrc = $(this).attr('src'); fileSrc = fileSrc.slice(fileSrc.lastIndexOf('/')+1,-4); // gets the image file name var linkPath = '_img/largeImg/' + fileSrc + '.jpg'; var linkRel = 'relValue'; var linkTarget ='targetValue'; gotothelinl(linkPath, linkRel, linkTarget)// this is just a made-up function - it the part I don't know how to make work }) } ); &lt;/script&gt; </code></pre> <p>When it works it should behave like the tag was there with all attribute intact. I tried using location.href but I can't ad rel or target attributes to that.</p> <p>thx in advance</p> <p>David</p>
javascript jquery
[3, 5]
138,902
138,903
The background color I'm setting in main.xml isn't showing when the app runs
<p>I'm setting a background color in main.xml.</p> <p>When I preview the layout in Eclipse, the background color shows up correctly, but when the app runs on my device, the background color is default black. It seems none of my changes in main.xml are reflected when the app runs.</p> <p>Here is my main.xml file</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;ListView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/lst" android:layout_width="match_parent" android:background="@color/listViewBG" android:divider="@drawable/divider" /&gt; </code></pre> <p>Here is the OnCreate in the main activity</p> <pre><code>public class AleWorldActivity extends ListActivity { String classes[] = { "Movies", "Pictures" }; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setListAdapter(new ArrayAdapter&lt;String&gt;(AleWorldActivity.this, android.R.layout.simple_list_item_1, classes)); } </code></pre> <p>Any ideas? Thanks</p> <p>Here is my strings.xml</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;resources&gt; &lt;string name="hello"&gt;Hello World, AleWorldActivity!&lt;/string&gt; &lt;string name="app_name"&gt;Ale World&lt;/string&gt; &lt;color name="listViewBG"&gt;#e101f5&lt;/color&gt; &lt;/resources&gt; </code></pre> <p>Kevin</p>
java android
[1, 4]
72,898
72,899
how to access asp.net checkbox control in repeater for update panel trigger?
<p>I am using an update panel. There are lots of checkbox in repeater and I want to use an update panel trigger but I can't access the checkbox control. How can I access it?</p> <pre><code>&lt;asp:UpdatePanel ID="up" runat="server"&gt; &lt;ContentTemplate&gt; &lt;/ContentTemplate&gt; &lt;Triggers&gt; &lt;asp:AsyncPostBackTrigger ControlID="checkbox1" EventName= "CheckedChanged" /&gt; &lt;/Triggers&gt; &lt;/asp:UpdatePanel&gt; </code></pre>
c# asp.net
[0, 9]
4,273,249
4,273,250
Weird issue on IE (IE9 and lower) with JavaScript (jQuery)
<p>I am experiencing a weird problem on IE (IE 9 and lower).</p> <p>I have a form having a select and a radio. When anyone changes anything in the select or radio, it calculates the total price.</p> <p>Here is the code: <a href="http://jsfiddle.net/Debiprasad/DLQ82/8/" rel="nofollow">http://jsfiddle.net/Debiprasad/DLQ82/8/</a></p> <p>It works fine in all browsers. But when I am testing this on IE: When I am changing the select value, then it works fine. But when I am changing the value radio, then it does not work.</p> <p>The weird part is, if I added an alert to any of the functions, which executed when the value of radio changes, then it works fine on IE. What could be the problem and how to fix this?</p>
javascript jquery
[3, 5]
2,090,624
2,090,625
How to declare an custom object's instance into array in javascript or jQuery?
<p>I have some declare syntax problem here:</p> <p>Say I have two object, one is call List and another is called Car. They have following interface:</p> <pre><code>function List() { .....some variables //bug point this.car = new Car(); } function Car() { this.make=""; this.year=""; ... } </code></pre> <p>I hope to put a ARRAY of Car objects inside the List object. Now I know I could declare array by using</p> <pre><code>var arr = new Array(); </code></pre> <p>But that way I will have no chance to make this array a array of Car.</p> <p>In otherwise, if I declare as this.car = new Car</p> <p>Than I have no chance to make it an array....</p> <p>I think I must be missed something. But I just can't get to it. Please help!</p> <p>Thank you!</p>
javascript jquery
[3, 5]
829,782
829,783
asp.net,c#.net Read Only Field
<p>I have a textbox.Texbox is readonly. And on Page_Load the Texbox automaticlly displayed with a value from the data base.i have a 'if' loop for check the text box value is null or not.But i cant retrive the textbox value.What may be the reason for that? my web page code is</p> <pre><code>&lt;asp:TextBox ID = "text1" runat="server" ReadOnly="true" &gt;&lt;/asp:TextBox&gt; &lt;asp:DropDownList ID="DropDownList1" runat="server" Visible="False"&gt; &lt;/asp:DropDownList&gt;` </code></pre> <p>code behind</p> <pre><code>if (text1.Text == "") { DropDownList1.Visible = true; } </code></pre> <p>but DropDownList1 is not displayed</p>
c# asp.net
[0, 9]
839,127
839,128
Convert string "04/09/2013" MM/DD/YYY to Date Format in JavaScript
<p>I want to convert "04/09/2013" to date so I can compare start date and end date like, if (stardate &lt; enddate) { //do this } else {}. I want to convert it to MM/DD/YYYY format.</p>
javascript jquery
[3, 5]
2,720,033
2,720,034
bind dropdownlist according to the header of the gridview
<p>I have a dropdownlist and the gridview and I want to bind the dropdownlist according to the header of the grid view</p> <p>eg.</p> <p>If I have a grid view header like</p> <pre><code> A B C D edit delete </code></pre> <p>Then the dropdown should have values like </p> <pre><code>A B C D </code></pre>
c# asp.net
[0, 9]
5,769,565
5,769,566
An Image inside a dynamically created div tags
<p>What is required is to dynamically create six div tags using Javascript, that will resize with the width of the window( either computer, iphone,ipad, Blackberry etc). that task has been succesfully achieved. The next task is to place an image in each of the created div tag, <strong>Remember the divs are created dynamically and the image has to be clickable.</strong> I have a folder containing the images. </p> <p><strong>Please help am new at this</strong>.</p> <p>*<em>Note:The Images should resize as the divs resizes</em> Here is the code for the dynamically created div tags. Please In details illustrate how best can i achieve this.</p> <pre><code>function DynamicDiv() { for( var i = 0; i &lt;= 5; i++){ var dynDiv = document.createElement("div"); dynDiv.className = "blocks"; document.body.appendChild(dynDiv); } } </code></pre>
c# javascript
[0, 3]
4,711,534
4,711,535
jQuery: how to select every cell in a table except the last in each row?
<p>I want every cell in each row except the last in each row. I tried:</p> <pre><code>$("table tr td:not(:last)") </code></pre> <p>but that seems to have given me every cell except the very last in the table. Not quite what I want.</p> <p>I'm sure this is simple but I'm still wrapping my head around the selectors.</p>
javascript jquery
[3, 5]
1,705,406
1,705,407
How do I get my Android Application to have this part of the user interface?
<p>I want to add this to my user interface, i'm new to Android, so please be kind with the terminology :): <img src="http://i.stack.imgur.com/mPG7X.png" alt="enter image description here"></p> <p>How do I make sections for the "SearchBox" and the "Btns"?</p> <p>Thank you.</p>
java android
[1, 4]
581,680
581,681
ASP.NET Call Another Element's DoPostBack Function
<p>I have an ASP.NET control that has an onclick event handler rendered inline on the element. I would like to call that function and have it raise the target control's server side event handler.</p> <pre><code>&lt;asp:CheckBox ID="Foo" runat="server" AutoPostBack="true" Text="Foo" /&gt; &lt;a href="#" onclick="javascript:setTimeout('__doPostBack(\'Foo\',\'\')', 0)"&gt;Test &lt;/a&gt; </code></pre> <p>I created the checkbox, looked at the rendered function on the field, and then copied that into the onclick on the anchor element.</p> <p>The anchor will raise a postback, but the event handler for the check box is not raised.</p> <pre><code>protected override void OnLoad(EventArgs e) { // fires for checkbox // fires for anchor (the anchor does cause a postback) } void Foo_CheckedChanged(object sender, EventArgs e) { // fires for checkbox // does not fire for anchor } protected override void OnInit(EventArgs e) { this.Foo.CheckedChanged += new EventHandler(Foo_CheckedChanged); } </code></pre> <p>Is it possible to do this?</p>
asp.net javascript
[9, 3]
379,493
379,494
how do i stop a form submit with jQuery
<p>I have this form <a href="http://posnation.com/shop_pos/" rel="nofollow">here</a> and i dont want them to go to the next page without certain selections</p> <pre><code>&lt;form method="post" action="step2/" id="form1"&gt; .... .... .... &lt;input type="submit" class="submit notext" value="Next" /&gt; </code></pre> <p>and here is my jquery</p> <pre><code>$('.submit').click(function(e) { var business = $(".business_type_select").find('.container strong').text(); alert(business); if(business == "Select Business Type"){ alert("BusinessBusinessBusiness"); e.preventDefault; return false; } }); </code></pre> <p>any ideas what i am missing to get this to stop submitting</p>
javascript jquery
[3, 5]
2,799,799
2,799,800
Dropdownmenu SELECTED value as per value return fromDB
<p>All i am trying to do is to set the selected value of drop down menu according to the particular value returned from the database</p> <p>like if person saved his gender as 'Male' and he wants to update his profile then the selected option shown on the Gender's dropdown llist should be shown as Male cause if this doesn't happen 'Poor guy becomes a female due to this small problem in my code' KINDLY HELP!!!!!!!</p> <p>MY Current Code:</p> <pre><code>&lt;select name="Gender" id="Gender"&gt; &lt;option selected="selected"&gt;&lt;?php echo $row_Recordset1['Gender']; ?&gt;&lt;/option&gt; &lt;option value="Male"&gt;Male&lt;/option&gt; &lt;option value="Female"&gt;Female&lt;/option&gt; &lt;/select&gt; </code></pre> <p>The above code work fine but causes repitition of values in dropdown like Male Male Female</p>
php javascript
[2, 3]
3,507,351
3,507,352
Call a function on DOM ready from outside <head>?
<p>In jQuery you can wrap all your code in <code>$(function() { ... });</code> and have it fire when the DOM is ready, but what if you want to put that in the middle of the page somewhere? Isn't it possible that the DOM ready event will fire before it processes that chunk of code and it'll get missed? Is there a way to guarantee it'll get fired?</p>
javascript jquery
[3, 5]
5,692,738
5,692,739
How do I do os.getpid() in C++?
<p>newb here. I am trying to make a c++ program that will read from a named pipe created by python. My problem is, the named pipe created by python uses os.getpid() as part of the pipe name. when i try calling the pipe from c++, i use getpid(). i am not getting the same value from c++. is there a method equivalent in c++ for os.getpid?</p> <p>thanks!</p> <p>edit:</p> <p>sorry, i am actually using os.getpid() to get the session id via ProcessIDtoSessionID(). i then use the session id as part of the pipe name</p>
c++ python
[6, 7]
4,518,919
4,518,920
Get class input with closest
<p>I want to get class <code>.mGMZs</code> in input <code>name=age</code> with <code>.closest</code>, I try it in following demo but i doesn't work as expected, how can I fix it?</p> <pre><code>&lt;div class="age"&gt; &lt;div class="column"&gt; &lt;input name="age[0][]" class="mGMZs" placeholder="Age(Geting class this)"&gt; &lt;div class="p_age"&gt; &lt;/div&gt; &lt;/div&gt; &lt;br /&gt; &lt;button&gt;Click Me&lt;/button&gt; &lt;/div&gt; $('button').live('click', function () { var class_age = '.' + $(this).closest('div.age').find('input[name="age"]').prop('name'); alert(class_age); }) </code></pre>
javascript jquery
[3, 5]
2,955,895
2,955,896
How to get the values of a cell from a datagridview by using hyperlinks? in c# using asp.net
<p>I am new to asp.net. I need to use a datagridview with hyperlinks for the frist column. when clicked on any of the cell in that first column, details of the entire row should be available in the textboxes.</p> <p>Thanks in advance :)</p> <p>The Html code for the gridview is</p> <p> <pre><code> onselectedindexchanged="DataGV1_SelectedIndexChanged"&gt; &lt;Columns&gt; &lt;asp:HyperLinkField DataTextField="first_name" HeaderText="first_name" InsertVisible="False" NavigateUrl="~/Default.aspx" SortExpression="first_name" /&gt; &lt;asp:BoundField DataField="role" HeaderText="role" SortExpression="role" /&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt; </code></pre> <p>the code behind</p> <pre><code> protected void Page_Load(object sender, EventArgs e) { for (int i = 0; i &lt; DataGV1.Rows.Count; i++) { if (DataGV1.SelectedIndex == i) { String name = DataGV1.Rows[i].Cells[1].Text; txtName.Text = name; } } } protected void DataGV1_SelectedIndexChanged(object sender, EventArgs e) { DataGrid d = new DataGrid(); //this would work if AutoGenerateSelectButton is true. txtName.Text=DataGV1.SelectedRow.Cells[0].Controls[0].ToString(); //txtName.Text = DataGV1.SelectedRow.Cells[0].Text; } </code></pre> <p>I'm not able to figure out as to what to when a hyperlink is used.</p>
c# asp.net
[0, 9]
4,325,856
4,325,857
Using jquery, what is the simplest function to post some json data and process a returned json response?
<p>When users click on an element in my webpage, I would like to call a javascript function that reads the values of a few text boxes on the page, wraps their contents as json where the keys are the ids for the text boxes and the values are the contents of each text box, and then posts the resulting json to a url. </p> <p>I would then like the same function to expect back a json response and call another javascript function with the returned json data. </p> <p>Question: What is the best way to write the javascript function to create a json structure from html elements, post the json with jquery, and call another javascript function with the resulting json response from the server? </p>
javascript jquery
[3, 5]
5,949,117
5,949,118
How to use Spinner to Save selection to shared preference
<p>I have a spinner view called <code>Spinner_Gender</code>, I made array, array adapter and made <code>onItemSelectedListener</code>. I want to save the selected item position which is integer to shared preference, I tried using a string with Editor and putInt, it saved well. But when reloading the saved data to the spinner using <code>.setSelection</code> it gives an error because it wants an integer not string. Also while trying Integer in sharedpreference I can't save the selected item position to it because the putInt needs only a string to put int in.</p> <p>Sorry for long question but I searched a lot and can't find answer. Two more questions please: what is the integer name for spinner <code>selectedItemPosition</code>? How can I store it to <code>sharedpreference</code>?</p> <p>Code:</p> <pre><code>final Spinner spinner = (Spinner) findViewById(R.id.Spinner_Gender); spinner.setAdapter(adapter); spinner.setOnItemSelectedListener( new AdapterView.OnItemSelectedListener() { public void onItemSelected(AdapterView&lt;?&gt; parent, View itemSelected, final int selectedItemPosition, long selectedId) { int selectedPosition = spinner.getSelectedItemPosition(); Editor editor = mGameSettings.edit(); editor.putInt(myNum,selectedPosition); editor.commit(); } } </code></pre>
java android
[1, 4]
4,892,470
4,892,471
ASP.NET drop down list filtered by JavaScript + button postback error
<p>I have an asp.net drop down list that has a number of items, users are allowed to type some text into an asp.net textbox and javascript will filter the data in the drop down list. This all works perfectly until the user enters text that matches no item. When this occurs I create a new option in javascript with "no XXX found" with a value of "0". The user the clicks an asp.net button and the page errors.</p> <p>The error message i'm getting is:</p> <blockquote> <p>Invalid postback or callback argument. Event validation is enabled using <code>&lt;pages enableEventValidation="true"/&gt;</code> in configuration or <code>&lt;%@ Page EnableEventValidation="true" %&gt;</code> 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 <code>ClientScriptManager.RegisterForEventValidation</code> method in order to register the postback or callback data for validation.</p> </blockquote> <p>Setting this to true does nothing, and I can't figure out why the page would fall over on the postback.</p> <p>Any ideas?</p>
asp.net javascript
[9, 3]
4,329,172
4,329,173
Help me with my selector, the ID is dynamically changing every page load
<p>I want to scan a website using jQuery, but the ID is constantly changing, but there's a permanent pattern for the ID that I'm searching for:</p> <pre><code>app7019261521_the_coinb4678bc2 app7019261521_the_coind42fgr23 app7019261521_the_coing0992gvb app7019261521_the_coin12e5d0aa </code></pre> <p>The IDs always starts with app7019261521_the_coin</p> <p>But my problem is I don't know how to put that in jQuery selector.</p> <pre><code>$("#app7019261521_the_coin") </code></pre> <p>Doesn't seem to work</p> <p>So how can I make this work?</p>
javascript jquery
[3, 5]
3,256,427
3,256,428
JQuery $(document).ready() and document.write()
<p>Firstly, is there a way to use document.write() inside of JQuery's $(document).ready() method? If there is, please clue me in because that will resolve my issue.</p> <p>Otherwise, I have someone's code that I'm supposed to make work with mine. The catch is that I am not allowed to alter his code in any way. The part that doesn't work looks something like this:</p> <pre><code>document.write('&lt;script src=\"http://myurl.com/page.aspx?id=1\"&gt;&lt;/script&gt;'); </code></pre> <p>The script tag is referencing an aspx page that does a series of tests and then spits out something like so:</p> <pre><code>document.write('&lt;img src=\"/image/1.jpg\" alt=\"Second image for id 1\"&gt;') </code></pre> <p>The scripts are just examples of what is actually going on. The problem here is that I've got a document.write() in the initial script and a document.write() in the script that get's appended to the first script and I've got to somehow make this work within JQuery's $(document).ready() function, without changing his code.</p> <p>I have no idea what to do. Help?</p>
javascript jquery
[3, 5]
3,083,850
3,083,851
How do you add the values from input fields and update another field with the result in jQuery?
<p>Preamble: I'm more of a PHP/MySQL guy, just starting to dabble in javascript/jQuery, so please excuse this dumb newbie question. Couldn't figure it out from the Docs.</p> <p>I have a form without a submit button. The goal is to allow the user to input values into several form fields and use jQuery to total them up on the bottom in a div. The form kinda looks like this but prettier:</p> <pre><code>&lt;form&gt; Enter Value: &lt;input class="addme" type="text" name="field1" size="1"&gt; Enter Value: &lt;input class="addme" type="text" name="field2" size="1"&gt; Enter Value: &lt;input class="addme" type="text" name="field3" size="1"&gt; etc..... &lt;div&gt;Result:&lt;span id="result"&gt;&lt;/span&gt;&lt;/div&gt; &lt;/form&gt; </code></pre> <p>Is it possible to add these up? And if so, can it be done anytime one of the input fields changes?</p> <p>Thanks.</p> <p><strong>UPDATE:</strong> Brian posted a cool collaborative sandbox so I edited the code to look more like what I have and it's here: <a href="http://jsbin.com/orequ/" rel="nofollow">http://jsbin.com/orequ/</a> to edit go here: <a href="http://jsbin.com/orequ/edit" rel="nofollow">http://jsbin.com/orequ/edit</a></p>
javascript jquery
[3, 5]
5,548,321
5,548,322
Button On Click event not firing
<p>the on click event works in other pages though.</p> <p>here's the header of the page i'm trying to get it to work:</p> <pre><code>&lt;%@ Page Title="Report" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Report.aspx.cs" Inherits="Report" %&gt; &lt;%@ PreviousPageType VirtualPath="~/Default.aspx"&gt; </code></pre> <p>and the code behind:</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { if (PreviousPage == null) { Response.Redirect("~/Default.aspx"); } // code.. </code></pre> <p>when i click on it, it just redirects me to the PreviousPage. it also doesn't stop even when it has a breakpoint inside.</p> <pre><code>protected void export_Click(object sender, EventArgs e) { //code } </code></pre>
c# asp.net
[0, 9]
5,871,078
5,871,079
Can't create the sum of two values (2+2 isn*t 4 but 22)?
<p>sorry if this is a noob question, but well, I'm a noob. I want to get the sum of the values of several text field into another text field. My code looks like this:</p> <pre><code>$('.button').mouseup(function() { var sum = $("#field1").val()+$("#field2").val(); $("#result").val(sum); }); </code></pre> <p>When I click the button the sum of 3+3 isn't 6 but 33. It just adds all numbers to the textfield. If I change the "+" into a "*" it works, 3*3 is 9. Could somebody please tell me what I do wrong. Thank you.</p>
javascript jquery
[3, 5]
4,647,335
4,647,336
C++ and java frameworks for augmented reality
<p>anyone could help me about this one? I think it would be nice to be my thesis on my next year of college. I would like to develop a desktop application not a mobile application. I want to develop it in a linux platform. </p>
java c++
[1, 6]
5,722,111
5,722,112
is there any convert reference between java (for android) and C#?
<p>is there any convert reference between java (for android) and C# ?</p> <p>for example: </p> <p>in C#: <code>messagebox.show(sum.tostring());</code> ==> in java ???</p> <p>thanks in advance</p>
c# android
[0, 4]
373,056
373,057
jRecorder not working above 50 seconds
<p>any of you know why jRecorder does not work above 50 seconds. the file uploaded to server is 0KB. if the recording is shorter, it works perfectly.</p> <p>Thanks in advance. </p>
php javascript jquery
[2, 3, 5]
2,812,463
2,812,464
android: creating a textfield display on the same activity with a ListActivity
<p>I have an activity that pulls a String Array from xml and displays a ListActivity (the class extends ListActivity) and I'd like to know if it is possible to also display a textfield or textView below the list?</p> <p>If so, what method should I research to do this? Have code samples?</p> <p>Thanks!</p> <p>CODE:</p> <pre><code>public class txchl extends ListActivity { /** Called when the activity is first created. */ public void onCreate(Bundle icicle) { super.onCreate(icicle); //setContentView(R.layout.main); String[] rmenu = getResources().getStringArray(R.array.root_menu); if (rmenu != null) { setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, rmenu)); } TextView tv = new TextView(this); tv.setText("Hello"); setContentView(tv); } @Override protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); // if (position == 4 || position == 5) { Intent myIntent = new Intent(v.getContext(), Activity2.class); myIntent.putExtra("com.activity.Key", position); startActivity(myIntent); } else { Intent myIntent = new Intent(v.getContext(), txchl_hb.class); myIntent.putExtra("com.activity.Key", position); //myIntent.putExtra("com.activity.Dir", directives[position]); startActivity(myIntent); } } </code></pre> <p>}</p>
java android
[1, 4]
1,284,424
1,284,425
Android multitasking problem
<p>I have an android application which main view consists of a tab-bar with three tabs in it.</p> <p>When developing and running the application on the device through adb I get the following behavior:</p> <ul> <li>When clicking the phone button "Home screen" and relaunching the application it seems as the application continues where I was before pressing the button (remembers selected tab etc...) (apparently its still running in the background).</li> </ul> <p>However when I export and sign the application (using Eclipse) it suddenly always seem to start a new instance of the application when returning from home screen.</p> <p>Why does it behave so different in those cases? And what do I need to do in my application in order to always have the "running in background" behavior.</p>
java android
[1, 4]
2,813,925
2,813,926
android : How to know about a new process start in device?
<p>I am writing a program which respond when a new process got start.</p> <pre><code>private final BroadcastReceiver mBatInfoReceiver = new BroadcastReceiver() { @Override public void onReceive(Context arg0, Intent intent) { // what to write here } }; </code></pre> <p>I do not know that what to write instead of comments to get processes info.</p> <p>thanks.</p>
java android
[1, 4]
1,899,416
1,899,417
How to pass msg_id into jquery modal form?
<p>I have a following data where I am showing data from database. When i click Comment a dialog appear, there i need to show data in modal from db. but for getting data from db i need msg_id in modal form.</p> <pre><code>&lt;?php $msg_id = $data['message_id']; ?&gt; &lt;a data-toggle="modal" href="msg_id=&lt;?php echo $msg_id; ?&gt;#example" class="link_comment"&gt;Comment&lt;/a&gt; </code></pre> <p>So here I want to pass msg_id to jquery modal form, where i can get data from db on the base of msg_id for that specific message and show it in modal box.</p> <pre><code>&lt;div id="example" class="modal" style="display: none; "&gt; Your Message id : &lt;?php echo $msg_id; ?&gt; &lt;/div&gt; </code></pre> <p>So how can I pass $msg_id into jquery modal form.</p>
php jquery
[2, 5]
4,063,202
4,063,203
Should I filter a Html index with Javascript or do it Server side?
<p>I have an index of titles that I am currently filtering by user entered keywords on the server before sending to HTML. I am wondering if it would be better to send the entire index to the page and have javascript show or hide the items in the list based on the user input. </p> <p>I am concerned that the server side is going to get too many requests as users use different keyword combinations. Even if I cache the index on the server, wont the javascript solution be a better one?</p> <p>EDIT: assuming a list of thousand titles or more.</p>
asp.net javascript
[9, 3]
4,752,499
4,752,500
dynamically add another item using jquery?
<p>I have item <code>&lt;ie:menuitem</code> on the page with <code>id=zz15_Upload</code>. I want add another <code>&lt;ie:menuitem</code> after <code>&lt;/ie:menuitem&gt;</code> tag and but change (add) on <code>onMenuClick="window.location = 'Allsame add extra at end of the string &amp;amp;MultipleUpload=1';"</code> </p> <p>I want to do this with jQuery. Please help on this.</p> <p><strong>Code:</strong></p> <pre><code> &lt;ie:menuitem id="zz15_Upload" type="option" iconSrc="/_layouts/images/MenuUploadDocument.gif" onMenuClick="window.location = '/CR/ttt/_layouts/Upload.aspx? List=%7BF6047376%2D0318%2D4A50%2DA290%2D7EAF74A23C4E%7D&amp;amp;RootFolder=%2FCR%2Fttt%2FShared%20Documents&amp;amp;Source=http%3A%2F%2Ftestqa%2Este%2Eorg%2FCR%2Fttt%2FShared%20Documents%2FForms%2FAllItems%2Easpx';" text="Upload Document" description="Upload a document from your computer to this library." menuGroupId="2147483647"&gt;&lt;/ie:menuitem&gt; </code></pre>
jquery asp.net
[5, 9]
3,925,955
3,925,956
Calling onserverclick from input type:file fails in Internet Explorer
<p>below are the code in my aspx files, i am trying to call onserverclick of hdnBtn from hdnBtn.click()</p> <p>the code belows work in Firefox and Chrome but not working in IE, any idea why? thx for helping</p> <pre><code> protected void Page_Load(object sender, EventArgs e) { btnBrowse.Attributes.Add("onclick", file1.ClientID + ".click()"); file1.Attributes.Add("onchange", hdnBtn.ClientID + ".click()"); } input runat="server" id="btnBrowse" type="button" value="..." class="lookupBtn" disabled=true input style="visibility:hidden" type="file" runat="server" name="file1" id="file1" input style="visibility:hidden" type="button" runat="server" name="hdnBtn" id="hdnBtn" value="" onserverclick="btnLookUpFile_Click" </code></pre>
c# asp.net
[0, 9]
2,263,175
2,263,176
How do I send url parameters via GET method to PHP with JavaScript?
<p>Here's my JS code... </p> <pre><code>function da(){ var a=document.forms["user"]["age"].value; if(this.age.value &lt; 18 || this.age.value &gt; 85) { alert('some text...'); this.age.focus(); return false; }else{ window.location.href='file.php?&amp;'+a; } } </code></pre> <p>It simply passes the parameters to the page where I'm standing... Here's the form just in case (I'm a beginner keep in mind)...</p> <pre><code>&lt;form name="buscar" method="GET"&gt; Some text &lt;input onmouseover="Aj2('d');document.getElementById('box').style.display='block';" onmouseout="clean();" type="number" name="age" id="age" &gt; Age &lt;div id="help" &gt;&lt;!-- --&gt; &lt;/div&gt;&lt;br /&gt; &lt;input type="button" value="Send" onclick="da()"&gt; &lt;/form&gt; </code></pre> <p>The Aj2 function is not the problem here... Thanks for any help y might get...</p>
php javascript
[2, 3]
5,834,638
5,834,639
anr broadcast of intent. What is my mistake?
<p>anr broadcast of intent { act=android.provider.Telefony.SMS_RECEIVED cmp=com.site/.SmsReceived {has extras}} in}}</p> <p>What is my mistake?</p> <p>Shows the error when it comes to SMS. BroadcastReceiver: connects to sqllite and search number is the same sender SMS.</p>
java android
[1, 4]
1,236,793
1,236,794
jqGrid celledit under certain conditions
<p>I want the cells to be in edit mode when a certain condition is true. I'm using cellEdit true and editable in the column but in some occasions the user shouldn't be able to edit some cells of the same column even though the column is editable=true. I need to use cell editing not inline editing.</p> <p>Any thoughts?</p> <p>Thanks</p>
javascript jquery
[3, 5]
5,227,136
5,227,137
How do I increase the height of drag and drop area in wdCalendar(JQuery Event Calendar Plugin)
<p>Anybody familiar with <strong>wdCalendar</strong> ,a google look a like event calendar plugin in jquery . I got this from <a href="http://www.web-delicious.com/jquery-plugins/" rel="nofollow">http://www.web-delicious.com/jquery-plugins/</a>. I need to increase the drag and drop area of wdcaledar. I installed fresh copy from there site .it works well .But When I installed it to my site ,mine have a header portion ,that takes 200px height ,then the draggabble area misplaced .So I cannot drag events to bottom area. I've checked so many times in the code ,but couldn't find a good solution . Any explanation? Thanks!</p>
php jquery
[2, 5]
546,005
546,006
Alternative to offsetLeft and offsetTop?
<p>I wrote a little canvas application and finally tried to incorporate it into my blog, however now I find that on a mouse click offsetLeft and offsetRight are always 0.</p> <p>I don't really know why, but how do I get that info back?</p> <p>In case anyone is not seeing the tags on this post: yes I am using jQuery for mouse events.</p> <pre><code>$('#'+canvasId).mousedown(function(e){ that.mouse.down = true; that.mouse.downx = e.pageX-this.offsetLeft; that.mouse.downy = e.pageY-this.offsetTop; that.mouse.dialogDown = k.operations.interface.getHudItem(that.mouse.downx, that.mouse.downy); k.operations.interface.mouseDown(that.mouse.downx, that.mouse.downy); }); </code></pre>
javascript jquery
[3, 5]
3,500,909
3,500,910
Array notation or .method() - which is faster?
<p>I came across the array notation in JavaScript, and I wondered which way would be faster or better to write. I think the second version is harder to read, but are there any benefits of it ? Or does somebody use this way of calling the methods? Or is there no difference between those regarding their speed?</p> <ul> <li><p><code>$('#myContainer')['addClass']("active");</code> </p></li> <li><p><code>$('#myContainer').addClass("active");</code></p></li> </ul> <p>I am used to doing it the second way, but is the first way faster or are there any other benefits of using the first version?</p>
javascript jquery
[3, 5]
4,287,139
4,287,140
Adding a link using JQuery html() is not click-able on IE6
<p>I add html to a page using JQuery's html() function. This works great on most browsers except IE6.</p> <p>I can work round this by adding a click event etc but I want to fix the issue without extra tape!</p> <p>Any ideas why this doesn't work on IE6?</p> <pre><code>$('#button_holder').html('&lt;a href="#" onclick="run_activity_upload(); return false;" id="save_button"&gt;Upload&lt;/a&gt;'); </code></pre> <p>Thanks, Abs</p>
javascript jquery
[3, 5]
3,252,715
3,252,716
Get a file given a path to the file
<p>I want to get a file which i saved in a specific directory on my phone. How can I find and get a ref to it so I can do with it something different like uploading to a server?</p> <p>Thanks in advance.</p> <p>Shiran</p>
java android
[1, 4]
5,232,775
5,232,776
How can i add two double values without exponential in android
<p>Please help me to solve this. I trying to get value from textview and stored as string. Then it converts to double. While converting up to 7 characters functioning normally but if i try to add more than 7 result is 1.23456789E8. Here is my code</p> <pre><code>String value = tvInput.getText().toString(); \\tvInput is my textView Double result = 0.0; Double input1=0.0; Double input2=0.0; input=Double.parseDouble(value); result = input1 + input2; tvInput.setText(Double.toString(result)); </code></pre> <p>if i give input1 value as 1234567 and input2 as 1234567 i am getting correct result but if give input1 as 12345678 and input2 as 3. the output is 1.2345681E7</p>
java android
[1, 4]
5,879,460
5,879,461
How do i remotely force membership users to logout asp.net?
<p>I would like to let the members of the Administrators role force any user to logout without interaction.</p> <p>Let us say, I would like to get a list of all online users in a gridView, then by selecting one of the users, the user will be logged out.</p> <p>What do I write in the selection button click in order to logout the selected user?</p>
c# asp.net
[0, 9]
4,315,882
4,315,883
provide software as a service just like google docs
<p>I want to view file on my client machine through web browser which is uploaded on server...without client having that file and software to open it...in short to give software as a serrvice to my clients just like google docs.I have done uploading of file to server..not getting further part of viewing my file on browser...My code is done in asp.net c# with visual studio 2008.</p>
c# asp.net
[0, 9]
505,639
505,640
jQuery Validation on check box click disable TextBox?
<p>Hi I am trying to get this JavaScript work for me.</p> <p>Can any one help me with this.</p> <p>When user clicks the Check box the next text box should disable, if unchecked then enable.</p> <p>selectors are working fine when I debug scrip in IE9 developer tool.</p> <p>function is running fine as needed.</p> <pre><code>&lt;input id="RefillNeeded10" name="RefillasNeeded" type="checkbox" value="true"&gt; &lt;input type="text" size="5" id="RefillTB10," name="Refills"&gt; </code></pre> <hr /> <pre><code>$('input[type="checkbox"][name^="RefillasNeeded"]').click(function () { var num = $(this).attr('id').replace("RefillNeeded", ""); if ($('input[type="checkbox"][id="RefillNeeded' + num + '"]').attr("checked")) { $('input[type="text"][id="RefillTB' + num + '"]').attr("disabled", true); } else { $('input[type="text"][id="RefillTB' + num + '"]').attr("disabled", false); } }); </code></pre> <p>but <code>$('input[type="text"][id="RefillTB' + num + '"]').attr("disabled", true);</code> this is not creating the attribute disable.</p> <p>I have this listed <a href="http://jsfiddle.net/habo/KJVCa/1/" rel="nofollow">here</a> for convenience.</p>
javascript jquery
[3, 5]
5,003,277
5,003,278
What is the java equivalent to javascript's String.fromCharCode?
<p>What it the java equivalent of javascript's:</p> <pre><code>String.fromCharCode(n1, n2, ..., nX) </code></pre> <p><a href="http://www.w3schools.com/jsref/jsref_fromCharCode.asp" rel="nofollow">http://www.w3schools.com/jsref/jsref_fromCharCode.asp</a></p>
java javascript
[1, 3]
4,527,636
4,527,637
ajax "busy" indicator but only for longer requests
<p>Is it possible to specify time after which I can show busy indicator?</p> <p>My code for busy indicator is quite simple:</p> <pre><code>jQuery.ajaxSetup( { beforeSend:function () { jQuery( "#busy-indicator" ).show(); }, complete:function () { jQuery( "#busy-indicator" ).hide(); } } ); </code></pre> <p>But often Ajax request is faster then appearing indicator, therefore I'd like to show it for request which take lets say at least 1 second, is it possible? Or Do you have idea how to do it?</p>
javascript jquery
[3, 5]
4,141,907
4,141,908
Ignoring overflow:hidden elements in jQuery
<p>I'm using jQuery to calculate highlight masks for DOM elements for a webapp with in-page editing. Since elements can change dimensions, the mask is calculated dynamically on hover.</p> <p>One of the elements is an image scroller, so has an overflow:hidden with images inside an extra wide div. The problem i'm having is getting jQuery to ignore elements with overflow:hidden in its width/height calculations.</p> <p>In short: is there a jQuery selector to ignore DOM nodes hidden by overflow?</p>
javascript jquery
[3, 5]
458,840
458,841
Similar to Pass in Python for C#
<p>In python we can .. </p> <pre><code>a = 5 if a == 5: pass #Do Nothing else: print "Hello World" </code></pre> <p>I wonder if it a similar way to do this in C#</p>
c# python
[0, 7]
3,780,825
3,780,826
Save a MotionEvent for latter processing
<p>I'm starting with a 2D game.</p> <p>I followed the hints of the book "Beginning Android 4 Games Development", there the autor process each MotionEvent,transform the touch from the screen coordinates to the game coordinates, create its own "TouchEvent" and store it in a pool for being processed with the next UI refresh.</p> <p>The problem is that then I can't use the TouchEvent with an GestureDetector for example. So I'm considering o rewrite that part and make something like.</p> <pre><code>public boolean onTouch(View v, MotionEvent event) { MotionEvent gameEvent= MotionEvent.obtain(event); int x=tranformToGameCoords(event.getX()); int y=tranformToGameCoords(event.getY()); gameEvent.setLocation(x, y); addToBuffer(gameEvent); return true; } </code></pre> <p>And then for consuming the events:</p> <pre><code>while((event=getEventFromBuffer())!=null){ consume(event); event.recycle(); } </code></pre> <p>Is that approach correct? If not whats the best solution for that problem?</p>
java android
[1, 4]
5,681,029
5,681,030
How to pass parameters to the flyout of windows 7 gadget?
<p>This is my code i want to pass parameters to the flyout function but it doesnt work, i remove parameters it work . is this code true? </p> <pre><code>$(document).ready(function() { var now = new Date(); $.ajax({ type: "GET", url: 'http://sarafandnet.com/sites.xml', dataType: "xml", success: function(xml) { $(xml).find('New').each(function() { var id = $(this).attr('id'); var title = $(this).find('title').text(); var date = $(this).find('date').text(); var url = $(this).find('url').text(); var desc = $(this).find('desc').text(); if (now.getDate() == date) { document.getElementById("td" + date).innerHTML = '&lt;table width="16" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td height="21" &gt;&lt;a href="javascript:void(0);" onclick="showFlyout(\'' + title + '\',\'' + desc + '\')" class="lightwindow" height="10px" title="' + title + '" caption="' + desc + '" &gt;click&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;'; } }); } }); }); function Init() { System.Gadget.Flyout.file = "flyout.html"; // Initialize the Flyout state display. if (!System.Gadget.Flyout.show) { sFlyoutFeedback.innerText = "Flyout hidden."; } } function showFlyout(titlee, descc) { System.Gadget.Settings.write("title", titlee); System.Gadget.Settings.write("desc", descc); System.Gadget.Flyout.file = "flyout.html"; System.Gadget.Flyout.show = true; } function showFlyout() { System.Gadget.Flyout.show = true; } function hideFlyout() { oGadgetDocument.getElementById("strFlyoutFeedback").innerText = "Flyout hidden."; System.Gadget.Flyout.show = false; } </code></pre>
javascript jquery
[3, 5]
876,384
876,385
Asp.net - Do changes to session objects persist?
<p>I'm using the session to hold a custom object UserSession and I access the session like this:</p> <pre><code>UserSession TheSession = HttpContext.Current.Session["UserSession"] as UserSession; </code></pre> <p>Then, in my code, I modify a property of TheSession like this</p> <pre><code>TheSession.Prop1 = some new value; </code></pre> <p>My question is this: when I change the value, does it change the value inside the session that's in HttpContext.Current.Session["UserSession"] or just the TheSession variable, in which case I'd need to reassign the object variable to the session.</p> <p>Thanks.</p>
c# asp.net
[0, 9]
5,478,470
5,478,471
How to get $(this) selected option in jQuery?
<p>The following code works:</p> <pre><code>$("#select-id").change(function(){ var cur_value = $('#select-id option:selected').text(); . . . }); </code></pre> <p>How to refactor the second line to:</p> <pre><code>var cur_value = $(this).***option-selected***.text(); </code></pre> <p>What do you use for <code>***option-selected***</code>?</p>
javascript jquery
[3, 5]
2,589,668
2,589,669
jquery get object value
<p>How do I get get the value <code>url</code> from this string:</p> <pre><code>[{ "url": "https://www.filepicker.io/api/file/WGS4Wmkk", "filename": "4827889.jpg", "mimetype": "image/jpeg", "size": 53113, "key": "be7BxONVHe_48278891840.jpg", "isWriteable": false }] </code></pre> <p>With jquery or regular javascript</p>
javascript jquery
[3, 5]
5,115,513
5,115,514
Javascript comparison help
<p>I am having trouble with this statement and I was hoping I could get some help. Essentially, if <code>edweek</code> and <code>edevenings</code> (which are checkboxes) are not equal then I want to push to my array. The problem I am having is that I can get one of the values to be not equal, but when I add the second it doesn't work.</p> <pre><code>function getEdVals() { var edVals = []; $('#edinitiativecont :checked').each(function() { if($(this).val() == $("#liveweb").val()){ edVals.push($(this).val()); } else { if($(this).val() == (!($("#edweek").val()) || $("#edevenings").val())){ edVals.push($(this).val()); } } }); } </code></pre>
javascript jquery
[3, 5]
5,684,721
5,684,722
How to use a variable's contents to declare another variable in javascript?
<p>I have a problem that I hope to use one variable's contents as another variables name in javascript. In this case, I do not know what is the contents in that variable, I only know it is a text type and I hope the variable I need to declare will use that text as its name.</p> <p>Anyone could kindly give me some suggestion of how to do that?</p> <p>Thank you!</p>
javascript jquery
[3, 5]
4,297,670
4,297,671
On MultiThreading on the Android platform
<p><code>Multithreading on Android</code> is to some extent an easy task due to the various possibilities available for us.</p> <p>However it would be nice to understand the difference between the approaches.</p> <p><strong>What is the best way to multitask and based on what preferences is it the "best"?</strong></p> <ol> <li><p><strong><code>AsyncTask</code>?</strong></p> <pre><code>class MultiTasker extends AsyncTask&lt;, , &gt; </code></pre></li> <li><p><strong><code>Runnable</code>?</strong></p> <pre><code>Runnable myRun = new Runnable(){ public void run(){ } }; Thread T = new Thread(myRun); T.start(); </code></pre></li> <li><p><strong><code>Handler</code>?</strong></p> <pre><code>class MultiTasker extends Handler </code></pre></li> </ol>
java android
[1, 4]
3,760,740
3,760,741
set div position to fixed after scrolling 100px?
<p>I tried to use the following function in order to set the div's position to 100 px from top after scrolling 100 px.</p> <pre><code>&lt;script src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(window).scroll(function(){ $("#header").css("top",Math.max(0,100-$(this).scrollTop())); }); &lt;/script&gt; &lt;div class="header" style="position:fixed;top:100px;background-color:red"&gt;something&lt;/div&gt; </code></pre> <p>it is not working(the div stick to it's fixed position). it seems that the function is not relating to the div. what is my problem ?</p>
javascript jquery
[3, 5]
5,791,501
5,791,502
Compare text input's value against default value
<p>For a text input defined as:</p> <pre><code>&lt;input type="text" name="Email0" id="Email0" value="1st Email" /&gt;&lt;br /&gt; </code></pre> <p>If the user changes the value of that text box I simply pass it along with the form submit...if they _haven't changed it - i need to pass a value of 'null'.</p> <pre><code>$('#frmSignup').submit(function () { if (Email0.value != Email0.defaultValue) { alert("hit here"); //not hitting here } }); </code></pre> <p>You'll note that jQuery exists but i'm unclear as to exactly how to retrieve a input's defaultValue to jQuery.</p> <p>thx</p>
javascript jquery
[3, 5]
2,181,213
2,181,214
Unable to create Android Virtual Device
<p><img src="http://i.stack.imgur.com/T5DP4.jpg" alt="Ok Button not clickable"></p> <p>Hi, for some reason, the OK button is not clickable when I try to create an AVD. Does anyone know what I'm doing wrong?</p> <p>Thanks. </p>
java android
[1, 4]
562,570
562,571
how to add tipbox when mouse hover on the text
<p><a href="http://bowser.effectgames.com/~jhuckaby/zeroclipboard/multiple.html" rel="nofollow">http://bowser.effectgames.com/~jhuckaby/zeroclipboard/multiple.html</a></p> <p>is there a way to add a tipbox when the mouse hover on the copied text.the tip box say"the text has been copied" thank you.</p> <p>HTML:code</p> <pre><code>&lt;body&gt; &lt;div&gt; &lt;div class="example" "&gt;&lt;/div&gt;&lt;div&gt;copied text&lt;/div&gt; &lt;div class="example" "&gt;&lt;/div&gt;&lt;div&gt;copied text&lt;/div&gt; &lt;div class="example" "&gt;&lt;/div&gt;&lt;div&gt;copied text&lt;/div&gt; &lt;div class="example" "&gt;&lt;/div&gt;&lt;div&gt;copied text&lt;/div&gt; &lt;/div&gt; &lt;/body&gt; </code></pre>
javascript jquery
[3, 5]
6,010,620
6,010,621
Switch divs off/on
<p>Once a div is offed can it be onned?</p> <p>FIRST,</p> <pre><code> $("#num-one").off(); $("#num-two").off(); $("#num-three").off(); </code></pre> <p>THEN LATER ON,</p> <pre><code> $("#num-one").on(); $("#num-two").on(); $("#num-three").on(); </code></pre> <p>Because the divs are no longer responding to click events in spite of onning them - can they be onned once they are turned off?</p>
javascript jquery
[3, 5]
3,574,957
3,574,958
How to get URL from GridView using javascript?
<pre><code>&lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ID" DataSourceID="SqlDataSourceVideo" &gt; &lt;Columns&gt; &lt;asp:BoundField DataField="VideoUrl" HeaderText="VideoUrl" SortExpression="VideoUrl" /&gt; &lt;asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" InsertVisible="False" ReadOnly="True" /&gt; &lt;asp:BoundField DataField="Video_Name" HeaderText="Video_Name" SortExpression="Video_Name" /&gt; &lt;asp:CommandField ShowDeleteButton="True" /&gt; &lt;asp:TemplateField&gt; &lt;ItemTemplate&gt; &lt;asp:Button ID="ButtonPlay" runat="server" CommandName="Play" CommandArgument='&lt;%# DataBinder.Eval(Container.DataItem,"VideoUrl") %&gt;' Text="Play" OnClientClick="playVideo()"&gt;&lt;/asp:Button&gt; </code></pre> <p><strong>JavaScript code for play URL:</strong></p> <pre><code>&lt;script type="text/javascript" language="javascript"&gt; function playAudio(URL){ if (URL != "") { document.Player.filename = URL; document.getElementsByName("mediaPlayer").src=URL; document.getElementsByName("mediaPlayer").play(); document.Player.showcontrols = true; document.Player.height = 40; document.Player.play(); } } &lt;/script&gt; </code></pre> <p>Can anyone tell me how to get URL value from gridview? Thanks in advance.</p>
c# javascript asp.net
[0, 3, 9]
306,753
306,754
How to send values in array format from android application to non web based server and retrive it?
<p>I am working on a cloud computing based android project where front end is android and back end java. At front end I have to enter Add Destinations list and Add activities list. This I want to send in the form of destination array and activity array to a non web based server. I too don't have much idea about it. All I want it to get these array to my back end java program running on my system in the array format so that I can work on these array values.</p> <p>Output as :</p> <pre><code>String[][] dest = new String[3][3]; dest[0][0] = "Hyundai Car Center,Sector 63,Noida"; dest[0][1] = "11:00"; dest[0][2] = "2"; dest[1][0] ="Sector 12,Noida"; dest[1][1] = "09:00"; dest[1][2] = "0.5"; dest[2][0] ="GIP, sector 18,Noida"; dest[2][1] = "14:00"; dest[2][2] = "3.5"; String[][] activity = new String[2][2]; activity[0][0] = "Buy Clothes"; activity[0][1] = "0.5"; activity[1][0] = "food"; activity[1][1] = "1"; </code></pre>
java android
[1, 4]
1,288,097
1,288,098
Display a text field with single quotes
<p>I'm working on an application that requires a text field to fade in with the value being loaded by AJAX. (I'm doing this all with jQuery), here's the code:</p> <pre><code>$("div#p"+eId+"_content").html("&lt;input class='editPost' type='text' value='" + oldCont + "' id='p" + eId + "_editBox' /&gt;"); </code></pre> <p>Unfortunatly, <code>oldCont</code> can contain single quotes, which means the textbox will only contain <code>oldPost</code> up until that single quote. How could I display <code>oldCont</code> without having that problem, but still retaining that single quote (without the \ from escaping it)?</p>
javascript jquery
[3, 5]
3,501,008
3,501,009
Using the HTML5 boiler plate I would like to know how I could place all my scripts in the plug-ins.js and scripts.js files?
<p>This is a demo files of the script I wish to place in these files in order to use the build script that comes with the HTML5 boiler plate. <a href="http://epecho.com/tst/index.html" rel="nofollow">http://epecho.com/tst/index.html</a></p>
javascript jquery
[3, 5]
1,870,652
1,870,653
Javascript checking radiobuttons
<p>I got this code</p> <pre><code> &lt;?php foreach($this-&gt;question as $question): ?&gt; &lt;div class="question"&gt; &lt;?php echo $question['question'] ?&gt; &lt;/div&gt; &lt;?php if($this-&gt;activeEdition["id"]!=20) { ?&gt; &lt;div class="answers"&gt; &lt;?php $i = 1; foreach($question['answers'] as $answer): ?&gt; &lt;input type="radio" name="question[&lt;?php echo $question['id'] ?&gt;]" value="&lt;?php echo $answer['id'] ?&gt;" id="&lt;?php echo $answer['id'] ?&gt;" class="radio_answer radio_answer_&lt;?php echo $i; ?&gt;" &gt; &lt;label for="&lt;?php echo $answer['id'] ?&gt;"&gt;&lt;?php echo $answer['answer'] ?&gt;&lt;/label&gt; &lt;?php if(count($question['answers']) &gt; 3){ echo '&lt;br/&gt;'; } ?&gt; &lt;?php $i++; endforeach; ?&gt; &lt;/div&gt; </code></pre> <p>How to check in easy and simplest way in javascript if in every question is checked one radio button?</p>
php javascript
[2, 3]
5,394,842
5,394,843
Passing Looped Array Values From PHP to JavaScript & JQuery
<p>I am trying to make a search box in my web application, and I used ajax post to make a request to my server. My question is:</p> <p>Is it possible to send looped array values from PHP to my JavaScript? I want to get all of the results from my server.</p> <p>CLIENT SIDE: Ajax POST request</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready( function() { $.ajax({ type: "POST", url: "searchPlaces.php", data: { searchInput: form.searchTxtId.value }, success: function (result) { // Get the search result } }); }); &lt;/script&gt; </code></pre> <p>SERVER SIDE (after retrieving the post from ajax, and making queries):</p> <pre><code>while ($result = mysql_fetch_assoc ($query)) { $resultName = $result['name']; $resultAddress = $result['address']; } </code></pre>
php jquery
[2, 5]
153,784
153,785
Simple Website (Apache/PHP/MySQL + JavaScript)
<p>I've been asked to create a fairly straightforward website for a friend. Essentially a user will log in, fill in a set of information, and submit it. This data will then need to written to a database (and read from/presented at a future point).</p> <p>I'm not really a web developer (I do mostly Java/C++), but about 3 years ago I worked on a project where we created a site using WAMP (Windows, Apache, MySQL and PHP), with a bit of JavaScript/AJAX thrown in for good measure. I was going to use WAMP again, but am concerned that there might be better tools available now. </p> <p>So, is the WAMP approach a good one for a straightforward site like this? </p> <p>If so, what tools would you recommend to use for the development of PHP/Javascript?</p> <p>Finally, I saw in one of the blog posts that Stack Overflow uses JQuery. Would it be worthwhile to use these libs?</p>
php javascript
[2, 3]
1,248,184
1,248,185
jQuery : how to find the coordinates of center of a div
<p>I want to get the coordinates of center of a divand position another element based on the center of this div. The div is actually movable on the screen ? Any ideas?</p>
javascript jquery
[3, 5]
2,699,355
2,699,356
jquery add <thead> and add <tbody>
<p>How do I add <code>&lt;thead&gt;</code> and <code>&lt;tbody&gt;</code> this using jquery?</p> <p>the problem is my table has 1 or 2 th rows?</p> <pre><code>$('#myTable tr:has(th)').wrap('&lt;thead&gt;&lt;/thead&gt;'); </code></pre> <hr> <pre><code>&lt;table id="myTable"&gt; &lt;tr&gt;&lt;th&gt;1&lt;/th&gt;&lt;th&gt;2&lt;/th&gt;&lt;th&gt;3&lt;/th&gt;&lt;th&gt;4&lt;/th&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th&gt;1&lt;/th&gt;&lt;th&gt;2&lt;/th&gt;&lt;th&gt;3&lt;/th&gt;&lt;th&gt;4&lt;/th&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;4&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;4&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;4&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;4&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;4&lt;/td&gt;&lt;/tr&gt; &lt;/table&gt; </code></pre>
javascript jquery
[3, 5]
3,882,990
3,882,991
Facebook link inspector
<p>I'm building a website and am looking for a way to implement a certain feature that Facebook has. The feature that am looking for is the link inspector. I am not sure that is what it is called, or what its called for that matter. It's best I give you an example so you know exactly what I am looking for.</p> <p>When you post a link on Facebook, for example a link to a youtube video (or any other website for that matter), Facebook automatically inspects the page that it leads you and imports information like page title, favicon, and some other images, and then adds them to your post as a way of giving (what i think is) a brief preview of the page to anyone reading that post.</p> <p>I already have a feature that allows users to share a link (or URLs). What I want is to do something useful with the url, to display something other than just a plain link to a webpage, to give someone viewing a shared link (in the form if a post) some useful insight into the page that the url leads to. </p> <p>What I'm looking for is a script, or tutorial, or at the very least someone to point me in the right direction, so that it can help me accomplish this (using PHP preferably). I've tried googling it but I don't know exactly what such a feature would be called and google isn't helpful when you don't exactly know what you're looking for. I figure someone out there, in this vast knowledge basket called stackoverflow, can help me with this. Can anyone help me?</p>
php javascript
[2, 3]
5,438,605
5,438,606
How do I get the value of an element by id
<p>I'm using JavaScript and JQuery and when I select a certain page in my application, an id within the content div named myId shows the string "No results found". This means that when I select the page, the search which is included on every page, executes. If there are records to show, I get these records. If not, then I get the "No results found"-string.</p> <p>What I want is to check the value of myId and when it is empty ("No results found"), I want to hide some controls on that page.</p> <p>I already tried <code>$('#myId').val();</code> but it just gives 2 double quotes, even if it's not empty.</p>
javascript jquery
[3, 5]
2,926,072
2,926,073
using jquery to sum the text box value in the child repeater control and show the total in the label in footer
<p>I am trying this code for in jquery to sum the text box value in the child repeater control and show the total in the label in footer. I get <code>null is null or not an object</code> error.</p> <pre><code>function display(objSecName) { var objsec = objSecName; // var lablTotAmount = document.getElementById(objSecName); alert(objsec); $('.totamt input[type=text]').each(function () { $(this).change(function () { alert(calsum()); }); }); function calsum() { var Total = 0; var limtamt = 120000; $('.totamt input[type=text]').each(function () { if (!isNaN(this.value) &amp;&amp; this.value.length != 0) { Total += parseFloat($(this).val()); document.getElementById(lblTotalAmountId80C).value = Total; } }); return Total; }; } </code></pre>
javascript jquery
[3, 5]
4,287,592
4,287,593
IndexOutOfRange/ System.FormatException in Gridview
<p>I have a gridview with checkbox in my codebehind page. The functionality is that I need to select the records to be deleted using checkbox and click the delete button. I use the below code to do that.. But when I select the last row it does not get deleted. Instead it throws IndexOutOfRange/ System.FormatException ..</p> <p>The error is thrown at this line </p> <pre><code> CheckBox chkb = (CheckBox)gvAll.Rows[i].Cells[0].FindControl("chk"); for (int i = 0; i &lt; count; i++) { CheckBox chkb = (CheckBox)gvAll.Rows[i].Cells[0].FindControl("chk"); if (chkb.Checked == true) { string name = gvAll.Rows[i].Cells[3].Text; if (!(name.Equals(System.DBNull.Value))) { a.delete(name); } } } </code></pre> <p>It's an urgent issue. Please help..</p>
c# asp.net
[0, 9]
3,923,984
3,923,985
Need help with some kind of collision detection via jQuery
<p>i am working on a calendar interaction module. the calendar shows days reserved. a reservation interval is 7 days. i have set up via javascript that hovering a day adds a class and auto-hovers 3 days before and 3 days after this day too to visualize the 7-day-interval setting that class there too. now i stuck with the following problem.</p> <p>if i hover a day and one of the prev. 3 or next 3 is already part of a reservation i want to prepend the difference to the other end of the 7-day interval. an example:</p> <ol> <li>i hover day 12</li> <li>then the interval looks like xxx12xxx</li> <li>i move the cursor to 13</li> <li>the interval looks like xxx13xxx</li> <li>if i now move the cursor to 14 then 15,16,17 would be marked too, but what if 16 is the starting point of a reservation? then it would look like xxx14x</li> <li>In either case i finally need to know the id of the left and right outer end as these are values i have to send via form. how to get these?</li> <li>how to make that the difference (16 and 17) is getting prepended on the left end so it would look like xxxxx14x?</li> </ol> <p>the only way i see it to have a 7 cases switch with a huge code block. but somehow i feel there was an easier way. </p> <p>can you guys probably show me?</p> <p>many thanks in advance for reading!</p> <p>regards</p>
javascript jquery
[3, 5]
669,626
669,627
Fading colors with jquery?
<p>I have a regular color change using jquery, but I'd like to have it so it has a smooth color change. At the moment, the code changes the color of a link on hover and then removes it when the mouse is removes. I have seen one tutorial but it doesn't explain it and it does not look like my current code. This is what it looks like at the moment:</p> <pre><code>$(document).ready(function() { $("#link1,#link2,#link3").hover(function() { $(this).addClass("red"); },function(){ $(this).removeClass("red"); }); }); </code></pre> <p>Thanks in advance</p>
javascript jquery
[3, 5]
2,424,021
2,424,022
How to access a string variable outside
<pre><code> public void Button1_Click(object sender, EventArgs e) { String a = DropDownList1.SelectedItem.Value; String b = DropDownList3.SelectedItem.Value.PadLeft(3, '0'); String c = TextBox1.Text.PadLeft(5, '0').ToString(); String d = TextBox2.Text.ToString(); String digit = a + b + c + d; try { OdbcConnection casetype = new OdbcConnection("Driver={MySQL ODBC 3.51 Driver};Server=localhost;Database=testcase;User=root;Password=root;Option=3;"); casetype.Open(); //************to get case type string casetypequery = "select casename from casetype where skey=?"; //************to get case type OdbcCommand casetypecmd = new OdbcCommand(casetypequery, casetype); String casetypefromdropdown = DropDownList3.SelectedItem.ToString(); casetypecmd.Parameters.AddWithValue("?", casetypefromdropdown); using (OdbcDataReader casetypeMyReader = casetypecmd.ExecuteReader()) { while (casetypeMyReader.Read()) { String casename = casetypeMyReader["casename"].ToString(); } } } catch (Exception ewa) { Response.Write(ewa); } </code></pre> <p>I am not able to access</p> <pre><code>String casename = casetypeMyReader["casename"].ToString(); </code></pre> <p>which is inside while loop in my above code. How can i access </p> <blockquote> <p>'casename'</p> </blockquote> <p>outside while loop?i want to use it to put the content in HtmlEditor(ajax)</p>
c# asp.net
[0, 9]
3,544,603
3,544,604
form validation using javascript in changing input tags
<p>I need to validate a form using JavaScript. The form keep changes since I am using data from a field name table to print each field (like name, address, phone no.). I'm using a loop to print the label for field and corresponding text input tag. (eg. name : textbox to enter name, phone no : textbox to enter phone no.) And at last getting these values in an array when submitting the form and entering into details table.</p> <p>Following is the code for printing each field and text box:</p> <pre><code>while ($row=mysql_fetch_array($result)){ echo'&lt;labelfor='.$row['field_name'].'name=field_id&gt;'.$row['field_name'].':&lt;/label&gt;'; echo'&lt;inputtype="text" name=field_name[]id="'.$row['field_id'].'":value="'.$row['field_value'].'" size="20" class = "inpBox" &gt;'; } </code></pre> <p>Now I need to check whether these fields are empty using JavaScript and then change the style of that particular text box. Any help will be greatly appreciated.</p>
php javascript
[2, 3]
5,786,325
5,786,326
How can I scale my font with different types of screen?
<p>I have made an Android application, but it must work on different types of screen, and I have done that too. But it is 1 thing - for creating scaling screen I use layout_weight and dp instead px. But how can I scale my fonts in .xml files? Thank you. </p>
java android
[1, 4]
939,490
939,491
work with checkbox.?
<p>i want usually when the user manually checks all the checkboxes, the checkall checkbox should become checked, and when user unchecks one box so that "all" aren't checked, the checkall box should become unchecked. how is it in my code?<p> <strong>EXAMPLE:</strong> <a href="http://jsfiddle.net/cQYVE/5/" rel="nofollow">here is full my code</a></p>
javascript jquery
[3, 5]
1,770,448
1,770,449
How to intercept HTTP requests made by a 3rd party library on Android?
<p>For my project I have to use a 3rd party Java library which makes some HTTP requests to a well known server. I need to add my own header to those requests and wonder how I can realize it?</p> <p>An HttpRequestInterceptor seems to be the answer, but how can I 'register' this one globally, so that the 3rd party library would use it? Is it perhaps possible using reflection?</p> <p>I do not want to use a proxy app. Just my application should intercept and modify the HTTP requests of that 3rd party library.</p> <p>Thanks for your help, Michael</p>
java android
[1, 4]
4,990,916
4,990,917
Code Translation: ASP.NET Server.Transfer in PHP
<p>How would I do this in PHP?</p> <pre><code>Server.Transfer("/index.aspx") </code></pre> <p>(add ';' for C#)</p> <p><strong>EDIT:</strong></p> <p>It is important to have the URL remain the same as before; you know, for Google. In my situation, we have a bunch of .html files that we want to transfer and it is important to the client that the address bar doesn't change.</p>
php asp.net
[2, 9]