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 |
---|---|---|---|---|---|
209,988 | 209,989 |
in override page_load, additional part should before or after base.OnLoad(e)?
|
<p>I inherit a basepage and override its method page_load,do sth myself in it,what I want to ask : the method I wrote should before base.OnLoad(e) or after it,which is better ? any difference between different location?</p>
<pre><code>protected override void OnLoad(EventArgs e)
{
this.GenerateIEIcon();
this.GenerateHeader();
this.GenerateJavascript();
base.OnLoad(e);
}
</code></pre>
<p>or</p>
<pre><code> protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
this.GenerateIEIcon();
this.GenerateHeader();
this.GenerateJavascript();
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
1,710,048 | 1,710,049 |
ASP:menu error occuring
|
<p>I am getting SCRIPT5009: WebForm_GetElementByTagName is undefined error when I have been using asp menu in IE 10 instead of IE 9 (which is earlier installed).</p>
<p>When I tried to find it I found this is occurring because when WebResource.axd is generated it does not have definition for this method.</p>
<p>On further findings I found .net does not recognizes IE 10 as in browser file its entry is missing.</p>
<p>So for this we have patch available which fixes this problem, however I want to add any javascript or code which will add defination for WebForm_GetElementByTagName orthat resolves error.</p>
|
c# asp.net
|
[0, 9]
|
1,677,864 | 1,677,865 |
How to check if a value passed to a javascript function is null?
|
<p>I have the following javascript code:</p>
<pre><code>function changeButtonState(targetSelector, action, iconClass) {
var $target = $(targetSelector);
var $targetSpan = $(targetSelector + ' span');
$targetSpan.removeClass('sprite-blank').addClass(iconClass);
}
</code></pre>
<p>How can I make it so that the <code>$targetSpan.removeClass(..).addClass</code> only work if the <code>iconClass</code> has a value when the function is called. I guess what I am confused about is do I check if it is defined or do I check if it has a length of 0 or more?</p>
|
javascript jquery
|
[3, 5]
|
5,147,908 | 5,147,909 |
Split text on page
|
<p>How to split text between pages? Would like to know how to do HTML with the conclusion in the WebView or TextView, possibly even with images.</p>
|
java android
|
[1, 4]
|
3,206,853 | 3,206,854 |
window.showModalDialog resizable property not working
|
<p>I'm developing a page in asp.net, and I have this script that opens a modal window. It works perfectly, but the resizable property seems to not be working as I can resize the window once it is opened.</p>
<pre><code>Dim script as String = "window.showModalDialog('" + page + "','','unadorned:yes; dialogWidth:330px; dialogHeight:210px; center:yes ; resizable:no; scrollbars:no; toolbar:no; copyhistory:no; menubar:no; status:no ; addressbar:no');"
ScriptManager.RegisterStartupScript(Me, GetType(Page), "alertaerror", script, True)
</code></pre>
<p>I need help with that property, is there something I'm doing wrong ?</p>
|
javascript asp.net
|
[3, 9]
|
3,033,555 | 3,033,556 |
Can I get wmode parameter from Flash object?
|
<p>I am working on a site that includes Flash-based third party ads. Some of these ads do not have a wmode parameter set, and so when we pop up an overlay from our site, the ad blocks it or appears on top of it. We do not have the ability to insert wmode parameters into the ads. </p>
<p>Is there a way to determine which ads do not have that wmode parameter set (i.e. get the wmode value for each ad), so I can hide those ads when we pop up an overlay? The ad sales team has already specified that they do not want to hide the compliant ads in those situations, so I need to hide only those ads that would block our overlays.</p>
<p>Note: I am using jQuery Colorbox for the overlays, if that matters.</p>
|
javascript jquery
|
[3, 5]
|
3,383,611 | 3,383,612 |
simple jQuery appears fine except in IE7
|
<p>I have created a simple animation using jQuery and the mouseenter / mouseleave. It works fine in IE7, FF, Opera, Chrome and safari. </p>
<p>however, something is wrong in IE7 - nothing happens at all - I can't even get alert boxes to pop up.</p>
<p>Could somebody please take a look at my code and tell me what I am doing wrong before I pull my hair out.</p>
<p>The offending page can be viewed at www.ypfservice.net - its part of a joomla install, hence bloated code.</p>
<p>Thanks a lot</p>
<p>E</p>
<pre><code>enter code here$('a.panelImage').parent().addClass('panel');
var numberLinks = $('a.panelImage').length;
for (var j=0; j<numberLinks; j++){
var currentLink = $('a.panelImage').eq(j);
$('<div class="fred"></div>').insertAfter(currentLink);
var gtr=(currentLink.position().left)+'px';
$(currentLink).next().css({ // ie div.fred
'position':'absolute',
'background-position':'0 0',
'top':'222px',
'left':gtr,
'display':'none',
'z-index':'1000',
'width':'5px',
'height':'5px',
'overflow':'hidden',
'backgroundImage':'url(http://www.ypfservice.net/templates/ypftemplate/images/foyerPreview.jpg)',
});
}
$('div.panel').mouseenter(function () {
$(this).find('div').animate({
height: '138px',
width: '184px'
}, 500)
})
.mouseleave(function () {
$(this).find('div').animate({
'width': '0px',
'height': '0px'
}, 500);
}); //end function
</code></pre>
|
javascript jquery
|
[3, 5]
|
789,129 | 789,130 |
Use variable in jquery object
|
<p>i have this code </p>
<pre><code>if($("input[name='staylogged']").is(":checked")){
var staylogged = "yes";
}else{
var staylogged = "false";
}
var form_data = {
username: $("#username").val(),
password: $("#password").val(),
staylogged
};
</code></pre>
<p>but the var staylogged in form_data doesn't work as expected where is the error?</p>
<p>i don't know how to declare the var staylogged in form_data</p>
|
javascript jquery
|
[3, 5]
|
2,693,287 | 2,693,288 |
jQuery calculation doesn't add up as expected when toggling height
|
<p>I have the following function for calculating the height of <code>.node</code>. It then takes away the height of a possible image, <code>.node-image</code>, from the height of the <code>.node</code>, and sets a column, <code>.node-content-column</code> to have a height that is the difference (i.e. 500 - 50 = 450; column becomes 450 in height).</p>
<pre><code>function initColumnSizer() {
imageHeight = $('.node-image').outerHeight(true);
resizeHeight = ($('.node').outerHeight() + 75) - imageHeight;
$('.node-content-column').removeAttr('style');
$('.node-content-column').css('min-height', resizeHeight);
$('.node-content-column').css('height', 'auto !important');
$('.node-content-column').css('height', resizeHeight);
}
</code></pre>
<p>This function gets called on page load, and resizes <code>.node-content-column</code> as expected. </p>
<p>It also gets called when a div within <code>.node</code> is toggled using <code>jQuery.toggle()</code>, but this calculation returns a larger number everytime, instead of reverting back to the original once this toggle is reverted. </p>
<p>Can anyone see where I am going wrong with this calculation? Or if I am going about it the wrong way?</p>
<p>Thanks in advance!
Karl</p>
|
javascript jquery
|
[3, 5]
|
3,654,313 | 3,654,314 |
How to alter prettyPhoto description HTML?
|
<p>hello i want to modify the "description html" of the prettyPhoto i dont think there is a callback available when prettoPhoto lightbox is "shown" (but a callback for close exist)</p>
<p>what do you guys recommend? </p>
|
javascript jquery
|
[3, 5]
|
1,643,130 | 1,643,131 |
Sending JS variable data to a downloadable page
|
<p>This javascript function takes JSON and formats it to XML. The data is a long XML string, whic I would like to allow the user to download. I'm trying to use ajax to post the data to a php page wichi will create the file and then allow the user to download it. </p>
<pre><code> json2xml(eval(data));
</code></pre>
<p>JS</p>
<pre><code> $.ajax({
type: 'POST',
url: 'download/functions.php',
data: xml2,
dataType: XML
});
</code></pre>
<p>I have used this PHP function to write to a file, but I'm not sure how to now send the js variable to this function.</p>
<pre><code> $data = $_POST['xml2'];
writetoxml($data, 'WF-XML'.$current. '.xml');
function writetoxml($stringData, $myFile) {
$current = date('m-d-Y-g-i-s');
$fh = fopen('download/'.$myFile, 'w') or die("can't open file");
fwrite($fh, $stringData);
fclose($fh);
download($file);
}
function downloadFile($file) {
if(!file)
{
// File doesn't exist, output error
die('file not found');
}
else
{
// Set headers
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=$file");
header("Content-Type: application/csv");
header("Content-Transfer-Encoding: binary");
// Read the file from disk
readfile($file);
exit;
}
</code></pre>
<p>}</p>
<p>This is currently returning a server 500 error.</p>
|
php javascript
|
[2, 3]
|
4,418,424 | 4,418,425 |
extract info from a string
|
<p>Suppose I have a string that looks like the following:</p>
<pre><code>string foo ="<add key="key1" Value="val1"/>
<add key="key2" Value="val2"/>
<add key="key3" Value="val3"/>"
</code></pre>
<p>frrom this string i need to loop through and get every key value pair and do something with them.
how can i do that?</p>
<p>thanks</p>
|
c# asp.net
|
[0, 9]
|
4,514,129 | 4,514,130 |
Fill gridview using javascirpt on selected tree node value
|
<p>my requirement is to get the result in gridview based on the treeview node selection using javascript i.e. client scripting. Currently the same can achieve using server side scripting, but i want with out postback and without using selectednodeindexchanged event. Pls. help me to solve this problem.</p>
|
javascript asp.net
|
[3, 9]
|
1,588,492 | 1,588,493 |
How do I check two textboxes for two dates
|
<p>One has txtDateReceived and second has txtVendorPackDate. Before insert will add record I have to check if txtDateReceived is not erlier then txtVendorPackDate. I try use TextChanged event. </p>
<pre><code>protected void txtVendorPackDate_TextChanged(object sender, EventArgs e)
{
DateTime fromDate = DateTime.MinValue;
DateTime toDate = DateTime.MaxValue;
bool parseResultMin = DateTime.TryParse(txtVendorPackDate.Text, out fromDate);
bool parseResultMax = DateTime.TryParse(txtDateReceived.Text, out toDate);
if (toDate < fromDate)
{
txtVendorPackDate.Text = "";
lblDateExpired.Visible = true;
lblDateExpired.Text = "Selected date is incorrect, please enter correct data.";
txtVendorFatPerc.Focus();
}
double expired = toDate.Subtract(fromDate).TotalDays;
if (expired >= 60)
{
lblDateExpired.Text = "Date Expired " + expired + " days after pack day!!!"
lblDateExpired.Visible = true;
}
}
</code></pre>
<p>How I could do it from client side not using controls validation.</p>
|
c# asp.net
|
[0, 9]
|
3,066,309 | 3,066,310 |
How to order divs with JQUERY
|
<p>i have divs like this: </p>
<pre><code><div class="oferta SYB">
<div class="infoferta">
<div class="datosoferta">
<div class="ofertapagas">Pag&aacute;s<br/> $ 67</div>
<div class="ofertavalor">Valor<br /> $ 160</div>
<div class="ofertadescuento">Descuento $ 93</div>
</div>
</div>
</code></pre>
<p>i want to order the divs with the class="oferta" by the value in "ofertapagas" or the value in "ofertavalor" or the value in "ofertadescuento", i dont know how to, i cannot use the database, i just can use Jquery, i am using the last version of it.
Some Help please!! </p>
|
javascript jquery
|
[3, 5]
|
1,162,783 | 1,162,784 |
jQuery News Ticker - not quite smooth enough
|
<p>Hey, I have a nice news ticker that stops on <code>mouseover</code> etc... but the animation is slightly jerky - any ideas?</p>
<pre><code>var ticker_holder = $('#ticker').get(0);
var ticker_text = $('#ticker').get(0);
var ticker_pos = ticker_text.parentNode.offsetWidth;
var ticker_data = "<strong>Featured: </strong>"
+"HardCoded, DamnCool, AliveKicking, NinjaGaiden, WikiWord, FeaturedWords...";
$(ticker_text).html('<marquee scrollamount="1" scrolldelay="20">' + ticker_data + '</marquee>');
$('#ticker').hover(
function() { $('marquee', this).get(0).stop(); },
function() { $('marquee', this).get(0).start(); }
);
</code></pre>
|
javascript jquery
|
[3, 5]
|
986,767 | 986,768 |
Force a View to redraw itself
|
<p>I have created a custom View (let's call it <code>MyView</code>) which basically just draws some text on itself using the canvas. The text to be drawn is set using a global variable.</p>
<p>At some point during the program's execution, I want to change the global variable, and have the <code>MyView</code> redraw itself to update the text. I tried <code>findViewById()</code> and then <code>invalidate()</code>, but this does nothing. I suspect that since nothing within the <code>MyView</code> has changed, it thinks it has no reason to call <code>onDraw()</code>. Is there any way to force a View to redraw itself even if it thinks it doesn't need to?</p>
|
java android
|
[1, 4]
|
198,900 | 198,901 |
Using jQuery to add tick box values to a hidden field
|
<p>I am trying to collect tick box values and assign the ticked boxes values to a hidden field so that I can save all of the ticked boxes values into one column in a comma delimited format, instead of many.</p>
<p>How could I go about doing that?</p>
<p>Thanx in advance!</p>
|
javascript jquery
|
[3, 5]
|
3,127,045 | 3,127,046 |
jQuery Bind each() and also click() on the same function
|
<p>So I have the following fragment:</p>
<pre><code> $(".server").each(function() {
var element = $(this);
//bunch of javascript here with element
});
</code></pre>
<p>I also want to bind a single click event for an <code>id</code> to do the same work as the above, how is this possible, without copying and pasting the entire block and doing:</p>
<pre><code> $("#my-id").click(function() {
var element = $(this);
//bunch of javascript here with element
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,727,859 | 5,727,860 |
Android import project errors
|
<p>Hey everyone, I'm a beginner, so I'll try my best to explain this problem succinctly.</p>
<p>Basically, a friend of mine and I were playing around with the Android SDK, editing a simple RSS reader. We could launch it in the emulator and even install it on our real devices. </p>
<p>Fast forward a few days, I'm trying to import the exact same code that was working a few days earlier into Eclipse on my laptop. </p>
<p>I tried both importing and new project from existing source. Both return these new errors that we never had originally.</p>
<p>I got an error that involved the auto generated "R" file, but I have solved this. Now, I'm getting 3 errors that I have never had before -</p>
<ol>
<li><p>The method onClick(View) of type new View.OnClickListener(){} must override a superclass method - displayed twice ( 2 different lines)</p></li>
<li><p>The method onTabChanged(String) of type new TabHost.OnTabChangeListener(){} must override a superclass method</p></li>
</ol>
<p>My question is this - What would cause the these discrepancies between importing/running on my friends computer and mine? </p>
<p>Also, we are both using the latest version of Java/Eclipse</p>
<p>Thanks in advance for any insight. </p>
|
java android
|
[1, 4]
|
2,891,264 | 2,891,265 |
are java libraries allowed in android..?
|
<p>Hi all Stack Overflow members,</p>
<p>I have written native Java code to capture a screen shot of the desktop. It uses the following libraries; are these libraries allowed in Android? If not, what should I do to take screen shots in Android?</p>
<pre><code>javax.swing.*;
javax.imageio.*;
java.awt.*;
java.awt.event.*;
java.awt.image.*;
java.awt.AWTException;
java.awt.Robot;
java.awt.Rectangle;
java.awt.Toolkit;
java.awt.image.BufferedImage;
</code></pre>
|
java android
|
[1, 4]
|
4,171,326 | 4,171,327 |
jQuery How to kill a Created Div?
|
<p>What I have at the moment is a list of products (divs) that, when hovered over, a duplicate div is created and positioned over the original div (offset a bit and restyled using css). This new div is larger and offers more information that was being shown in the list view.</p>
<p>When I hover off the new div it is .remove()'d, however I have found that it does not do this immediately, and if I move my mouse fast enough the hover event is fired, but the mouseleave event is not (as such the new div is just left on screen).</p>
<p>What I have at the moment to detect when to remove the new div:</p>
<pre><code>jQuery('.newDiv').mouseleave(function(){
jQuery(this).remove();
});
</code></pre>
<p>How do I get my new div to check that the mouse is on/off it so that I can kill it correctly?</p>
|
javascript jquery
|
[3, 5]
|
522,166 | 522,167 |
Building a asp.net CompositeControl with custom JQuery validation
|
<p>Setup: I have built a asp.net composite control library for a small company I've done work for in the past. I also built a generic jquery validation library (didn't use jquery validation plug in because it was overkill for what we were doing). In the control item markup itself, the developer can add an attribute like "RequiredField='true'" and/or "DataValidation='Date'" to perform the appropriate validation. In the render method of the composite control, I then add classes like REQUIRED and DATEVALIDATOR to the cssclass list for the textbox. In the document.ready method I look for these specific classes and associate the onchange event for the textbox with that control.</p>
<p>Problem: This works great as is now, but I have two issues:
1) I'm not really comfortable with using the class attribute of the rendered input markup for something that has nothing to do with CSS, but I'm also not sure where else I can put it that will allow for the markup to still be valid HTML. Is there another way I can do this client side validation?</p>
<p>2) This is just an addition to #1, but I would like to add regular expression validation as an attribute option to the control, but I don't like the idea of using the current method of associating jquery validation logic with a css class to do it so I'd prefer some other way I can mark the rendered output so that my generic jquery can pick it up and know what validation to do to it.</p>
<p>Any suggestions would be greatly helpful and appreciated!</p>
|
jquery asp.net
|
[5, 9]
|
4,393,359 | 4,393,360 |
Jquery Toggle working in IE/Chrome, Undefined in FF
|
<p>I seem to be having the opposite problem as everyone else, my Javascript isn't working in Firefox. Firebug is telling me the id is undefined, but it isn't, unless FF doesn't recognize tags as objects to be controlled by javascript like IE/Chrome? </p>
<p>PHP Looks like this: </p>
<pre><code>echo '<a href="javascript:void(0)" onclick="toggle(details_'.$record_details.')">Details</a>';
echo '<tr style="display:none" id="details_'.$record_details.'">';
echo '<td class="noborder" colspan="7">';
echo '<div>';
Bunch of Content Here.
echo '</div>';
echo </td>;
echo </tr>;
</code></pre>
<p>Javascript is just</p>
<pre><code>function toggle(id){
$(id).toggle();}
</code></pre>
<p>The Sections toggle correctly in Both IE and Chrome, but Firefox returns "details_0 is not defined" etc. for every single one. </p>
<p>Any Suggestions? It's actually crashing at the call, weird enough because I put an Alert in the first line of toggle and it never fires, so it's not even making it that far. What am I missing? </p>
<p>thanks! </p>
|
javascript jquery
|
[3, 5]
|
5,916,001 | 5,916,002 |
Loading image in div every second
|
<p>I want to load a image in a div at regular interval, say every second or two</p>
<p>I did some silly attempts like this </p>
<pre><code>$(document).ready(function() {
setTimeout('LoadImages()',100 );
});
function LoadImages()
{
$('#Images').load('get_image.htm'); // get_image.htm displays image
}
</script>
<body>
<div id="Images"><div>
</code></pre>
<p>I know its all wrong, but what needs to be done to get this working ?</p>
|
javascript jquery
|
[3, 5]
|
1,799,363 | 1,799,364 |
Is JavaScript allowed to call a remote web page during a click event?
|
<p>When viewing the click in firebug, the call turns red (i.e. error) but I can't see the error because the page redirects.</p>
<p><strong>So is it allowed to call a remote website (in my case, its a 1x1 image using a standard url like <a href="http://www.example.com/becon" rel="nofollow">http://www.example.com/becon</a>).</strong></p>
|
asp.net javascript jquery
|
[9, 3, 5]
|
4,204,912 | 4,204,913 |
How do I check if any checkboxes at all on the page are checked?
|
<p>I need to check, using jQuery, if any checkboxes on the page are checked. The particular checkbox set they are contained in doesn't matter, just any of them.</p>
<p>Any ideas?</p>
<p>Thanks!</p>
|
javascript jquery
|
[3, 5]
|
4,579,079 | 4,579,080 |
how to send sms to mobile from web application using asp.net and c#?
|
<p>How do you send an sms message to a mobile phone from a web application using asp.net and c#?</p>
|
c# asp.net
|
[0, 9]
|
1,008,815 | 1,008,816 |
Are there any Jquery datepickers or calendar that can have a day as a link to a new page?
|
<p>I tried modifying the Jquery ui datepicker, but it didnt work in Ie7 and chrome. </p>
<p>but since im not a javascript expert I need to find a premade solution, something that makes certain days links. </p>
<p>Thank you</p>
|
javascript jquery
|
[3, 5]
|
1,346,983 | 1,346,984 |
Allowing roles in web.config
|
<p>I created an administrator role in ASP.Net configuration named "Administrators" and assigned one user to it, in my web.config I specify this:</p>
<pre class="lang-xml prettyprint-override"><code> <location path="Admin/Default.aspx">
<system.web>
<authorization>
<allow users="Administrators" />
<deny users="*" />
</authorization>
</system.web>
</location>
</code></pre>
<p>But it's not working, the user under administrator role is unable to access. Please advice.</p>
|
c# asp.net
|
[0, 9]
|
969,958 | 969,959 |
Set literal text with inline code in aspx file
|
<p>In an ASP.NET project, I have a literal. In order to set the text property, I used the following code:</p>
<pre><code><asp:Literal ID="ltUserName" runat="server" Text="<%= session.UserName %>" />
</code></pre>
<p>But instead of value of <code>session.UserName</code>, literal shows <code><%= session.UserName %></code>. I feel that solution is simple but I couldn't do it. How can set the text with inline code?</p>
|
c# asp.net
|
[0, 9]
|
1,199,582 | 1,199,583 |
Setting values to usercontrol & reloading it
|
<p>i have a usercontrol with two public properties </p>
<pre><code>public DateTime fromdate
{
get;
set;
}
public DateTime toDate
{
get;
set;
}
</code></pre>
<p>I am setting this values in my code behind. After setting the values i want to reload the usercontrol so that it fires a get method which will use these dates ...how will i reload the usercontrol </p>
|
c# asp.net
|
[0, 9]
|
3,772,841 | 3,772,842 |
How do I access the ASP control within span through span ID?
|
<p>I use custom control which creates a span and 2 asp controls with int.</p>
<pre><code><abc:edf runat="server" ID="testing" ... />
</code></pre>
<p>Now my questions is how do I access the asp control within span through span ID in javascript?</p>
<p>I can get to it by </p>
<pre><code>var test = $get('<%=testing.ClientID %>');
alert(test.all.[hard coded client ID of inner asp control].value)
</code></pre>
<p>but obviously I don't want to hard code the client ID so is there any better way to handle this?</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
1,453,070 | 1,453,071 |
Losing GridView once a rotate the device
|
<p>I am pretty new to android, and I am trying to implement a FragmentActivity, however things are not fully working, My activity layout is the following:</p>
<pre><code><RelativeLayout>
<LinearLayout>some buttons...</LinearLayout>
<android.support.v4.view.ViewPager />
<RelativeLayout/>
</code></pre>
<p>Also I have my fragment in another xml layout, as this:</p>
<pre><code><GridView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gridView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:horizontalSpacing="2dp"
android:numColumns="auto_fit"
android:stretchMode="columnWidth"
android:verticalSpacing="2dp" >
</GridView>
</code></pre>
<p>My structure is, I have a paginator with a 'n' grids inside.</p>
<p><strong>The problem:</strong></p>
<p>Everything loads just fine, and I can paginate and all grids are just fine, however once I rotate my device, the grid disappear, and a new one fadein from page ONE. I have tried to keep the state of the page. but the main problem is that the GridView, should not disappear, and I dont know what i have to do to retain it.</p>
<p>Any clue?</p>
<p><strong>EDIT</strong>
This is how my Fragment Implementation look like:</p>
<pre><code>@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
final View v = inflater.inflate(R.layout.photo_grid_fragment,
container, false);
photoGrid = (GridView) v.findViewById(R.id.gridView);
photoGrid.setAdapter(this.mAdapter);
return v;
}
</code></pre>
<p>So I am holding the photoGrid in my fragment, buy still it disappears when i rotate my device.</p>
|
java android
|
[1, 4]
|
1,415,145 | 1,415,146 |
iPhone jQuery breaks after triggering the email overlay
|
<p>I'm developing a mobile site for iPhone using jQuery. I have a hidden div (class <code>.tile-content</code>) that holds some content. Clicking a link with <code>onclick="showContent(this)"</code> calls fadeIn like this:</p>
<pre><code> function showContent(obj)
{
alert($(obj).html());
$(obj).next('.tile-content').fadeIn();
return false;
}
</code></pre>
<p>Everything works great until I tap "email us" which has a mailto: link on it, triggering the iPhone's built in email overlay functionality. I then hit cancel and am returned to the site. Now, if I click a link, my <code>.tile-content</code> div won't show up. I get the proper alert on the iPhone though. After I press that once, nothing works (which I think means there was a js error?). Having a really hard time debugging on a physical iPhone. Any ideas?</p>
<p><strong>Update:</strong> I enabled Safari Mobile's debug console thanks to a tip from @John Boker below. No errors show up, but I'm still having the same problem.</p>
|
jquery iphone
|
[5, 8]
|
1,560,513 | 1,560,514 |
How to bind a classes property to a TextBox?
|
<p>I have a Customer class with a string property comments and I am trying to bind it like this:</p>
<pre><code><asp:TextBox ID="txtComments"
runat="server"
TextMode="MultiLine" Text=<%=customer.Comments %>>
</asp:TextBox>
</code></pre>
<p>However, it gives me the error:</p>
<p>Server tags cannot contain <% ... %> constructs.</p>
<p>I also have a method in the class called GetCreatedDate and in the aspx page, I am doing
<%=GetCreatedDate()%> and <%GetCreatedDate();%>. What is the difference?</p>
|
c# asp.net
|
[0, 9]
|
4,447,454 | 4,447,455 |
Image sliding in jquery
|
<p>I have an image slider widget in my application. I am using jquery cycle for that.. I have a drop down menu where I can change the effects of the slider. But I need to insert this image slider in more than one place in a single page. And for the drop down menu I have used id.. so when I insert the image in more than one page in a single page the effect would be same for all (as I hve used the id).. So I wanted to give a class name for drop down menu.. In that case how would i assign the effects value in jquery.. Please find the code below.. Any thoughts on this would be appreciated.?/ (I am just learning jquery and JS).
Jquery code:</p>
<pre><code>var effects_id = document.getElementById('slideshow_effects').value;
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js'/></script><script type='text/javascript' src='/javascripts/jquery.cycle.all.min.js'/></script>
<script type='text/javascript'>
$.noConflict();
jQuery(document).ready(function(){
jQuery('.editor_slideshow').cycle({
fx: '"+effects_id+"',
speed: 1000,
timeout: 2000
});});
</script>
</code></pre>
<p>Drop down menu:</p>
<pre><code><select id="slideshow_effects">
<option value="fade">Fade</option>
<option value="fadeZoom">FadeZoom</option>
<option value="cover">Cover</option>
<option value="toss">Toss</option>
<option value="blindY">BlindY</option>
</select>
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,802,555 | 5,802,556 |
System.Threading.Timer example to run and display seconds until you click a button
|
<p>I am having some issues creating an asp.net page using C#
When you first click a button it starts the display of seconds via a label control.
When you click the button again the seconds stop.</p>
<p>Currently my code does just prints 0 and stops:</p>
<pre><code>System.Threading.Timer Timer;
bool endProcess = false;
int i = 0;
protected void Page_Load(object sender, EventArgs e)
{
Timer = new System.Threading.Timer(TimerCallback, null, 10, 10);
Label1.Text = i.ToString();
i++;
}
private void TimerCallback(object state)
{
if (endProcess == true)
{
Timer.Dispose();
return;
}
}
public void Button1_Click(object sender, System.EventArgs e)
{
endProcess = true;
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
4,494,273 | 4,494,274 |
Finding which element is clicked in the DOM
|
<p>The question was asked to me in an interview.</p>
<p>How to find which element is clicked by the user in the DOM using JQuery or Javascript or Both?</p>
<p>NOTE: User can click on any element in the DOM whether it is an img, div or even span.</p>
<p>If you can suggest some example then it will be very much helpful.</p>
<p>Thanks in advance</p>
|
javascript jquery
|
[3, 5]
|
2,384,978 | 2,384,979 |
Casting object from Drop Down Into Nullable type
|
<p>I have the following drop down in my aspx:</p>
<pre><code><aspx:DropDownList
ID="ddl1"
runat="server"/>
</code></pre>
<p>In the code-behind (C#), I want to retrieve the value from the DropDownList.</p>
<p>I populated my dropdown as such:</p>
<pre><code>ddl1.DataSource = LocationOfData;
ddl1.DataBind();
</code></pre>
<p>LocationOfData returns of type CustomType. EDIT: CustomType is an enum.</p>
<p>I want to be able to accomplish the following:</p>
<pre><code>CustomType? myvar = ddl1.Text
</code></pre>
<p>In other words, create a nullable variable using my CustomType and set it equal to the variable from the drop down. But the type that I can only retrieve Text (String) from ddl1.</p>
|
c# asp.net
|
[0, 9]
|
2,668,651 | 2,668,652 |
High memory usage on Android Application
|
<p>I have a little application, this application has seven activities, basically 6 are layouts with images and one is a MapActivity, among of 5 layouts one has a ArrayList of a internal class and each time that I use my application the memory grows to 50mb, 70mb, 111mb... I tried to call Garbage Collector but I didn't receive the expected result.</p>
<pre><code>public class GC
{
public static final Runtime runtime = Runtime.getRuntime();
public static void Free()
{
runtime.gc();
}
}
</code></pre>
|
java android
|
[1, 4]
|
3,279,759 | 3,279,760 |
Combing JS and PHP on one button. Is it possible?
|
<p>Hiya:
i know some people would be so tired of my questions, but I'm working on a uni project and need to get it done as soon as possible. This question is about using JS on a button(button) and sending a php_my_sql update on the same button. The problem is JS uses button, right? but PHP uses button(submit). How can I get these two to work on one of these buttons, cuz there has to be only one button.</p>
<p>this is my code for JS</p>
<pre><code><script type="text/javascript">
function formAction(){
var x=document.getElementById("collect")
x.remove(x.selectedIndex)
}
</script>
</code></pre>
<p>HTML</p>
<pre><code><form method="post">
<select id="collect" name="Select1" style="width: 193px">
<option>guns</option>
<option>knife</option>
</select> <input type="**submit/button**" onclick="formAction()" name="Collect" value="Collect" /></form>
</code></pre>
<p>PHP</p>
<pre><code> <?
if (isset($_POST['Collect'])) {
mysql_query("UPDATE Player SET score = score+10
WHERE name = 'Rob Jackson' AND rank = 'Lieutenant'");
}
?>
</code></pre>
|
php javascript
|
[2, 3]
|
2,070,706 | 2,070,707 |
Run an ajax script before submitting
|
<p>Good Day.</p>
<p>I'm having a problem with running a ajax call before a form submits. I'm just a newbie web developer so please bear with me.</p>
<p>My code is like this:</p>
<pre><code>$( function() {
$('#formname' ).submit( function() {
$.post( 'validation.php', $( this ).serialize(), function( data ) {
if( data == 'something' ) return true;
else return false;
} );
}
} );
</code></pre>
<p>This code is not working for me. Is there something wrong with the code or are there other ways to attain this.</p>
<p>Thanks in advance,</p>
|
javascript jquery
|
[3, 5]
|
4,848,732 | 4,848,733 |
auto Focus (Hit Enter) Javascript function is working good in IE7 but not working in IE8
|
<p>I used a javascript FocusChange() in my aspx page. I have couple of controls and I need Hit enter key need to move next control based on tab index. It is working good in IE7 but not working in IE8... Please help me on this..</p>
<p>Thanks for your help in advance. The java script is given below.</p>
<pre><code>function FocusChange() {
if (window.event.keyCode == 13) {
var formLength = document.form1.length; // Get number of elements in the form
var src = window.event.srcElement; // Gets the field having focus
var currentTabIndex = src.getAttribute('tabindex'); // Gets its tabindex
// scroll through all form elements and set focus in field having next tabindex
for (var i = 0; i < formLength; i++) {
if (document.form1.elements[i].getAttribute('tabindex') == currentTabIndex + 1) {
for (var j = i; j <= formLength; j++) {
if (document.form1.elements[j].disabled == false) {
document.form1.elements[j].focus();
event.returnValue = false;
event.cancel = true;
return;
}
}
}
}
}
}
</code></pre>
|
asp.net javascript
|
[9, 3]
|
1,820,835 | 1,820,836 |
retain radio button value on page refresh
|
<p>I know there are similar posts on this topic but i didn't find my answer from there.</p>
<p>An online MCQ exam test. Number of questions in the page is variable.
4 options for every MCQ(multiple choice question).</p>
<pre><code><input type="radio" name="my" value="1"/>
<input type="radio" name="my" value="2"/>
<input type="radio" name="my" value="3"/>
<input type="radio" name="my" value="4"/>
</code></pre>
<p>Examniee has to select one for each question. On page refresh, deselection takes place. How to retain the checked values on refresh - javascript, jquery or what? Details necessary.
Scripting language is php.</p>
|
php javascript jquery
|
[2, 3, 5]
|
5,262,491 | 5,262,492 |
Tourist Advisor API
|
<p>Not a very "orthodox" question, but I am looking for some open source (if such exists) that will have some way of accessing data about tourist attractions in a location of my choosing.</p>
<p>Basically something like this trip advisor app (http://www.tripadvisor.com/MobileApps), but something that I can use from my own program.</p>
<p>Does anybody know of something like this?</p>
<p>Thanks ahead.</p>
|
java android
|
[1, 4]
|
127,175 | 127,176 |
Will postback in asp.net always causes a "navigate away" warning
|
<p>I have a pretty simple questions that had stumped me so far ..
I am trying to do a one-level cascading drop down in ASP.NET.</p>
<p>So, I have two drop down boxes (among other text boxes), after ddlOne is selected, then ddlTwo will be populated.</p>
<p>here's my code in aspx</p>
<pre><code><asp:UpdatePanel ID="comboBoxWorkFlowPanel" runat="server">
<ContentTemplate>
<asp:DropDownList ID="ddlPendingUserGroup" runat="server"
DataTextField="groupName" DataValueField="groupId" OnSelectedIndexChanged="ddlPendingUserGroup_SelectedIndexChanged" AutoPostBack="true">
</asp:DropDownList>
<asp:DropDownList ID="ddlUserGroupUsers" runat="server" Enabled="false"DataTextField="userName" DataValueField="userID"></asp:DropDownList>
</ContentTemplate>
<asp:UpdatePanel>
</code></pre>
<p>and pretty much in the code behind page,
the event handler will read from the drop down and then populate the second drop down.</p>
<p>my question is, after the selection is made in the first drop down,
why am i getting a warning message ("you're about to navigate away from this page")</p>
<p>If i click ok on the warning message, the dropdown box will be loaded correctly, and other values that were previously on the page will be preserved.
If i click cancel, i get a script error instead.</p>
<p>any thoughts on this?</p>
<p>thanks!</p>
|
c# asp.net
|
[0, 9]
|
1,734,610 | 1,734,611 |
How to set width of a html tablerow in C#
|
<p>this is a follow up question to the following question link:</p>
<p><a href="http://stackoverflow.com/questions/11112112/how-to-hide-columns-in-asp-net-webform">how to hide columns in ASP.NET webform</a></p>
<p>following the answer that i got from the above link, i am using </p>
<pre><code> System.Web.UI.HtmlControls.HtmlTableRow
</code></pre>
<p>i want to set the width of the entire row. How can i do this in C#? any other idea/way you can suggest, please let me know.</p>
<p>if you have any more questions, please do not hesitate to ask.</p>
|
c# asp.net
|
[0, 9]
|
4,093,933 | 4,093,934 |
How to show human-readable "time ago"
|
<p>My user last logged in at 15:50:09 Wednesday, January 25, 2012 IST
how can i show it as "10 minutes ago".
Is there any js?</p>
|
javascript jquery
|
[3, 5]
|
4,506,955 | 4,506,956 |
Why is PHP function breaking my Javascript
|
<p>I have this scipt call:</p>
<pre><code>....
$objResponse->addScriptCall("my_script");
return $objResponse->sendResponse();
</code></pre>
<p>This works ok but if I try to send a php mail just before, the script is not called:</p>
<pre><code>...
$send =& $mailer->Send();
$objResponse->addScriptCall("my_script");
return $objResponse->sendResponse();
</code></pre>
<p>Why is that happening?
The problem persists even if I replace the email function with a plain:</p>
<pre><code>...
print 'hello';
$objResponse->addScriptCall("my_script");
return $objResponse->sendResponse();
</code></pre>
|
php javascript
|
[2, 3]
|
1,903,469 | 1,903,470 |
Making Online Banners
|
<p>I am having a website and I want that my users select any .jpg image available on website, then they add some text of their own on that image and save that image again for themselves.</p>
<p>is there jquery editor or any plugin which could enable me to achieve my task?</p>
|
php jquery
|
[2, 5]
|
1,579,560 | 1,579,561 |
Why this works out of UpdatePanel but not inside UpdatePanel?
|
<p>I have copy and paste this Alert Class:
<a href="http://madskristensen.net/post/JavaScript-AlertShow%28e2809dmessagee2809d%29-from-ASPNET-code-behind.aspx" rel="nofollow">http://madskristensen.net/post/JavaScript-AlertShow%28e2809dmessagee2809d%29-from-ASPNET-code-behind.aspx</a></p>
<p>It works except with a button inside an update panel but it shows no error. The asp code inside is executed but nothing shows up on client side. </p>
|
c# asp.net
|
[0, 9]
|
1,894,874 | 1,894,875 |
How to reference another objects property in aspx page
|
<p>I have a class, which is not present in the code behind, I have declared a property, say "Name". Now I want to access this property "Name" in the aspx page. </p>
<p>I know we can do that by creating another property or a string variable or a hidden field in the code behind page and setting the "Name" properties value to it and accessing this new property/variable/ hidden field using <%= %> in the aspx page.</p>
<p>But I don't want to go by the above approach.</p>
<p>So is there any other way.</p>
|
c# asp.net
|
[0, 9]
|
732,736 | 732,737 |
Take <span> class and put in <a> attribute jquery
|
<p>I have html like this.</p>
<pre><code><span class="gallery-open-item year-icon-Yes 2010">
<a href="/year/none">
</a>
</span>
</code></pre>
<p>I need to check using jQuery if <code>span.gallery-open-item</code> has <code>year-icon-Yes</code> class, and if so take the next (for this example is 2010) class and place it in the <code>href</code> attribute like this:</p>
<pre><code><a href="/year/2010"/>
</code></pre>
<p>All this I need in jQuery or JavaScript.</p>
<p>I have done some experiments but I can't take 2010 to normal javascript variable.
Any ideas?</p>
<p>Sorry for my English.</p>
|
javascript jquery
|
[3, 5]
|
5,528,161 | 5,528,162 |
new Date() results not always correct
|
<p>I'm wondering if there any gotchas or something like this with plain java <code>new Date()</code></p>
<p>I'm using it throughout my app to get current timestamp.</p>
<p>However, I'm seeing (occasionaly) results that out of whack. Like those dates from the future.. Any idea why something like this might happen? I'm also using following functions to convert this data to and from strings..</p>
<p><img src="http://i.stack.imgur.com/LI8BL.png" alt="enter image description here"></p>
<pre><code> private final static SimpleDateFormat databaseDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
static
{
databaseDateFormat.setTimeZone(TimeZone.getTimeZone("gmt"));
}
public static String getDateConvertedToUTCDBString(Date date)
{
return databaseDateFormat.format(date);
}
public static Date getDateConvertedFromDBString(String date)
{
try
{
return localDatabaseDateFormat.parse(date);
}
catch(java.text.ParseException e)
{
return null;
}
}
</code></pre>
|
java android
|
[1, 4]
|
3,766,950 | 3,766,951 |
use php date string in javascript
|
<p>i have a date entry in yyyy-mm-dd format in mysql database. Using php i could get the date value</p>
<pre><code>$row = $myresult['date'];
</code></pre>
<p>now i wish to alert this value in javascript</p>
<p>so i tried</p>
<pre><code>var temp_date = <?php echo($row)?>;
alert (temp_date);
</code></pre>
<p>but that didn't work for me. The problem i feel i am facing is to maintain the string format of the datestring, which seems to be getting lost when used in javascript.
Any help?</p>
|
php javascript
|
[2, 3]
|
3,487,658 | 3,487,659 |
How to access java packages in javascript
|
<p>I am writing simple javascript.
script is</p>
<pre><code>document.write("Before script");
var test=new java.lang.String();
test="Test"
document.write(test);
</code></pre>
<p>for the above script getting following error</p>
<pre><code>Uncaught ReferenceError: java is not defined
</code></pre>
<p>what might be the problem ?</p>
|
java javascript
|
[1, 3]
|
4,441,845 | 4,441,846 |
How to remove line breaks with PHP or JS
|
<p>I've tried about everything to delete some extra <code>\n</code> characters in a web application I'm working with. I was hoping someone has encountered this issue before and knows what can be causing this. All my JS and PHP files are UTF-8 encoded with no BOM.</p>
<p>And yes I've tried things like</p>
<p>In JS:</p>
<pre><code>text.replace(/\n/g,"")
</code></pre>
<p>In PHP:</p>
<pre><code>preg_replace("[\n]","",$result);
str_replace("\n","",$result);
</code></pre>
<p>and when I try </p>
<pre><code> text.replace(/\n/g,"")
</code></pre>
<p>in the firebug console using the same string I get from the server it works but for reason it doesn't work in a JS file.</p>
<p>I'm desperate, picky and this is killing me. Any input is appreciated.</p>
<p><strong>EDIT:</strong></p>
<p>If it helps, I know how to use the replace functions above. I'm able to replace any other string or pattern except <code>\n</code> for some reason.</p>
<p><strong>Answer Explanation:</strong></p>
<p>Some people do and use what works because it just works. If you are like me and for the record I always like to know why what works WORKS!</p>
<p>In my case:</p>
<p>Why this works? <code>str_replace('\n', '', $result)</code></p>
<p>And this doesn't? <code>str_replace("\n", '', $result)</code></p>
<p>Looks identical right?
Well it seems that when you enclose a string with a character value like <code>\n</code> in double quotes <code>"\n"</code> it's seen as it's character value NOT as a string. On the other hand if you enclose it in single quotes <code>'\n'</code> it's really seen as the string <code>\n</code>. At least that is what i concluded in my 3 hours headache.</p>
<p>If what I concluded is a setup specific issue OR is erroneous please do let me know or edit. </p>
|
php javascript
|
[2, 3]
|
3,955,866 | 3,955,867 |
Action bar has dissappeared
|
<p>I am new to android development and seem to be stuck at the moment. Whenever I compile and test my app on a device I getting a fatal error message:</p>
<pre><code>=1: thread exiting with uncaught exception (group=0x4137d930)
12-10 22:07:28.423: E/AndroidRuntime(20961): FATAL EXCEPTION: main
12-10 22:07:28.423: E/AndroidRuntime(20961): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.hyperlocal.tradeit/com.hyperlocal.tradeit.MainActivity}: java.lang.ClassCastException: android.widget.RelativeLayout cannot be cast to android.support.v4.view.ViewPager
</code></pre>
<p>then app stops running after the splash screen.</p>
<p>The action bar doesn't even appear in the graphical layout any more and the IDE cannot find any errors :/</p>
<p><a href="http://pastebin.com/2Fh9UVwf" rel="nofollow">Here is my code</a></p>
<p>Any help would be appreciated, thanks!</p>
|
java android
|
[1, 4]
|
2,381,966 | 2,381,967 |
Validate URL Field using Jeditable plugin
|
<p>i want to validate a URL. i am using jquery plugin jeditable. i want when some one click on the field and enter an invalid URL it show error.</p>
<p>here is my code. how can i modify . please help</p>
<pre><code>$(function() {
$("#url").editable(
function(data)
{seller=new BHSeller();
seller.updateSellerOfferGeneric('need_url',data,<?php echo $need_id?>);}
, {
indicator : "<img src='layout/images/loader.gif'>",
type : 'text',
width:'450px',
select : true,
submit : 'Save',
cssclass : "editable",
style : "display:inline"
});
});
</code></pre>
<p>how can i add validation in the above code.</p>
|
javascript jquery
|
[3, 5]
|
2,377,677 | 2,377,678 |
Clear Textboxs on submit
|
<p>Hi i am looking to clear text boxs when a user clicks a button. However the code that i have is not working. Here is my code.</p>
<pre><code>System.Net.Mail.MailMessage m = new System.Net.Mail.MailMessage();
m.Body = name.Text + Environment.NewLine + phone.Text + Environment.NewLine + email.Text + Environment.NewLine + message.Text;
m.IsBodyHtml = false;
m.To.Add("support@");
m.From = new System.Net.Mail.MailAddress(email.Text);
m.Subject = "Contact us form submisson";
m.Headers.Add("Reply-To", "your email account");
System.Net.Mail.SmtpClient s = new System.Net.Mail.SmtpClient();
s.UseDefaultCredentials = false;
s.Credentials = c;
s.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
s.EnableSsl = true;
s.Port = 587;
s.Host = "smtp.gmail.com";
s.Send(m);
lblCorrectCode.Text = "Contact Form Has been submited we will be in touch shortly";
name.Text = string.Empty;
phone.Text = string.Empty;
email.Text = string.Empty;
message.Text = string.Empty;
</code></pre>
|
c# asp.net
|
[0, 9]
|
4,650,897 | 4,650,898 |
How to assign dropdown selected value to a hidden field
|
<p>i have a dropdownlist control in asp.net which resides in a user control .The yuser control has a updatepannel .I want to set the dropdown selected value to a hidden field .How will i do this in javascript /Jquery .I don't want to use server code ?</p>
|
asp.net jquery
|
[9, 5]
|
3,291,456 | 3,291,457 |
ArrayList of images to GridView
|
<p>I have a list of images in my ArrayList, I would like to display them in GridView, the same way the example is over here: <a href="http://developer.android.com/resources/tutorials/views/hello-gridview.html" rel="nofollow">http://developer.android.com/resources/tutorials/views/hello-gridview.html</a></p>
<pre><code>ArrayList<String> myPhotos = new ArrayList<String>();
</code></pre>
<p>This specific example shows how to do it with drawables what I have already included in my project, how to do it with images that I know full path and are located in SD Card?</p>
<p>Or is there other good and easy way to display the array of images from sd card?</p>
|
java android
|
[1, 4]
|
1,497,766 | 1,497,767 |
How to use regular expression in prev()?
|
<p>How to use regular expression in prev()?</p>
<pre class="lang-html prettyprint-override"><code><div class="aaa">aaa</div>
<div style="display: none" class="bbb">bbb</div>
<div style="display: none" class="ccc">ccc</div>
<div class="ddd">ddd</div>
</code></pre>
<pre class="lang-javascript prettyprint-override"><code>$(".ddd").click(function(){
alert($(this).prev('display:visible').attr('class'));
})
</code></pre>
<p>This not working. If i have:</p>
<p>This should show me "aaa". If i remove "display: visible" from prev() then this show me "ccc".</p>
<p><a href="http://jsfiddle.net/WaVrw/" rel="nofollow">http://jsfiddle.net/WaVrw/</a></p>
|
javascript jquery
|
[3, 5]
|
3,122,254 | 3,122,255 |
Phonegap advantages and disadvantages
|
<p>what is phonegap.what is the advantages of using phonegap.what is the difference between android phonegap and blackberry phonegap.what is the disadvantages of phonegap.</p>
|
javascript android
|
[3, 4]
|
2,418,852 | 2,418,853 |
get values from an external page?
|
<p>this code is in an external url: www.example.com.</p>
<pre><code></head><body><div id="cotizaciones"><h1>Cotizaciones</h1><table cellpadding="3" cellspacing="0" class="tablamonedas">
<tr style="height:19px"><td class="1"><img src="../mvd/usa.png" width="24" height="24" /></td>
<td class="2">19.50</td>
<td class="3">20.20</td>
<td class="4"><img src="../mvd/Bra.png" width="24" height="24" /></td>
<td class="5">9.00</td>
<td class="6">10.50</td>
</tr><tr style="height:16px" valign="bottom"><td class="15"><img src="../mvd/Arg.png" width="24" height="24" /></td>
<td class="2">2.70</td>
<td class="3">3.70</td>
<td class="4"><img src="../mvd/Eur.png" width="24" height="24" /></td>
<td class="5">24.40</td>
<td class="6">26.10</td>
</tr></table>
</code></pre>
<p>i want to get the values of the td, any suggestions? php,jquery etc.</p>
|
php javascript jquery
|
[2, 3, 5]
|
1,482,564 | 1,482,565 |
whats wrong with this JS
|
<p>firebug is complaining its there is a syntax error</p>
<pre><code>if (document.getElementById("fromAddress").value == "") ||
(document.getElementById("fromAddress").value == "Enter Address, City, Directions") {
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,468,466 | 1,468,467 |
passing parameters with conditionally
|
<p><strong>Update:</strong></p>
<p>i have a dropdownlist with seven different optins like (date, subject, press, cia, media...) and user will select one of the item from the dropdownlist and click on search button to get the results.</p>
<p>here is my repository class GetInquires method which accepts 7 parameters but it will pass only one prameters at a time to the storeproc and in case of Date (it will pass both from/to)</p>
<pre><code>public List<Inquiry> GetInquiries(string fromDate, string toDate,
string subject, string press,
string cia, string media,
string status)
</code></pre>
<p>here is what i have come-up with passsing the parameters to the GetInquires</p>
<pre><code> if (!string.IsNullOrEmpty(this.txtSubject.Text.Trim()))
{
e.Result = reporterRepo.GetInquiries(null,null,txtSubject.Text,null,null,null,null);
}
else
{
e.Result = reporterRepo.GetInquiries(null,null,null,null,null,null,null);
}
else if (!string.IsNullOrEmpty(this.fromDate.Text.Trim()))
e.Result = reporterRepo.GetInquiries(fromDate.Text,null,null,null,null,null,null)
.......................
...................
....................
</code></pre>
<p>i have to continue seven times with (if else if conditions) for all seven parameters
is there away i can do it more clearly and more readability?</p>
|
c# asp.net
|
[0, 9]
|
960,740 | 960,741 |
cyclic tab order with jquery
|
<p>Is there a nice way to set a desktop-like tab order in a form with jquery? the form has four text inputs and two buttons; after the last button loses focus, I want the first text input to get focus and start tab order from the beginning (to 2nd tb, to 3rd tb...). I did this:</p>
<pre><code> $('body').delegate('#second_button', 'blur', function() {
$('#first_input_text').focus();
});
</code></pre>
<p>but it only works in Opera. Chrome IE9, And Firefox do set focus on first text input but when user press tab again it goes to address bar instead of the second text input. I could set above binding to all elements in cycle but is there a more elegant solution?</p>
|
javascript jquery
|
[3, 5]
|
1,579,062 | 1,579,063 |
Dataview Table.Rows.Count is retuned 1 when there is no such rows
|
<p>consider the code below:</p>
<pre><code>DataView deletedLOV = new DataView(tbltmp, "prociLOV_Deleted=1", "prociLOV_ID",
DataViewRowState.CurrentRows);
DataView addedLOV = new DataView(tbltmp, "prociLOV_Id>1", "prociLOV_ID",
DataViewRowState.CurrentRows);
int deletedLOVcount=deletedLOV.Table.Rows.Count;
int addedLOVcount=addedLOV.Table.Rows.Count;
</code></pre>
<p>prociLOV_Deleted is set to 1 when a record is deleted.</p>
<p>But even when no records are deleted the deletedLOVcount return value 1.Also the same with addedLOVcount when there is no record with proci_ID>1 ,it too returns count as1</p>
|
c# asp.net
|
[0, 9]
|
5,142,627 | 5,142,628 |
file not downloaded in webmethod
|
<p>I am using webmethod to download a .zip file but file is not download. my code run well without error, code is below:
<br></p>
<pre><code> [WebMethod]
public static void DownloadExtension(string ExtensionPath)
{
string filepath = HttpContext.Current.Server.MapPath(ExtensionPath);
FileInfo file = new FileInfo(filepath);
if (file.Exists)
{
HttpContext.Current.Response.ClearContent();
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
HttpContext.Current.Response.AddHeader("Content-Length", file.Length.ToString());
HttpContext.Current.Response.ContentType = ReturnExtension(file.Extension.ToLower());
HttpContext.Current.Response.TransmitFile(file.FullName);
HttpContext.Current.Response.End();
}
}
private static string ReturnExtension(string fileExtension)
{
switch (fileExtension)
{
case ".zip":
return "application/zip";
default:
return "application/octet-stream";
}
}
</code></pre>
<p><br>
i am using <strong>VS2008</strong> any solution thank you.</p>
|
c# asp.net
|
[0, 9]
|
4,471,438 | 4,471,439 |
jquery link handler with google ads link
|
<p>my jquery</p>
<pre><code>jQuery(function(){
jQuery('div.class a').click(function() {
alert("hello");
});
});
</code></pre>
<p>google ads link</p>
<pre><code><a id="aw0" class="adt" target="_top" onmouseover="return ss('','aw0')" onmousedown="st('aw0')" onfocus="ss('','aw0')" onclick="ha('aw0')" href="/aclk?sa=l&ai=BH3xd2ZmTSvrMC5iKqAO2v7XDBv6jtl-mgLjKDMCNtwGA8QQQARgBILCNuQooBTgAUO3uw-4EYPEDoAHdtsH_A7IBCWxvY2FdsG9zdLoBCjE2MHg2MDBfYXPIAQHaARdodHRwOi8vbG9jYWxob3N0L21lZHV1L8gCrOj9A6gDAcgDB-gDigPoA9gC6AMf6AMg9QMAAAAE&num=1&sig=AGiWqtyWbhq4GCyGudApdZUjBApw4vI74w&client=ca-pub-0099118250769400&adurl=http://www.nixusoftware.com/products_nss.html">
<span>Nixu Software's Warning</span>
</a>
</code></pre>
<p><strong>My problem is jquery not properly work with google ads link</strong></p>
<p>// other links no problem (<code><a>link</a></code>)</p>
<p>is jquery functions conflict with google ads functions</p>
<p>Please help me</p>
|
javascript jquery
|
[3, 5]
|
5,016,479 | 5,016,480 |
dynamically applying image src is not working in FF and IE
|
<p>Try the follwing code in w3schools in FF, IE and chrome. Observe the behavior.
In chrome the image is reloading. But in IE and FF it's not working.</p>
<pre><code><!DOCTYPE html>
<html>
<head>
<script>
function changeSrc()
{
document.getElementById("myImage").src="some captcha url";
}
</script>
</head>
<body>
<img id="myImage" src="compman.gif" width="107" height="98">
<br><br>
<a href="#" onclick="changeSrc();">reload</a>
</body>
</html>
</code></pre>
<p>Thanks,
Sravanthi.</p>
|
javascript jquery
|
[3, 5]
|
576,405 | 576,406 |
Javascript conditional postback on button click
|
<p>I have a button control in my ASP.NET page which should conditionally postback based on some criteria.</p>
<pre><code><input runat="server" type="button" id="btnDone" value="Select" onclick="return SendAndCloseAdvWin();" onserverclick="serverProcessing" />
</code></pre>
<p>.</p>
<pre><code>function SendAndCloseAdvWin() {
var win = GetRadWindow();
if (GetRadCtrl('lstSelectors').get_checkedItems().length == 0) {
DisplayError('Please select atleast one item.');
return false;
}
else {
if (win) {
win.close(GetSelectedItems());
return true;
}
}
}
</code></pre>
<p>If the condition is true the page should not postback, else it should postback. But i find that even if the condition fails the page does not postback. Am i missing somwething here?</p>
|
javascript asp.net
|
[3, 9]
|
2,843,532 | 2,843,533 |
Extending $.fn.init function
|
<p>I'm trying to extend jQuery with the following:</p>
<pre><code>$.fn.extend({
initCore: $.fn.init,
init: function (selector, context, rootjQuery) {
return $.fn.initCore(selector, context, rootjQuery);
}
}),
</code></pre>
<p>However, it doesn't seem to work right, and creating simple things such as an alert on click produce errors. Can anyone spot the problem?</p>
<p>Thanks in advance!</p>
|
javascript jquery
|
[3, 5]
|
345,061 | 345,062 |
alter regex to accept phone number with or without spaces
|
<p>I have the regex to validate uk phone numbers but it is currently forcing the user to input a space before it will accept the number how do I alter it to make it accept numbers with or without spaces.</p>
<pre><code> /^0\d{2,4}[ -]{1}[\d]{3}[\d -]{1}[\d -]{1}[\d]{1,4}$/
</code></pre>
|
javascript jquery
|
[3, 5]
|
873,388 | 873,389 |
Need whole body tag mouseover function
|
<p>I need to whole body mouseover function. When I enter some other page, some of my content will append the particular div. </p>
<p>My code is:</p>
<pre><code>$('body').mouseover(function() {
$('#text').append('<div>New content</div>');
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,271,466 | 1,271,467 |
Getting index of a value in DataTable
|
<p>i need to get index of a value in DataTable.</p>
<p>I'm trying to get like that.</p>
<pre><code> SqlDataAdapter da = new SqlDataAdapter("SELECT MessageID,SenderID,MessageContent FROM Messages WHERE ThreadID="+ThreadID, connectionString);
//Get all messages in the Thread.
DataTable dt = new DataTable();
da.Fill(dt);
da.SelectCommand.CommandText = "SELECT MessageID,SenderID,MessageContent FROM Messages WHERE MessageID="+MessageID;
//Get the message which i need to get index.
DataTable dtMsg = new DataTable();
da.Fill(dtMsg);
//Get index of dtMsg.Rows[0] in dt.
int msgIndex = dt.Rows.IndexOf(dtMsg.Rows[0]);
</code></pre>
<p>I analized it when debugging values are same but its returning -1 everytime.
What i can do?</p>
|
c# asp.net
|
[0, 9]
|
415,562 | 415,563 |
dialog box with multiple checkboxes android souce code
|
<p>I have an android app with a button. When clicking the button I need on the screen a dialob box with multiple check boxes annd an ok button. How to do that? Do i need an xml layout for the list with checkboxes?</p>
<p><strong>1. How to add to each element in the list dialog box a check box?</strong></p>
<p><strong>2. How to put in a string all the checked elements when the button OK is pressed.</strong></p>
<p>this is my code so far:</p>
<pre><code> app_part.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
final String items[] = {"1","2","3","4"};
AlertDialog.Builder ab=new AlertDialog.Builder(ConferenceClass.this);
ab.setTitle("SIP CONTACTS");
ab.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface d, int choice) {
// on OK button action
}
});
ab.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface d, int choice) {
// on Cancel button action
}
});
ab.setItems(items, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface d, int choice) {
}
});
ab.show();
//open contact list and select persons
}
});
</code></pre>
|
java android
|
[1, 4]
|
2,141,296 | 2,141,297 |
Insert '-' every 5 characters as users type [like a product key]
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/109854/auto-format-structured-data-phone-date-using-jquery-plugin-or-failing-that-v">Auto-format structured data (phone, date) using jQuery plugin (or failing that vanilla JavaScript)</a><br>
<a href="http://stackoverflow.com/questions/6579584/insert-space-after-certain-character-into-javascript-string">Insert space after certain character into javascript string</a> </p>
</blockquote>
<p>I am trying to write a script that handles product keys like the ones you see on the back of software and games.</p>
<p>I would like so when the user is inputing their key code the '-' are inserted every 5 characters for 5 sets of characters. Ex(<code>ABCDE-FGHIJ-KLMNO-PQRST-UVWXY</code>). So when the user enters <code>ABCDE</code> as soon as the '<code>E</code>' is enetered a '<code>-</code>' is inserted immeditly after via jQuery or JavaScript.</p>
<p>Thanks In Advance.
Comment if you have any questions or if I was unclear :)</p>
<p>Form:</p>
<pre><code><form method="post" action="process.php">
<p>Key: <input name="key" id="key" size="40"></p>
<p><input type="submit"></p>
</form>
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,314,252 | 2,314,253 |
The method 'after' does not work with elements not yet in DOM
|
<p>I want to add two HTML elements to a Dom element one after another. But this call does not work with jQuery</p>
<pre><code>$("<button>click me</button>").after("<span> or be happy </span>")
.appendTo("#someId");
</code></pre>
<p>The reason I cannot combine the two elements in one string is that I want to add a event handler to the first. So what I really want to do is:</p>
<pre><code>$("<button>click me</button>").after("<span> or be happy </span>")
.on("click", function() {
// do something
});
</code></pre>
<p>Right now, my workaround is to assign an id to the button and add the "span" in a separate jQuery call. Like so...</p>
<pre><code>$('<button id="uid">click me</button>').on("click", function() {
// do something
});
$('#uid').after('<span> or be happy</span>');
</code></pre>
<p>It there a better way?</p>
|
javascript jquery
|
[3, 5]
|
4,943,930 | 4,943,931 |
Under what conditions do chained jQuery objects offer performance gains?
|
<p>I'm working with some code that adds and removes various CSS classes on the same object. The code looks something like:</p>
<pre><code>function switch_states(object_to_change) {
if(object_to_change.hasClass('ready') {
object_to_change.removeClass('ready');
object_to_change.addClass('not_ready');
} else {
object_to_change.removeClass('not_ready');
object_to_change.addClass('ready');
}
}
</code></pre>
<p>I suspect I might be able get away with chaining these two snippits into something like <code>object_to_change.removeClass('ready').addClass('not_ready');</code> But I have to wonder: besides legibility and the neato factor, does this give me any performance gains?</p>
<p>My question: Would a chained objects do their work any faster than two non-chained ones? If so, why? If not, at what point does using chained objects become more efficient than disparate ones -- i.e. under what conditions do chained jQuery objects offer performance gains?</p>
|
javascript jquery
|
[3, 5]
|
1,936,696 | 1,936,697 |
reading preference value
|
<p>i am working on android and trying to read a value from my preference file.
but when i run.a message appears in emulator.the
<strong>the application has stopped unexpectedly</strong>
here is my preference file name pref.and it is inres/xml</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<CheckBoxPreference android:defaultValue="false"
android:key="@string/first"/>
</PreferenceScreen>
</code></pre>
<p>this is main activity where i am reding the value.</p>
<pre><code>package code.finalwork;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.widget.EditText;
public class FinalWorkActivity extends Activity {
private String pref_file="pref.xml";
EditText text=(EditText) findViewById(R.id.editText1);
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
SharedPreferences pref=getSharedPreferences(pref_file,Context.MODE_PRIVATE);
Boolean val= pref.getBoolean("firstuse", true);
if(val)
{
text.setText("first use");
}
else
{
text.setText("Not first use");
}
}
}
</code></pre>
<p>please someone figure out the problem.</p>
|
java android
|
[1, 4]
|
5,707,015 | 5,707,016 |
credit card or online payable php code
|
<p>for a hotel web site there are a featured for online advanced room booking using credit or debit card. but i am unable to write that specific code. please answered if possible.</p>
|
php javascript
|
[2, 3]
|
1,878,194 | 1,878,195 |
Is there a PHP equivalent of "new Array (number)" in javascript?
|
<p>I was trying to convert basic javascript function into PHP, and I saw that one of the variables was declared var Variable = new Array (13).</p>
<p>I know that PHP variables are declared like: $variable = array()</p>
<p>but what about the "13" in new Array(13)? does that translate to $variable = array(13)? I've tried that but it didn't seem to work.</p>
<p>This in JavaScript</p>
<pre><code>var results = new Array (13);
</code></pre>
<p>becomes this in PHP, am I correct?</p>
<pre><code>$results = array(13);
</code></pre>
|
php javascript
|
[2, 3]
|
1,192,383 | 1,192,384 |
dynamically created button click event not firing
|
<p>I have done a bit of research on this but none of the solutions I have found seem to provide a fix for my issue. I have an asp.net web app in C# and I want to dynamically add a submit button after a selection is made from a drop down list. </p>
<pre><code> protected void Page_Load(object sender, EventArgs e)
{
submitButton.Text = "Submit";
submitButton.ID = "submitButton";
submitButton.Click += new EventHandler(submitButton_Click);
SelectionDropDownList.SelectedIndexChanged += new EventHandler(SelectionDropDownList_SelectedIndexChanged);
}
protected void SelectionDropDownList_SelectedIndexChanged(object sender, EventArgs e)
{
switch (SelectionDropDownList.SelectedIndex)
{
case 1:
//does a redirect
break;
case 2:
Panel1.Controls.Add(submitButton);
break;
case 3:
//does a redirect
break;
}
}
protected void submitButton_Click(object sender, EventArgs e)
{
//can't get this event to fire.
SubmitSearch();
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
800,535 | 800,536 |
How do I continue download if preventDefault is used?
|
<p>I have a jQuery modal UI basically blocks users from downloading a file. I use <code>preventDefault</code> to stop the download manager show up. But this kills the <code>GET</code>. </p>
<p>After the user clicks <code>Agree</code>, how can I request proceed download?</p>
<p>I've googled this and most of them are doing form submission.</p>
|
javascript jquery
|
[3, 5]
|
4,709,473 | 4,709,474 |
submit button issue with jquery and php
|
<p>The problem:</p>
<p>when the input type on my submit button is changed to 'button' it does NOT save info to mysql but validation works. If i change it to input type on submit button to 'submit' it saves info to mysql but the validation does not work. Is there a resolution to this?</p>
<p>jquery validation - function on click:</p>
<pre><code> $("input:button").click(function(){
var retVal = false;
$.each([1, 2], function(i, val){
retVal = (validate(val) || retVal);
});
return retVal;
</code></pre>
<p>On my form the submit button code is:</p>
<pre><code><input type="submit" value="Submit" />
</code></pre>
<p>The form action is:</p>
<pre><code> <form name="list1"; action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" >
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,488,123 | 3,488,124 |
C# folders and sub folders
|
<p>How to do this:</p>
<ul>
<li>Check if folder upload exists (if nor then create it) ~/ uploads</li>
<li>Check if subfolder with username exists ~/uploads/folder with username</li>
</ul>
<p>It as to check for each case individually because I could add a new user to the system and of course the folder uploads alredy exists, just need to create a sub folder with username</p>
|
c# asp.net
|
[0, 9]
|
3,971,630 | 3,971,631 |
Is the DVM an interpreter or a Compiler?
|
<p>Is the DVM an interpreter or a compiler? Why did google have to come up with the DVM when there is already the JVM? Can the JVM not be used in mobile platforms? If not why not?</p>
|
java android
|
[1, 4]
|
1,397,357 | 1,397,358 |
IP Camera Android Application
|
<p>I am new in android application
& I want to make android application to view & control IP cameras
but I don't know from where I can start
I want to know if there are specific cameras that can be controlled? or any IP camera can be controlled?
as I want to choose between three types of VIVOTEK camera
please any help</p>
<p>Thanks in advance</p>
|
java android
|
[1, 4]
|
5,513,895 | 5,513,896 |
Delete all numbers from a text using PHP or JavaScript
|
<p>I have a .txt file that contains a list of names and some numbers.
For example,</p>
<hr>
<p>AARON 0.24 350,151 77</p>
<p>ABDUL 0.007 10,213 831</p>
<p>ABE 0.006 8,754 854</p>
<hr>
<p>and on...</p>
<p>So, I need to delete ALL numbers from that list using PHP or JavaScript with returning words from the list.</p>
<p>P.S.: I'm just learning these languages so, please, answer concretely- with full code and with its place.</p>
|
php javascript
|
[2, 3]
|
2,206,598 | 2,206,599 |
How to swap fadeIn/fadeOut of dynamically created selectors
|
<p>I am swapping out divs generated with a php foreach loop like this...</p>
<pre><code><img class="trigger" name="showme-<?php echo $stuff ?> ... >
<div id="showme-<?php echo $stuff ?>" style="display:none"></div>
$('.trigger').click(function(){
var num=$(this).attr("name");
$('#'+num).fadeIn();
</code></pre>
<p>This works fine.. but my question is how do I not just fade in these elements but also fade out the ones that are currently sitting there so I am only showing one showme-var div at a time? Because I do not know which one is currently showing I can not use the selector to identify who needs to be faded out. Can I add a wildcard "*" to the selector or maybe use .children of a parent div?</p>
|
javascript jquery
|
[3, 5]
|
1,175,977 | 1,175,978 |
Could not load file or assembly log4net or one of its dependencies
|
<p>I've been asked to take a look at an error in an ASP/C# application with its Paypal integration. The error, shown in full, is:</p>
<blockquote>
<p>Could not load file or assembly
'log4net, Version=1.2.0.30714,
Culture=neutral,
PublicKeyToken=b32731d11ce58905' or
one of its dependencies. The located
assembly's manifest definition does
not match the assembly reference.
(Exception from HRESULT: 0x80131040)</p>
</blockquote>
<p>From what I understand, this means that the actual file located (that is, log4net.dll in my bin directory) does not match the version expected based on some assembly configuration. The problem I'm having is that I cannot locate where this file is being referenced.</p>
<p>I have access to all the files in the web root directory of the site, and cannot locate any config files that reference this DLL. Where else might I need to look to determine what's causing the mis-match?</p>
<p>As a note, I've made sure that the version of the DLL in the bin directory is up to date, but this does not seem to have resolved anything.</p>
|
c# asp.net
|
[0, 9]
|
3,918,478 | 3,918,479 |
How to reset specific form element in a search form?
|
<p>I have a search form that has different elements in it, checkboxes, selects, text fields etc. Each change is accompanied by an ajax call that gets the number of results as a sort of counter. I would like to reset only the previous element that caused the counter to return a value of 0.</p>
<p>I was thinking about keeping track of each change in a variable, and each time the counter evaluates to 0, I would then reset the element that caused the change. I however fear that this could force me to handle all the different elements differently with a lot of code and jumping around.</p>
<p>Is there a possible more elegant solution to the problem that anybody can think of? I would appreciate the help.</p>
|
javascript jquery
|
[3, 5]
|
1,282,036 | 1,282,037 |
Fire an ASP.NET TextBox event on enter press
|
<p>How do i fire a ASP.NET click event when the user press enter.</p>
<p>This is what i do now but it does not work:</p>
<pre><code>function KeyDownHandler(event) {
if (event.keyCode == 13) {
__doPostBack('<% ButtonGetListforUser.ClientID %>', 'OnClick');
isClicked = true;
}
}
</code></pre>
|
c# javascript asp.net
|
[0, 3, 9]
|
1,598,254 | 1,598,255 |
how can i use position bottom to animate a div to the top of page
|
<p>I currently am trying to animate the position of a div in a 3 tier structure, the first tier shows only the header, the second the header and excerpt and then the 3rd some additional copy. At the moment I can animate position bottom for both tier 1 and tier 2 but cant seem to figure out how I animate the tier 3 to what would ideally be top:0 which I dont think I can do. Can anyone offer any advice on how this can be achieved?</p>
<p>JS</p>
<pre><code>more.on('click', function(e){
if( body.hasClass('tier1') ){
body.removeClass('tier1').addClass('tier2');
wrapper.delay(500).animate({ bottom: wrapper.data('tier2') }, 400, function(){
//show close
close.show();
});
} else if ( body.hasClass('tier2') ){
body.removeClass('tier2').addClass('tier3');
wrapper.delay(1500).animate({ bottom: '300' }, 500, function(){ // show be top of window
// hide read more
more.hide();
// hide .excerpt + show .upper
excerpt.fadeOut(function(){
upper.fadeIn();
});
});
}
e.preventDefault();
});
</code></pre>
<p>Link to current build: <a href="http://bit.ly/IA65Mb" rel="nofollow">http://bit.ly/IA65Mb</a></p>
<p>Kyle</p>
|
javascript jquery
|
[3, 5]
|
2,501,869 | 2,501,870 |
multiplication error
|
<p>If I multiply 12 x 25.4 i get 304.7 whereas I expect 304.8. I see that using odd numbers x 25.4 I get the correct answers but using even numbers always seem to be off by 0.1. I am writing a scientific app that is heavily based on formulas so any insight would be helpful. </p>
<pre><code>if (((m1_sqs1_spinner.getSelectedItem().toString().equals("in"))))
{ // start square in inches
double m1_sqs1_eng = new Double(m1_sqs1.getText().toString());
double square_effective_dia_inch = m1_sqs1_eng;
double square_effective_dia_mm = square_effective_dia_inch * 25.4;
m1_ed_mm.setText(Double.toString(square_effective_dia_mm));
} // end square in inches
</code></pre>
|
java android
|
[1, 4]
|
103,560 | 103,561 |
Passing data between activities
|
<p>My main activity contains a EditText and a button.
I would like to send whats written in the EditText to the next activity started by pressing the button. </p>
<p>In the first activity I have this:</p>
<pre><code> Intent i = new Intent(firstActivity.this, secondActivity.class);
i.putExtra("myString", theEditText.getText());
startActivity(i);
</code></pre>
<p>So far so good. In the second activity I use this:</p>
<pre><code> Bundle bundle = getIntent().getExtras();
myRecivedString = bundle.getString("myString")
</code></pre>
<p>But here myRecivedString turns up empty. </p>
<p>Any suggestions?</p>
|
java android
|
[1, 4]
|
1,496,801 | 1,496,802 |
Should one bind data with Eval on aspx or override ItemDataBound in code-behind?
|
<p>For data bound controls (Repeater, ListView, GridView, etc.), what's the preferred way of binding data?</p>
<p>I've seen it where people use Eval() directly on the aspx/ascx inside the data bound control to pull the data field, but to me, it just seems so...inelegant. It seems particularly inelegant when the data needs to be manipulated so you wind up with shim methods like <code><%# FormatMyData(DataBinder.Eval(Container.DataItem, "DataField")) %></code> inside your control.</p>
<p>Personally, I prefer to put in Literal controls (or other appropriate controls) and attach to the OnItemDataBound event for the control and populate all the data to their appropriate fields in the code-behind.</p>
<p>Are there any advantages of doing one over the other? I prefer the latter, because to me it makes sense to compartmentalize the data binding logic and the presentation layer. But maybe that's just me.</p>
|
c# asp.net
|
[0, 9]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.